How to get synonyms and other properties?

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

How to get synonyms and other properties?

S04dEGR4gE
I got the following error when I use get_properites(). What is the correct way to get the synonyms?

>>> from owlready2 import *
>>> onto = get_ontology('/tmp/EFO.owl')
>>> onto.load()
>>> onto.search_one(label='HEK-293 cell').get_properties()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: get_properties() missing 1 required positional argument: 'self'
Reply | Threaded
Open this post in threaded view
|

Re: How to get synonyms and other properties?

Jiba
Administrator
get_properties() is for individuals. To get the value of a property or an annotations, just use onto.search_one(label='HEK-293 cell').<your_property_name>, for example onto.search_one(label='HEK-293 cell').synonym

Best regards,
Jiba