information-artifact-ontology / ontology-metadata

OBO Metadata Ontology
Creative Commons Zero v1.0 Universal
19 stars 8 forks source link

All synonym types defined as `oboInOwl:SynonymType` but historically they're defined as `oboInOwl:SynonymTypeProperty` #157

Closed anitacaron closed 8 months ago

anitacaron commented 8 months ago

OBO format convert into OWL:

synonymtypedef: http://example.org/ABBREVIATION ""
<owl:AnnotationProperty rdf:about="http://example.org/ABBREVIATION">
        <rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string">full URI test</rdfs:label>
        <rdfs:subPropertyOf rdf:resource="http://www.geneontology.org/formats/oboInOwl#SynonymTypeProperty"/>
    </owl:AnnotationProperty>

One of the queries in ROBOT Report checks for "Missing Synonym Type Declaration" using the oboInOwl:SynonymTypeProperty

For example, the abbreviation annotation in OLS.

matentzn commented 8 months ago

Wow. Which of the two is the correct one, I.e generated by the oboparaer right now?

anitacaron commented 8 months ago

oboInOwl:SynonymTypeProperty

matentzn commented 8 months ago

So you think this would be correct? https://github.com/information-artifact-ontology/ontology-metadata/pull/158/files

anitacaron commented 8 months ago

It's not "me" thinking; it's just what historically it has been defined.

matentzn commented 8 months ago

@cthoyt commented in geneontology/go-ontology#158 that he did not like the change. @cthoyt the file you shared cannot be taken as the authoritative source. We have to take the OWL API as the authoritative source, as this is what everyone is using to create OBO files:

format-version: 1.2
data-version: hp/releases/2023-10-28
subsetdef: hposlim_core "Core clinical terminology"
subsetdef: secondary_consequence "Consequence of a disorder in another organ system."
synonymtypedef: abbreviation "abbreviation"
ontology: test_obo

[Term]
id: HP:0000010
name: Recurrent urinary tract infections
synonym: "Recurrent UTIs" EXACT abbreviation []

translates to:

