ontobio icon indicating copy to clipboard operation
ontobio copied to clipboard

OntologyFactory should handle propertyChainAxioms

Open dustine32 opened this issue 5 years ago • 2 comments

It would be nice if I could use propertyChainAxioms in certain ontologies (e.g. RO) to connect certain terms. Example use case is deriving "causally upstream of or within, positive effect" (RO:0004047) from "acts upstream of or within, positive effect" (RO:0004032). In the RO owl:

<owl:ObjectProperty rdf:about="http://purl.obolibrary.org/obo/RO_0004032">
        <rdfs:subPropertyOf rdf:resource="http://purl.obolibrary.org/obo/RO_0002264"/>
        <owl:propertyChainAxiom rdf:parseType="Collection">
            <rdf:Description rdf:about="http://purl.obolibrary.org/obo/RO_0002327"/>
            <rdf:Description rdf:about="http://purl.obolibrary.org/obo/RO_0004047"/>
        </owl:propertyChainAxiom>

This connection looks to be in the owl:propertyChainAxiom array but it's not coming through to the RO:0004032 node:

>>> onto.node("RO:0004032")
{  
   'id':'http://purl.obolibrary.org/obo/RO_0004032',
   'meta':{  
      'basicPropertyValues':[  
         {  
            'pred':'OIO:created_by',
            'val':'cjm'
         },
         {  
            'pred':'rdfs:seeAlso',
            'val':'http://wiki.geneontology.org/index.php/Acts_upstream_of_or_within,_positive_effect'
         },
         {  
            'pred':'RO:0004049',
            'val':'RO:0002264'
         },
         {  
            'pred':'OIO:creation_date',
            'val':'2018-01-26T23:49:30Z'
         }
      ]
   },
   'type':'PROPERTY',
   'lbl':'acts upstream of or within, positive effect',
   'label':'acts upstream of or within, positive effect'
}

Currently not sure how this should be stored in the node data structure but I'll try seeing what works for me.

From @cmungall on gitter:

note in the json the chain is not in the node but in a separate section under”graphs”, "propertyChainAxioms" : [ {...

dustine32 avatar Apr 03 '19 17:04 dustine32

plan:

new class PropertyChainAxiom, list of these would be linked from the ontology object, structurally the same as the json

so we would do:

pcas = ont.get_property_chain_axioms(relation=rnode.id)

cmungall avatar Apr 03 '19 17:04 cmungall

Thanks @cmungall ! I pretty much followed the example of LogicalDefinition in ontol.py and this seems to work for my RO needs.

Let me know if anything's gunked up in the PR.

dustine32 avatar Apr 03 '19 23:04 dustine32