Associating a Python module to an OWL ontology

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

Associating a Python module to an OWL ontology

Lynsie
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
|

Re: Associating a Python module to an OWL ontology

Jiba
Administrator
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
|

Re: Associating a Python module to an OWL ontology

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