Skip to content

Add a method to convert qname back to URI #1868

@dany-nonstop

Description

@dany-nonstop

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.

https://stackoverflow.com/questions/63088670/rdflib-python-how-to-get-a-uriref-from-a-string-such-as-nsxxx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions