Skip to content
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

Inconsistent behavor of initN in update and query #579

Closed
colinfang opened this issue Jan 21, 2016 · 0 comments
Closed

Inconsistent behavor of initN in update and query #579

colinfang opened this issue Jan 21, 2016 · 0 comments
Assignees
Labels
bug Something isn't working fix-in-progress SPARQL
Milestone

Comments

@colinfang
Copy link

The doc says

If you pass no initNs argument, the namespaces registered with the graphs namespace_manager are used

However, it doesn't seem true for update.

from rdflib import Graph, URIRef, Literal, Namespace
from rdflib.namespace import FOAF, RDF

g = Graph()
g.bind('foaf', FOAF)
n = Namespace("http://myname/")
g.add((n.bob, FOAF.name, Literal('bb')))
# query is successful.
g.query("select ?n where { ?n foaf:name 'bb' . }")
# update is not.
g.update("""
    delete { ?e ?p ?o }
    where {
        ?e foaf:name 'ss' .
    }""")
Exception: Unknown namespace prefix : foaf
@joernhees joernhees added bug Something isn't working SPARQL labels Jan 27, 2016
@joernhees joernhees added this to the rdflib 4.2.2 milestone Jan 27, 2016
joernhees added a commit to joernhees/rdflib that referenced this issue Feb 16, 2016
@joernhees joernhees self-assigned this Feb 16, 2016
colinfang pushed a commit to colinfang/rdflib that referenced this issue Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix-in-progress SPARQL
Projects
None yet
Development

No branches or pull requests

2 participants