Problem retriving data

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

Problem retriving data

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="">trunk</rdfs:label>
    <rdfs:subClassOf rdf:resource="http://mouse.owl#MA_0002433"/>
    <oboInOwl:hasRelatedSynonym rdf:resource="http://mouse.owl#genid1217"/>

<rdf:Description rdf:about="http://mouse.owl#genid1217">
    <rdfs:label rdf:datatype="">body</rdfs:label>

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

Re: Problem retriving data


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

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