Open
Conversation
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>
```
f237190 to
8f71625
Compare
matentzn
approved these changes
Jun 11, 2025
Collaborator
matentzn
left a comment
There was a problem hiding this comment.
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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This generally changes the logic of creating the subset, replacing the
removeinvocation withfilter. The order goes like this:Add
UPHENO:0000003("phenotype is associated with entity") relations to all terms in ZP.Merge
tmp/definitions-matches.owl. The key part here is adding in the uPheno generated labels asrdfs:labelannotations. (At this point, there are two labels for every ZP term with a matching uPheno pattern).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).Remove the
rdfs:labelannotations from ZP terms that were derived from ZFIN, but preserve them asoboInOwl:exactSynonyms, with an axiom documenting their source (infores:zfin). (IAO:0000115definitions derived from ZFIN are simply dropped).This also adds
ZP:0000000as a root term to the subset ontology, as well as a couple other pieces of metadata.Example output for
ZP:0000043: