-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPARQLStore customizable BNode handling #513
Conversation
The 4Store triple store understands <bnode:> URIs as pointing to blank nodes, which makes it possible to query and update them using its SPARQL endpoint.
…ocalName methods also prepared configurable node_from_result arg.
9ad8edd
to
469970b
Compare
469970b
to
89c6255
Compare
def _node_to_sparql(node): | ||
if isinstance(node, BNode): | ||
raise Exception( | ||
"SPARQLStore does not support BNodes! " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this Exception should now say "SPARQLStore does not support BNodes by default! See ..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i thought so too, but as this currently raises an overly broad exception, the only thing people can do is rely on its message to actually handle it. That's why I decided against it for now and didn't change the message.
i made an issue to change all raise Exception
to something more appropriate in 5.0.0 (see #515)
This has been quite some work it seems. Except for the nitpick in my previous comment, this looks good to me. |
eh, it's mostly moves, deprecations and cleanups... thanks for reviewing, i'll merge this soon if no one objects |
SPARQLStore customizable BNode handling, deprecations and cleanups
* sparql_store_bnode: test changed to use _node_from_result instead of CastToTerm
@ssssam you can try by installing rdflib like this: |
initBindings, contexts, addN, remove, add_graph and remove_graph now call the node_to_sparql customizable function. Some support for BNode graph names added. Add-on for RDFLib#513, see also RDFLib#511, RDFLib#512
query (initBindings), contexts, addN, remove, add_graph and remove_graph now call node_to_sparql. Some support for BNode graph names added. Add-on for RDFLib#513, see also RDFLib#511, RDFLib#512
query (initBindings), contexts, addN, remove, add_graph and remove_graph now call node_to_sparql. Some support for BNode graph names added. Add-on for RDFLib#513, see also RDFLib#511, RDFLib#512
this implements the discussion in #512
CastToTerm
,TraverseSPARQLResultDOM
andlocalName
methodsSPARQLStore(..., bNodeAsURI)
argumentSPARQLStore(..., node_to_sparql, node_from_result)
args to customize node transformationsBNodes
please check