RDFLib/rdflib (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Inconsistent behavor of initN in update and query #579

@colinfang

Description

@colinfang

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