Prefix(:=<http://purl.obolibrary.org/obo/test_obo.owl#>)
Prefix(owl:=<http://www.w3.org/2002/07/owl#>)
Prefix(rdf:=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>)
Prefix(xml:=<http://www.w3.org/XML/1998/namespace>)
Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)
Prefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>)

Ontology(<http://purl.obolibrary.org/obo/test_obo.owl>
<http://purl.obolibrary.org/obo/test_obo/hp/releases/2023-10-28/test_obo.owl>
Annotation(<http://www.geneontology.org/formats/oboInOwl#hasOBOFormatVersion> "1.2")

Declaration(Class(<http://purl.obolibrary.org/obo/HP_0000010>))
Declaration(AnnotationProperty(<http://purl.obolibrary.org/obo/test_obo#abbreviation>))
Declaration(AnnotationProperty(<http://purl.obolibrary.org/obo/test_obo#hposlim_core>))
Declaration(AnnotationProperty(<http://purl.obolibrary.org/obo/test_obo#secondary_consequence>))
Declaration(AnnotationProperty(<http://www.geneontology.org/formats/oboInOwl#SubsetProperty>))
Declaration(AnnotationProperty(<http://www.geneontology.org/formats/oboInOwl#SynonymTypeProperty>))
Declaration(AnnotationProperty(<http://www.geneontology.org/formats/oboInOwl#hasExactSynonym>))
Declaration(AnnotationProperty(<http://www.geneontology.org/formats/oboInOwl#hasOBOFormatVersion>))
Declaration(AnnotationProperty(<http://www.geneontology.org/formats/oboInOwl#hasSynonymType>))
Declaration(AnnotationProperty(<http://www.geneontology.org/formats/oboInOwl#id>))
Declaration(AnnotationProperty(rdfs:comment))
Declaration(AnnotationProperty(rdfs:label))
############################
#   Annotation Properties
############################

# Annotation Property: <http://purl.obolibrary.org/obo/test_obo#abbreviation> (abbreviation)

AnnotationAssertion(rdfs:label <http://purl.obolibrary.org/obo/test_obo#abbreviation> "abbreviation")
SubAnnotationPropertyOf(<http://purl.obolibrary.org/obo/test_obo#abbreviation> <http://www.geneontology.org/formats/oboInOwl#SynonymTypeProperty>)

# Annotation Property: <http://purl.obolibrary.org/obo/test_obo#hposlim_core> (<http://purl.obolibrary.org/obo/test_obo#hposlim_core>)

AnnotationAssertion(rdfs:comment <http://purl.obolibrary.org/obo/test_obo#hposlim_core> "Core clinical terminology")
SubAnnotationPropertyOf(<http://purl.obolibrary.org/obo/test_obo#hposlim_core> <http://www.geneontology.org/formats/oboInOwl#SubsetProperty>)

# Annotation Property: <http://purl.obolibrary.org/obo/test_obo#secondary_consequence> (<http://purl.obolibrary.org/obo/test_obo#secondary_consequence>)

AnnotationAssertion(rdfs:comment <http://purl.obolibrary.org/obo/test_obo#secondary_consequence> "Consequence of a disorder in another organ system.")
SubAnnotationPropertyOf(<http://purl.obolibrary.org/obo/test_obo#secondary_consequence> <http://www.geneontology.org/formats/oboInOwl#SubsetProperty>)

# Annotation Property: <http://www.geneontology.org/formats/oboInOwl#SubsetProperty> (subset_property)

AnnotationAssertion(rdfs:label <http://www.geneontology.org/formats/oboInOwl#SubsetProperty> "subset_property")

# Annotation Property: <http://www.geneontology.org/formats/oboInOwl#SynonymTypeProperty> (synonym_type_property)

AnnotationAssertion(rdfs:label <http://www.geneontology.org/formats/oboInOwl#SynonymTypeProperty> "synonym_type_property")

# Annotation Property: <http://www.geneontology.org/formats/oboInOwl#hasExactSynonym> (has_exact_synonym)

AnnotationAssertion(rdfs:label <http://www.geneontology.org/formats/oboInOwl#hasExactSynonym> "has_exact_synonym")

# Annotation Property: <http://www.geneontology.org/formats/oboInOwl#hasOBOFormatVersion> (has_obo_format_version)

AnnotationAssertion(rdfs:label <http://www.geneontology.org/formats/oboInOwl#hasOBOFormatVersion> "has_obo_format_version")

# Annotation Property: <http://www.geneontology.org/formats/oboInOwl#hasSynonymType> (has_synonym_type)

AnnotationAssertion(rdfs:label <http://www.geneontology.org/formats/oboInOwl#hasSynonymType> "has_synonym_type")

# Annotation Property: <http://www.geneontology.org/formats/oboInOwl#id> (id)

AnnotationAssertion(rdfs:label <http://www.geneontology.org/formats/oboInOwl#id> "id")

############################
#   Classes
############################

# Class: <http://purl.obolibrary.org/obo/HP_0000010> (Recurrent urinary tract infections)

AnnotationAssertion(Annotation(<http://www.geneontology.org/formats/oboInOwl#hasSynonymType> <http://purl.obolibrary.org/obo/test_obo#abbreviation>) <http://www.geneontology.org/formats/oboInOwl#hasExactSynonym> <http://purl.obolibrary.org/obo/HP_0000010> "Recurrent UTIs")
AnnotationAssertion(<http://www.geneontology.org/formats/oboInOwl#id> <http://purl.obolibrary.org/obo/HP_0000010> "HP:0000010")
AnnotationAssertion(rdfs:label <http://purl.obolibrary.org/obo/HP_0000010> "Recurrent urinary tract infections")

)

It will cause an uproar if we change that to SynonymType - it will break basically every single pipeline relying on OBO Format conversion during QC (which are many).

cthoyt commented 8 months ago

@matentzn i don’t have an opinion either way, but I did not realize that the obo file is not authoritative. Since that’s the case, why not just update the obo file to be correct?

matentzn commented 8 months ago

I never considered this file to be authoritative tbh.. @kltm may know more of the history

cthoyt commented 8 months ago

I better understand what's going on here. To reduce future confusion, can we create an authoritative OBO in OWL file (obo flat file format, OWL format) that can be considered authoritative? We need something like this in order to ensure people who are working with tools other than the OWL API can use it

matentzn commented 8 months ago

What exactly should that file contain? Is it basically like OMO, only covering all aspects of the OBO spec?

cthoyt commented 8 months ago

I think I am having a big misunderstanding. There is a semantic space called oboInOwl that I thought was defined by an ontology. It has CURIEs like oboInOwl:hasDbXref.

How do I, as a human who doesn't want to read Java nor understand what the OWL API does under the hood, see what the list of all the local unique identifiers in this semantic space?

The way I was doing this before was by looking at https://github.com/geneontology/go-ontology/raw/master/contrib/oboInOwl.obo. From what I understand from this conversation, there are inconsistencies between this file and what other people consider to be the "real" version of this semantic space, so I need a better solution than looking at this file, and there should probably be some kind of communication added inside this file about what it is, why it was made, and why it shouldn't be widely used

Further, it appears there are some inconsistencies with https://raw.githubusercontent.com/geneontology/go-ontology/master/contrib/oboInOwl.owl and https://github.com/geneontology/go-ontology/raw/master/contrib/oboInOwl.obo.

matentzn commented 8 months ago

Not a big misunderstanding! Thats what I was asking.

The metadata schema of oboInOwl is defined (mostly) here: https://owlcollab.github.io/oboformat/doc/obo-syntax.html

Some stuff seems missing. Ideally there was something like what @cmungall created for obographs:

https://github.com/INCATools/ontology-access-kit/blob/main/src/oaklib/datamodels/obograph.owl.ttl

https://github.com/geneontology/go-ontology/raw/master/contrib/oboInOwl.obo is not all too bad, but I would recommend you raise this issue of a metadata schema in the obo-format channel. Maybe we can just update that one file.

matentzn commented 8 months ago

BTW: https://github.com/geneontology/go-ontology/blob/master/contrib/oboInOwl#L474

cthoyt commented 8 months ago

okay, I am convinced. Now I just have to wonder why the OBO file living in the same directory doesn't match this. I made an issue in https://github.com/geneontology/go-site/issues/2157 so we can discuss that elsewhere.

cthoyt commented 8 months ago

@matentzn I think we can close this

matentzn commented 8 months ago

Fixed by geneontology/go-ontology#158