Problem retriving data

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

Problem retriving data

Armando
Hi guys, I have been working with ontologies provided by oaei. Specifically, I'm working with the anatomy track, and I have been trying to access the synonyms of a class but with no success. Below I will leave an example of the structure of the ontology.

<owl:Class rdf:about="http://mouse.owl#MA_0000004">
    <rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string">trunk</rdfs:label>
    <rdfs:subClassOf rdf:resource="http://mouse.owl#MA_0002433"/>
    <oboInOwl:hasRelatedSynonym rdf:resource="http://mouse.owl#genid1217"/>
</owl:Class>

<rdf:Description rdf:about="http://mouse.owl#genid1217">
    <rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string">body</rdfs:label>
</rdf:Description>

 For example, I'm trying to retrieve all the synonyms related to the class MA_0000004 in the example above will be body.
Thanks  
Reply | Threaded
Open this post in threaded view
|

Re: Problem retriving data

Jiba
Administrator
Hello,

I've investigated your problem. It was caused by the fact that entity http://mouse.owl#genid1217 is never declared. It was thus replaced by None.

I've fixed that in the development version of Owlready: undeclared entities are now replaced by their IRI (I cannot create an individual for them because they have no associated ontology).

So you can now do:

>>> from owlready2 import *
>>> onto = get_ontology("file:///tmp/mouse.owl").load()
>>> onto.MA_0000004.hasRelatedSynonym
['http://test.org/test.owl#genid1217']


Best regards,
Jean-Baptiste Lamy
MCF HDR, Laboratoire LIMICS, Université Paris 13