Add a method to convert qname back to URI · Issue #1868 · RDFLib/rdflib (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Description
rdflib.Graph
already has a very helpful method qname()
which basically converts http://example.com/ns#object
to ns:obj
if the namespace prefix ns
has already been bound by bind('ns', Namespace('http://example.com/ns'))
.
I sometimes need use the reverse of qname()
to make the URI input more human-friendly. It would be great if we have something like resolve_qname()
which would translate a qname ns:obj
back to http://example.com/ns#object
. A neat solution is already provided here by somebody on stackoverflow.