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 }})

white-gecko

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.

@white-gecko

@coveralls

Coverage Status

Coverage decreased (-0.4%) to 75.195% when pulling 0460579 on white-gecko:feature/FixBlankLabelInSparqlParser into 1503dae on RDFLib:master.

@white-gecko

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 white-gecko changed the titleFix blank node label to not contain '_:' during parsing WIP: Fix blank node label to not contain '_:' during parsing

Dec 11, 2018

@white-gecko

@white-gecko white-gecko changed the titleWIP: Fix blank node label to not contain '_:' during parsing Fix blank node label to not contain '_:' during parsing

Dec 11, 2018

@white-gecko

Now this is even tested :-)

@white-gecko

Is it possible to accept this PR? What is missing?

@joernhees

thanks for the contribution and sorry for the long wait... only thing missing is/was time :-/

@white-gecko white-gecko deleted the feature/FixBlankLabelInSparqlParser branch

October 31, 2019 22:42