managing the RDFLib NamespaceManager

Adam Funk a24061 at
Tue Mar 14 09:50:12 EDT 2017

I'm using RDFLib 4.2.2 (installed with pip3) in Python 3.5.2, and the
automatic behaviour of the NamespaceManager is giving me conniptions,
because the automatically generated namespaces go too far to the right
in the URIs and make the right-hand parts of the QNames meaningless.

For example, I have this code:

nsMgr     = NamespaceManager(rdflib.Graph())
nsMgr.bind('dbpedia', Namespace(''))
# plus some others

but in the serialized RDF I get these (and some other ns-numbered

@prefix dbpedia: <> .
@prefix ns3: <> .
@prefix ns5: <> .

and obviously the QName outputs are wrong.  Is there any way to make
an RDFLib NamespaceManager *not* generate any namespaces


More information about the Python-list mailing list