Skip to content

Zp zapp improvements#75

Open
ptgolden wants to merge 7 commits intomasterfrom
zp-zapp-improvements
Open

Zp zapp improvements#75
ptgolden wants to merge 7 commits intomasterfrom
zp-zapp-improvements

Conversation

@ptgolden
Copy link
Collaborator

This generally changes the logic of creating the subset, replacing the remove invocation with filter. The order goes like this:

  1. Add UPHENO:0000003 ("phenotype is associated with entity") relations to all terms in ZP.

  2. Merge tmp/definitions-matches.owl. The key part here is adding in the uPheno generated labels as rdfs:label annotations. (At this point, there are two labels for every ZP term with a matching uPheno pattern).

  3. Filter ZP to only include the following: the ZP root, UPHENO:0000003, all ZFA terms, all GO terms, and the ZP terms we have determined should be included in the ZAPP subset. (All annotations for these terms are included as well).

  4. Remove the rdfs:label annotations from ZP terms that were derived from ZFIN, but preserve them as oboInOwl:exactSynonyms, with an axiom documenting their source (infores:zfin). (IAO:0000115 definitions derived from ZFIN are simply dropped).

This also adds ZP:0000000 as a root term to the subset ontology, as well as a couple other pieces of metadata.

Example output for ZP:0000043:

<owl:Class rdf:about="http://purl.obolibrary.org/obo/ZP_0000043">
    <rdfs:subClassOf rdf:resource="http://purl.obolibrary.org/obo/ZP_0004005"/>
    <rdfs:subClassOf>
        <owl:Restriction>
            <owl:onProperty rdf:resource="http://purl.obolibrary.org/obo/UPHENO_0000003"/>
            <owl:someValuesFrom rdf:resource="http://purl.obolibrary.org/obo/ZFA_0000107"/>
        </owl:Restriction>
    </rdfs:subClassOf>
    <obo:IAO_0000115>An abnormal reduction in the size of the eye.</obo:IAO_0000115>
    <oboInOwl:hasExactSynonym>abnormally small eye</oboInOwl:hasExactSynonym>
    <oboInOwl:hasExactSynonym>eye decreased size, abnormal</oboInOwl:hasExactSynonym>
    <rdfs:label>decreased size of the eye</rdfs:label>
</owl:Class>
<owl:Axiom>
    <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/ZP_0000043"/>
    <owl:annotatedProperty rdf:resource="http://purl.obolibrary.org/obo/IAO_0000115"/>
    <owl:annotatedTarget>An abnormal reduction in the size of the eye.</owl:annotatedTarget>
    <oboInOwl:source rdf:resource="http://purl.obolibrary.org/obo/upheno/patterns-dev/abnormallyDecreasedSizeOfAnatomicalEntity.yaml"/>
</owl:Axiom>
<owl:Axiom>
    <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/ZP_0000043"/>
    <owl:annotatedProperty rdf:resource="http://www.geneontology.org/formats/oboInOwl#hasExactSynonym"/>
    <owl:annotatedTarget>abnormally small eye</owl:annotatedTarget>
    <oboInOwl:source rdf:resource="http://purl.obolibrary.org/obo/upheno/patterns-dev/abnormallyDecreasedSizeOfAnatomicalEntity.yaml"/>
</owl:Axiom>
<owl:Axiom>
    <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/ZP_0000043"/>
    <owl:annotatedProperty rdf:resource="http://www.geneontology.org/formats/oboInOwl#hasExactSynonym"/>
    <owl:annotatedTarget>eye decreased size, abnormal</owl:annotatedTarget>
    <oboInOwl:source rdf:resource="https://w3id.org/biolink/infores/zfin"/>
</owl:Axiom>
<owl:Axiom>
    <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/ZP_0000043"/>
    <owl:annotatedProperty rdf:resource="http://www.w3.org/2000/01/rdf-schema#label"/>
    <owl:annotatedTarget>decreased size of the eye</owl:annotatedTarget>
    <oboInOwl:source rdf:resource="http://purl.obolibrary.org/obo/upheno/patterns-dev/abnormallyDecreasedSizeOfAnatomicalEntity.yaml"/>
</owl:Axiom>

ptgolden added 3 commits June 10, 2025 13:57
This generally changes the order of creating the subset, replacing the
`remove` invocation with `filter`. The order goes like this:

1. Add UPHENO:0000003 ("phenotype is associated with entity") relations
   to all terms in ZP.

2. Merge `tmp/definitions-matches.owl`. The key part here is adding in
   the uPheno generated labels as `rdfs:label`s. (At this point, there
   are two labels for every ZP term with a matching uPheno pattern).

