Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'remove' command behaves unexpectedly when IAO:0000115 annotations themselves have annotation properties #1161

Open
allysonlister opened this issue Nov 9, 2023 · 2 comments

Comments

@allysonlister
Copy link

(Apologies in advance if the title isn't quite right - please edit as required!)

As discussed on Slack here, I have experienced some odd behaviour when using robot remove in the following situation...

Goal: retain labels, isDefinedBy, and definitions from a subset of CHMO that I've previously created with extract.
Actual result: the command below works as expected ONLY when the IAO definitions DO NOT themselves have annotation properties on them. When the definitions themselves have annotation properties, the entire definition is removed.

Here is my command (feel free to just use the entire CHMO ontology here instead of my tmp file of course ;-) ):

java -jar ~/Programs/robot.jar remove --input chmo-import-tmp.owl --term rdfs:label --term IAO:0000115 --term rdfs:isDefinedBy --select complement --select annotation-properties --output chmo-import-tmp2.owl

Although some classes, such as BFO independent continuant are being correctly modified with the above command, the CHMO classes are NOT. Here is an example CHMO class before running the remove command:

<!-- http://purl.obolibrary.org/obo/CHMO_0000156 -->

    <owl:Class rdf:about="http://purl.obolibrary.org/obo/CHMO_0000156">
        <rdfs:subClassOf rdf:resource="http://purl.obolibrary.org/obo/CHMO_0000141"/>
        <obo:IAO_0000115>A method for determining structure by directing a beam of X-rays at the sample and detecting the positions and intensities of the diffracted X-rays as a pattern of spots on a photographic plate.</obo:IAO_0000115>
        <oboInOwl:hasExactSynonym>X-Ray crystallographic analysis</oboInOwl:hasExactSynonym>
        <oboInOwl:hasExactSynonym>X-ray analysis</oboInOwl:hasExactSynonym>
        <oboInOwl:hasExactSynonym>X-ray crystallography</oboInOwl:hasExactSynonym>
        <oboInOwl:hasExactSynonym>X-ray diffraction analysis</oboInOwl:hasExactSynonym>
        <oboInOwl:hasExactSynonym>X-ray diffractometry</oboInOwl:hasExactSynonym>
        <oboInOwl:hasExactSynonym>X-ray structure determination</oboInOwl:hasExactSynonym>
        <oboInOwl:hasExactSynonym>XRD</oboInOwl:hasExactSynonym>
        <oboInOwl:id>CHMO:0000156</oboInOwl:id>
        <rdfs:isDefinedBy rdf:resource="http://purl.obolibrary.org/obo/chmo.owl"/>
        <rdfs:label>X-ray diffraction</rdfs:label>
    </owl:Class>
    <owl:Axiom>
        <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/CHMO_0000156"/>
        <owl:annotatedProperty rdf:resource="http://purl.obolibrary.org/obo/IAO_0000115"/>
        <owl:annotatedTarget>A method for determining structure by directing a beam of X-rays at the sample and detecting the positions and intensities of the diffracted X-rays as a pattern of spots on a photographic plate.</owl:annotatedTarget>
        <oboInOwl:hasDbXref>FIX:0000007</oboInOwl:hasDbXref>
        <oboInOwl:hasDbXref>ISBN:90190280031-0</oboInOwl:hasDbXref>
    </owl:Axiom>

And here is the same CHMO class after running remove (label and isDefinedBy are kept, but definition has been "incorrectly" removed):

<!-- http://purl.obolibrary.org/obo/CHMO_0000156 -->

    <owl:Class rdf:about="http://purl.obolibrary.org/obo/CHMO_0000156">
        <rdfs:subClassOf rdf:resource="http://purl.obolibrary.org/obo/CHMO_0000141"/>
        <rdfs:isDefinedBy rdf:resource="http://purl.obolibrary.org/obo/chmo.owl"/>
        <rdfs:label>X-ray diffraction</rdfs:label>
    </owl:Class>

At Philip's suggestion, I then created a test version of CHMO that didn't have the annotations on IAO definition. When I run the remove command over that modified ontology, remove functions as expected:

<!-- http://purl.obolibrary.org/obo/CHMO_0000156 -->

    <owl:Class rdf:about="http://purl.obolibrary.org/obo/CHMO_0000156">
        <rdfs:subClassOf rdf:resource="http://purl.obolibrary.org/obo/CHMO_0000141"/>
        <obo:IAO_0000115>A method for determining structure by directing a beam of X-rays at the sample and detecting the positions and intensities of the diffracted X-rays as a pattern of spots on a photographic plate.</obo:IAO_0000115>
        <rdfs:isDefinedBy rdf:resource="http://purl.obolibrary.org/obo/chmo.owl"/>
        <rdfs:label>X-ray diffraction</rdfs:label>
    </owl:Class>

I would be agnostic about whether or not the associated properties are retained or removed. The important thing for me is that the definition is retained.

Thanks!

@jamesaoverton
Copy link
Member

I'm terrified of digging into the remove code. As a workaround, could you remove the annotations from the IAO annotation properties in a first step, then do this task as a second step?

@allysonlister
Copy link
Author

I understand, and I can do that - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants