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.
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 inx.doc()
.It is also valuable fo check whether
x.doc()
is editable before offering a user the option of editing data about x.But what if
x
is aBlankNode
? This facility is not available, This means that any code which allows users to edit the graph aroundx
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.