-
Notifications
You must be signed in to change notification settings - Fork 576
Closed
Description
I have some questions about the new DefinedNamespace
:
- Can we restore a non-private API to get the URI of the namespace itself? Something like the
uri()
method on the now-deprecatedClosedNamespace
:
rdflib.OWL.uri() # "http://www.w3.org/2002/07/owl#"
- I couldn't find a documented way to get the complete set of URIs within a DefinedNamespace. It appears necessary to do something like this:
from rdflib import OWL, URIRef
owl_uris: Set[URIRef] = {OWL[str(x)] for x in OWL.__annotations__} # this can be generalized to a function
It would be nice to have the above functionality implemented as, say, a method (on DefinedNamespaceMeta
?). On ClosedNamespace
, it looks like it was possible to get this result via dir(OWL)
, since __dir__
was defined on that class.
Metadata
Metadata
Assignees
Labels
No labels