Namespaces

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

Namespaces

evgenia
Hi,

I have recently started using the owlready2 library. Unfortunately I have problems defining a namespace for the ontology, it is local. How can I define a namespace in this case?

Best regards
Evgenia
Reply | Threaded
Open this post in threaded view
|

Re: Namespaces

Jiba
Administrator
Hi,

What do you mean by "problems defining a namespace for the ontology, it is local"?

The ontology IRI must be an URL, however, it does not have to be accessible via this URL, so it is ok to use a "fake" URL for that. Protégé automatically create such fake URL when creating a new ontology. So your are free to use any URL as the IRI of your ontology.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Namespaces

evgenia
Thank you! I meant whether I can use some fake URL for namespaces of an ontology that wasn't published.

Now I struggle with a new issue: the search method doesn't function properly, only search of IRI works, as for others (type, subclass_of, is_a, subproperty_of) give the following error as output:
AttributeError: 'str' object has no attribute 'storid'

Any ideas how I can handle it?


Reply | Threaded
Open this post in threaded view
|

Re: Namespaces

Jiba
Administrator
Hi,

You need to pass to search the class object, not the class name, e.g. :

default_world.search(subclass_of = onto.MyClass)

instead of:

default_world.search(subclass_of = "MyClass")

Jiba