Fix blank node label to not contain '_:' during parsing by white-gecko · Pull Request #886 · RDFLib/rdflib (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation5 Commits2 Checks0 Files changed
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 }})
When parsing a query, e.g.:
PREFIX ex: <http://example.org/>
INSERT DATA { GRAPH ex: { _:blankA a ex:Bla }}
The generated BNode
would be BNode("_:blankA")
serializing this blank node with BNode("_:blankA").n3()
results in _:_:blankA
which the parser can not understand.
Coverage decreased (-0.4%) to 75.195% when pulling 0460579 on white-gecko:feature/FixBlankLabelInSparqlParser into 1503dae on RDFLib:master.
To reproduce the whole round trip situation:
import rdflib
graph = rdflib.Graph()
graph.update("INSERT DATA { _:blankA a <urn:Bla> }")
string = graph.serialize(format='ntriples').decode('utf-8')
# Does not work:
rdflib.Graph().parse(data=string, format="ntriples")
# This would be correct:
rdflib.Graph().parse(data="_:blankA <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <urn:Bla> .", format="ntriples")
white-gecko changed the title
Fix blank node label to not contain '_:' during parsing WIP: Fix blank node label to not contain '_:' during parsing
- check if the bnode is parsed correctly from the query
- check of the bnode is serialized to ntriples correctly after an update and if it can be parsed again
- add these two tests for the SPARQL store and the inmemory Graph()
white-gecko changed the title
WIP: Fix blank node label to not contain '_:' during parsing Fix blank node label to not contain '_:' during parsing
Now this is even tested :-)
Is it possible to accept this PR? What is missing?
thanks for the contribution and sorry for the long wait... only thing missing is/was time :-/
white-gecko deleted the feature/FixBlankLabelInSparqlParser branch