3. Filter ZP to only include the following: the ZP root, UPHENO:0000003,
   all ZFA terms, all GO terms, and the ZP terms we have determined
   should be included in the ZAPP subset. (All annotations for those
   terms are included as well).

4. Remove the `rdfs:label` annotations from ZP terms that were derived
   from ZFIN, but preserve them as oboInOwl:exactSynonyms, with an axiom
   documenting their source (`infores:zfin`). (IAO:0000115 definitions
   derived from ZFIN are just dropped).

This also adds ZP:0000000 as a root term to the subset ontology, as well
as a couple other pieces of metadata.

Example output for ZP:0000043:

```
    <owl:Class rdf:about="http://purl.obolibrary.org/obo/ZP_0000043">
        <rdfs:subClassOf rdf:resource="http://purl.obolibrary.org/obo/ZP_0004005"/>
        <rdfs:subClassOf>
            <owl:Restriction>
                <owl:onProperty rdf:resource="http://purl.obolibrary.org/obo/UPHENO_0000003"/>
                <owl:someValuesFrom rdf:resource="http://purl.obolibrary.org/obo/ZFA_0000107"/>
            </owl:Restriction>
        </rdfs:subClassOf>
        <obo:IAO_0000115>An abnormal reduction in the size of the eye.</obo:IAO_0000115>
        <oboInOwl:hasExactSynonym>abnormally small eye</oboInOwl:hasExactSynonym>
        <oboInOwl:hasExactSynonym>eye decreased size, abnormal</oboInOwl:hasExactSynonym>
        <rdfs:label>decreased size of the eye</rdfs:label>
    </owl:Class>
    <owl:Axiom>
        <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/ZP_0000043"/>
        <owl:annotatedProperty rdf:resource="http://purl.obolibrary.org/obo/IAO_0000115"/>
        <owl:annotatedTarget>An abnormal reduction in the size of the eye.</owl:annotatedTarget>
        <oboInOwl:source rdf:resource="http://purl.obolibrary.org/obo/upheno/patterns-dev/abnormallyDecreasedSizeOfAnatomicalEntity.yaml"/>
    </owl:Axiom>
    <owl:Axiom>
        <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/ZP_0000043"/>
        <owl:annotatedProperty rdf:resource="http://www.geneontology.org/formats/oboInOwl#hasExactSynonym"/>
        <owl:annotatedTarget>abnormally small eye</owl:annotatedTarget>
        <oboInOwl:source rdf:resource="http://purl.obolibrary.org/obo/upheno/patterns-dev/abnormallyDecreasedSizeOfAnatomicalEntity.yaml"/>
    </owl:Axiom>
    <owl:Axiom>
        <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/ZP_0000043"/>
        <owl:annotatedProperty rdf:resource="http://www.geneontology.org/formats/oboInOwl#hasExactSynonym"/>
        <owl:annotatedTarget>eye decreased size, abnormal</owl:annotatedTarget>
        <oboInOwl:source rdf:resource="https://w3id.org/biolink/infores/zfin"/>
    </owl:Axiom>
    <owl:Axiom>
        <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/ZP_0000043"/>
        <owl:annotatedProperty rdf:resource="http://www.w3.org/2000/01/rdf-schema#label"/>
        <owl:annotatedTarget>decreased size of the eye</owl:annotatedTarget>
        <oboInOwl:source rdf:resource="http://purl.obolibrary.org/obo/upheno/patterns-dev/abnormallyDecreasedSizeOfAnatomicalEntity.yaml"/>
    </owl:Axiom>
```
@ptgolden ptgolden force-pushed the zp-zapp-improvements branch from f237190 to 8f71625 Compare June 10, 2025 21:06
Copy link
Collaborator

@matentzn matentzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

impressive - really.

these robot chains are a bit two complex to reason over - I am a bit surprised that --select annotations \ works for what we want, but I assume that that you have checked the output, right?

A sanity check could be to determine if zp-zapp.owl has the same number of ZP declarations as tmp/zp-zapp.csv

ptgolden added 4 commits June 11, 2025 10:43
1. Keep track of both preferred labels and synonyms in the ROBOT
   template. Note that this requires two different columns for
   submitter, since axiom annotations only apply to the column to the
   left.

2. Use `dcterms:creator` for the author of manual label/synonyms, rather
   than `prov:wasAttributedTo`.

3. Add a script to promote manual labels to `rdfs:label` and demote the
   previous `rdfs:label` to `oboInOwl:exactSynonym`. All relevant axioms
   are updated as well. `skos:preferredLabel` is used as a sentinel
   value in the template, but it is not used in the final ontology.
Instead, add it to the SPARQL query that generates the list of included
terms in the subset.
1. Sanity check that all desired terms are in the subset

2. SPARQL validation to make sure all entities have only one label
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

Successfully merging this pull request may close these issues.

2 participants