-
Notifications
You must be signed in to change notification settings - Fork 543
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
The # character is erased from the URI of a NAMED graph while querying it #1160
Comments
The source of the problem appears to be here: https://github.com/RDFLib/rdflib/blob/master/rdflib/parser.py#L262 absolute_location = URIRef(location, base=base).defrag()
...
input_source = URLInputSource(absolute_location, format) The Line 262 in 5e06430
def defrag(self):
if "#" in self:
url, frag = urldefrag(self)
return URIRef(url)
else:
return self The problematic line 262 in Preparing a PR for this... |
After adding this, I realized that FROM NAMED <iri> AS <another_iri> But this construct arguably does not work? |
Please consider the following Python snippet.
On my machine, this outputs:
Essentially, what's happening is that we create one named graph from http://www.w3.org/2000/01/rdf-schema# and then query the RDF dataset for all named graphs which have at least one triple. Which yields http://www.w3.org/2000/01/rdf-schema - without the
#
character.I found this when debugging a larger SPARQL query, where the statement like
GRAPH rdfs: { ... }
did not yield anything.
By the way, when constructing a
ConjunctiveGraph
withparse()
calls which specify IRIs for the named graphs — all of this works perfectly.The text was updated successfully, but these errors were encountered: