finding annotation associated with an equivalent class axiom

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

finding annotation associated with an equivalent class axiom

tyler
I have several equivalent class axioms, all of which are annotated with an annotation name of 'likelihood' and a range of 'xsd:float'

Example (how its displayed in protege):
classA EquivalentTo classB and ClassC (annotation of 'likelihood', value of 0.9)

Using owlready2, given classB and classC, I'm able to loop through the ontology to show classA is equivalent to the combination of classB and classC. However, I have not been able to pull out the annotation or value from that relationship.

Any ideas of how to do this? Let me know if more info is needed.

Also, is there a glossary of attributes and methods available? Thanks!

Tyler
Reply | Threaded
Open this post in threaded view
|

Re: finding annotation associated with an equivalent class axiom

Jiba
Administrator
Annotation on relations can be obtained using the "annotation[subject, relation, object]" syntax. The relation can either be a Property or one of the special values from the owlready2 module, corresponding to RDFS and OWL relations. Annotation on equivalent class axioms are considered as annotation on the relation "equivalentclass".

For example, if your ontology is named "onto", you obtain your annotations using:

from owlready2 import *
print( onto.likelihood[onto.classA, owl_equivalentclass, onto.classA.equivalent_to[0]] )

where onto.classA.equivalent_to[0] is the first "equivalent class" axiom on class A (you can loop on onto.classA.equivalent_to if there are several).

There is no glossary yet, but it would be a good idea! For attribute, it is more complex, because Properties are translated to new attributes, so it is not possible to list all of them.
Reply | Threaded
Open this post in threaded view
|

Re: finding annotation associated with an equivalent class axiom

tyler
Thanks for your help! Much appreciated!

Tyler