SPARQLStore customizable BNode handling by joernhees · Pull Request #513 · RDFLib/rdflib (original) (raw)

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

joernhees

this implements the discussion in #512

please check

@ssssam

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.

@joernhees

…ocalName methods

also prepared configurable node_from_result arg.

uholzer

def _node_to_sparql(node):
if isinstance(node, BNode):
raise Exception(
"SPARQLStore does not support BNodes! "

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 ..."

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)

@uholzer

This has been quite some work it seems. Except for the nitpick in my previous comment, this looks good to me.

@joernhees

eh, it's mostly moves, deprecations and cleanups...

thanks for reviewing, i'll merge this soon if no one objects

@ssssam

This looks like it'll resolve the issue I had in #511 and #512, thanks !!

joernhees added a commit that referenced this pull request

Aug 27, 2015

@joernhees

SPARQLStore customizable BNode handling, deprecations and cleanups

joernhees added a commit that referenced this pull request

Aug 27, 2015

@joernhees

@joernhees

@ssssam you can try by installing rdflib like this: pip install -U git+git://github.com/RDFLib/rdflib (until 4.2.2 is released)

joernhees added a commit to joernhees/rdflib that referenced this pull request

Mar 9, 2016

@joernhees

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

joernhees added a commit to joernhees/rdflib that referenced this pull request

Mar 9, 2016

@joernhees

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

joernhees added a commit to joernhees/rdflib that referenced this pull request

Mar 9, 2016

@joernhees

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