linkeddata / rdflib.js

Linked Data API for JavaScript
http://linkeddata.github.io/rdflib.js/doc/
Other
565 stars 143 forks source link

Signature of all things which take S, P O, G should be consistent #417

Open timbl opened 4 years ago

timbl commented 4 years ago

At the moment you can write

     store.add(me, ns.foaf('age'), 6, me.doc())

where the 6 is converted automatically to a literal but you can't do

     let st = store.st(me, ns.foaf('age'), 6, me.doc())
     store.add(st)

as the new statement code doesn't do the same liberal type coercion. In an ideal world, developers should know that they can use the same shortcuts (like string, Date, number, etc) with any function or method which takes subject, predicate, object, graph or for that matter subject, predicate, object .

This probably means bother using common functions to convert and using the same names of types.

This includes st, add, match, and probably others.

megoth commented 4 years ago

Would also fix https://github.com/linkeddata/rdflib.js/issues/416