linkeddata / rdflib.js

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

Adding .doc() to bNodes??? #498

Open timbl opened 3 years ago

timbl commented 3 years ago

A very useful shortcut routine for a NamedNode is doc() method which returns a NamedNode for the document within which the node is defined in the linked data sense.

When following links from the thing x, then one looks for statements in x.doc().

It is also valuable fo check whetherx.doc() is editable before offering a user the option of editing data about x.

But what if x is a BlankNode? This facility is not available, This means that any code which allows users to edit the graph around x has to keep a separate track of the document where x was defined.

This is actually ironic, as in fact every blank node in the rdflib.js world is in fact produced when parsing a particular document, and so we could keep track of that document. This would allow us to support .doc() on blank nodes, which would make life simpler.