Skip to content

Instantly share code, notes, and snippets.

@cthoyt
Last active September 30, 2025 15:38
Show Gist options
  • Save cthoyt/62f01be74efb3e25026d2bac10b49fe1 to your computer and use it in GitHub Desktop.
Save cthoyt/62f01be74efb3e25026d2bac10b49fe1 to your computer and use it in GitHub Desktop.
Hierarchical Synonym Type Demo

Hierarchical Synonym Type Demo

This demonstration goes along with information-artifact-ontology/ontology-metadata#194 to show what happens when ROBOT tries to convert an ontology that has hierarchical synonym type properties.

Unfortunately, it doesn't appear to write the child property in OBO. This is probably because the parser only looks for direct children of oboInOwl:SynonymTypeProperty

format-version: 1.2
synonymtypedef: OMO:0003000 "abbreviation"
idspace: oboInOwl http://www.geneontology.org/formats/oboInOwl#
ontology: http://www.semanticweb.org/cthoyt/ontologies/2025/8/untitled-ontology-153
owl-axioms: Prefix(owl:=<http://www.w3.org/2002/07/owl#>)\nPrefix(rdf:=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>)\nPrefix(xml:=<http://www.w3.org/XML/1998/namespace>)\nPrefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)\nPrefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>)\n\n\nOntology(\nDeclaration(AnnotationProperty(<http://purl.obolibrary.org/obo/OMO_0003000>))\nDeclaration(AnnotationProperty(<http://purl.obolibrary.org/obo/OMO_0003012>))\n############################\n# Annotation Properties\n############################\n\n# Annotation Property: <http://purl.obolibrary.org/obo/OMO_0003012> (<http://purl.obolibrary.org/obo/OMO_0003012>)\n\nSubAnnotationPropertyOf(<http://purl.obolibrary.org/obo/OMO_0003012> <http://purl.obolibrary.org/obo/OMO_0003000>)\n\n\n)
[Term]
id: http://purl.obolibrary.org/obo/IDPO_89a27cc2_0d50_4b43_8dcc_d9bbd29704eb
name: example class
synonym: "EC" EXACT OMO:0003012 []
<?xml version="1.0"?>
<rdf:RDF xmlns="http://www.semanticweb.org/cthoyt/ontologies/2025/8/untitled-ontology-153/"
xml:base="http://www.semanticweb.org/cthoyt/ontologies/2025/8/untitled-ontology-153/"
xmlns:obo="http://purl.obolibrary.org/obo/"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:oboInOwl="http://www.geneontology.org/formats/oboInOwl#">
<owl:Ontology rdf:about="http://www.semanticweb.org/cthoyt/ontologies/2025/8/untitled-ontology-153"/>
<owl:AnnotationProperty rdf:about="http://purl.obolibrary.org/obo/OMO_0003000">
<rdfs:label xml:lang="en">abbreviation</rdfs:label>
<rdfs:subPropertyOf rdf:resource="http://www.geneontology.org/formats/oboInOwl#SynonymTypeProperty"/>
</owl:AnnotationProperty>
<owl:AnnotationProperty rdf:about="http://purl.obolibrary.org/obo/OMO_0003012">
<rdfs:label xml:lang="en">acronym</rdfs:label>
<rdfs:subPropertyOf rdf:resource="http://purl.obolibrary.org/obo/OMO_0003000"/>
</owl:AnnotationProperty>
<owl:AnnotationProperty rdf:about="http://www.geneontology.org/formats/oboInOwl#SynonymTypeProperty"/>
<owl:AnnotationProperty rdf:about="http://www.geneontology.org/formats/oboInOwl#hasExactSynonym"/>
<owl:AnnotationProperty rdf:about="http://www.geneontology.org/formats/oboInOwl#hasSynonymType"/>
<owl:Class rdf:about="http://purl.obolibrary.org/obo/IDPO_89a27cc2_0d50_4b43_8dcc_d9bbd29704eb">
<oboInOwl:hasExactSynonym>EC</oboInOwl:hasExactSynonym>
<rdfs:label xml:lang="en">example class</rdfs:label>
</owl:Class>
<owl:Axiom>
<owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/IDPO_89a27cc2_0d50_4b43_8dcc_d9bbd29704eb"/>
<owl:annotatedProperty rdf:resource="http://www.geneontology.org/formats/oboInOwl#hasExactSynonym"/>
<owl:annotatedTarget>EC</owl:annotatedTarget>
<oboInOwl:hasSynonymType rdf:resource="http://purl.obolibrary.org/obo/OMO_0003012"/>
</owl:Axiom>
</rdf:RDF>
@matentzn
Copy link

This only works I guess because of the owl-axioms header which is killed by many OBO-fication processes.. So I think your demo proves we cannot do what you want at the moment..

You will have to file an issue here:

https://github.com/owlcollab/oboformat/issues?q=is%3Aissue%20state%3Aopen%20synonym%20type

And keep fingers crossed. Sorry!

@cthoyt
Copy link
Author

cthoyt commented Sep 30, 2025

for now ;)

we'll get there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment