High level sexy JS rdf interface?

(This is with a set of emails which I thin were unsent weeks ago - sorry if a dupliate)

Abstract:
 There should be work on making RDF systems in a very easy to use JS-like way for a JS developer. Where is that discussion happening or where should it happen?

Ramble:

The low-level TF is working on low-level objects to represent RDF concepts, where you have things like


 > x.datatype
  'http://www.w3.org/2001/XMLSchema#integer’;
 > x.value
  ‘2’

in other words 
 - easy for the quadstore implementers to input and output
 - easy to test against RDF specs

But is this set if requirements rather different from the needs ot API users. basically a sexy RDF implementation is one which:

 - Has very natural integration with JS (ES6)
 - Has no visible artifacts of the RDF system like the URIs of data types



 - add together numbers
 - iterate over RDF collections just as Arrays. 

There is another set of requirements for what you might call a high level 

where you’d maybe like things like


 x = turtle(‘2’)
 y = turtle(‘2.0’)
 if (x  !== y) {
  var z = x / y;
 }

 > x
  2
 > y
  2.0

 > x.datatype
  ''http://www.w3.org/2001/XMLSchema#integer'



 > a = turtle(‘( 1 “one”) ‘);
 > a.length
  2
 a[1].length
  3

Questions around this include

 - can we actually use javascript numeric, array objects for our nodes?
 - can we use subclasses of them?



Dates and decimal numbers are examples  datatype which developers need to use all the time.  Jost look at your bank data for decimals which you do not really want to be JS real numbers, and datetimes.   GPX files are full of datetimes.  Why not store them as subclasses of a JS Date class?

Or even ambush it the Date type itself?

 Date.prototype.datatype = ''http://www.w3.org/2001/XMLSchema#dateTime”
 Date.prototype.rdfValue = function(return  isoformat(self) + “^^”+ 
   ''http://www.w3.org/2001/XMLSchema#dateTime”)


 var then = store.any(item, OFX.date); // get date of item
 var now = rdf(Date.now());   // rdf() is smart and gives me and RDF node
 ago = now - then;      //  seconds

 
Or to avoid stomping on the main JS classes one could instead use special RDF functions instead of 

 rdf.datatype(2);
  ''http://www.w3.org/2001/XMLSchema#float';

 rdf.datatype(“2");
  ''http://www.w3.org/2001/XMLSchema#string';

 rdf.datatype(Date.now());
  ''http://www.w3.org/2001/XMLSchema#dateTime';

 rdf.datatype(“2");
  ''http://www.w3.org/2001/XMLSchema#string';


Then we could say do

 g.add(item, OFX.date, Date.now())
 g.add(item, amount, Decimal(‘125.06'))
 g.add(item, OFX.payee, “Acme co")

Received on Sunday, 20 December 2015 15:59:16 UTC