Accessing class definitions

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

Accessing class definitions

Rajarshi Guha
Hi, I'm using Owlready2 to parse an OWL file and I'd like to extract the definition of classes. In particular, i'm working with the Bioassay Ontology (http://www.bioassayontology.org/) where a class is usually defined using the the following RDF snippet:

    <owl:Class rdf:about="http://www.bioassayontology.org/bao#BAO_0000074">
        <rdfs:subClassOf rdf:resource="http://www.bioassayontology.org/bao#BAO_0003115"/>
        <obo:IAO_0000115>This refers to the effect of the perturbagen on the target of an assay, whether it brings about inhibition, activation, cytotoxicity, etc. </obo:IAO_0000115>
        <obo:IAO_0000118>MOA</obo:IAO_0000118>
        <rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string">mode of action</rdfs:label>
    </owl:Class>

The definition is specified using obo:IAO_0000115 and when I view the OWL file in Protege, it is able to extract the text for this term and show it as the definition.

Can this be done using Owlready2?
Reply | Threaded
Open this post in threaded view
|

Re: Accessing class definitions

Jiba
Administrator
Hello,

Of course you can:

>>> from owlready2 import *

>>> onto = get_ontology("http://www.bioassayontology.org/bao/bao_complete.owl").load()

>>> IRIS["http://www.bioassayontology.org/bao#BAO_0000074"].label
['mode of action']

>>> IRIS["http://www.bioassayontology.org/bao#BAO_0000074"].IAO_0000115
['This refers to the effect of the perturbagen on the target of an assay, whether it brings about inhibition, activation, cytotoxicity, etc. ']


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