Support for urn:uuid:...

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Support for urn:uuid:...

QooTec

Environment

* Python 3.12
* owlready2 0.47

Context

I load an ontology.
Then I try to create an individual through:

onto.MyClass("urn:uuid:68801405-ea16-4775-8acf-6c6c563522b5")

Observed

An exception occurs since the code tries to split the name from the prefix, either splitting on / or #.

Expected

I would expect this kind of IRIs to be legal, since they are frequently used as a stable alternative to blank nodes.

Question

I guess this is unsupported in owlready2?
FYI: I found some similar posts, but as far as I see, they are different anyway.
Reply | Threaded
Open this post in threaded view
|

Re: Support for urn:uuid:...

Jiba
Administrator
Hello,

Owlready has some limited support for urn:uuid:... ; and these entities are treated as URI (not blank nodes).

To create a new individual with an urn:uuid:... IRI, you can use get_namespace() as follows:

with onto.get_namespace("urn:uuid:"):
  c = onto.C("68801405-ea16-4775-8acf-6c6c563522b6")

Jiba