owlcollab / oboformat

Automatically exported from code.google.com/p/oboformat
5 stars 2 forks source link

Faulty interaction between IAO:0000231 and replaced_by #140

Open matentzn opened 1 year ago

matentzn commented 1 year ago

Minimal ontology:

format-version: 1.2
ontology: mondo

[Term]
id: MONDO:0000865
name: obsolete congenital fiber-type disproportion
property_value: IAO:0000231 IAO:0000227
is_obsolete: true
replaced_by: MONDO:0009711

[Term]
id: MONDO:0009711
name: congenital fiber-type disproportion myopathy

Save with OWLAPI 3.5.25:

format-version: 1.2
ontology: mondo
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://www.geneontology.org/formats/oboInOwl#id>))\n\n\nAnnotationAssertion(<http://www.geneontology.org/formats/oboInOwl#id> <http://purl.obolibrary.org/obo/MONDO_0000865> \"MONDO:0000865\")\nAnnotationAssertion(rdfs:label <http://purl.obolibrary.org/obo/MONDO_0000865> \"obsolete congenital fiber-type disproportion\")\n)

[Term]
id: MONDO:0009711
name: congenital fiber-type disproportion myopathy
alt_id: MONDO:0000865

Funnily this works:

format-version: 1.2
ontology: mondo

[Term]
id: MONDO:0000865
name: obsolete congenital fiber-type disproportion
property_value: IAO:0000231 somestring
is_obsolete: true
replaced_by: MONDO:0009711

[Term]
id: MONDO:0009711
name: congenital fiber-type disproportion myopathy

Note the property_value: IAO:0000231 somestring

This is a big problem for Mondo because I am trying to standardise all OBO ontologies to using obsolescence reasons correctly.

balhoff commented 1 year ago

@matentzn terms merged is baked into the OWL API OBO parser to model alt_ids (parsing an OBO file containing alt_ids converts the alt_ids to obsolete terms with a replaced_by value of the main term, as well as an obsoletion reason of terms merged). I think this value should just be avoided completely if using OBO 1.2/1.4. 🫤 Maybe we can exclude alt_id from OBO 1.6.

balhoff commented 1 year ago

Oh, and the reason I assume for the owl-axioms header is that the obsolete terms that become alt_ids don't have a frame of their own in OBO, so no place to put their annotations.

dosumis commented 1 year ago

@matentzn terms merged is baked into the OWL API OBO parser to model alt_ids (parsing an OBO file containing alt_ids converts the alt_ids to obsolete terms with a replaced_by value of the main term, as well as an obsoletion reason of terms merged). I think this value should just be avoided completely if using OBO 1.2/1.4. 🫤 Maybe we can exclude alt_id from OBO 1.6.

Really important to have a standard & well documented migration strategy for any existing alt_ids - given their long legacy. That was the point of the baked-in conversion.