Login  Register

Associating a Python module to an OWL ontology

classic Classic list List threaded Threaded
3 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Associating a Python module to an OWL ontology

Lynsie
15 posts
Hello
I want to associate a python module to my ontology in PROTEGE 4 but I haven't understood how to do that.
Could you please tell me the steps to do it?
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Associating a Python module to an OWL ontology

Jiba
Administrator
1186 posts
Hi,

First, you need to import the owlready ontology in your ontology (it corresponds to the file named "owlready_ontology.owl" in Owlready2 sources).

Second, you need to add a "python_module" annotation on your ontology. The value of the annotation is the name of the Python module to import.

Third, you need to create that Python module and to make it available to Python in PYTHON_PATH or sys.path.

Details are here:
https://owlready2.readthedocs.io/en/latest/mixing_python_owl.html#associating-a-python-module-to-an-owl-ontology

Jiba
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Associating a Python module to an OWL ontology

Lynsie
15 posts
Hi,
It's very clear now, thank you so much.