Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What to do with multiple labels / definitions etc? #107

Open
matentzn opened this issue Apr 24, 2024 · 1 comment
Open

What to do with multiple labels / definitions etc? #107

matentzn opened this issue Apr 24, 2024 · 1 comment

Comments

@matentzn
Copy link

I know this case is clearly not a use case for obographs-json, but the behaviour is super chaotic:

Example of an HPO class in the international edition
<!-- http://purl.obolibrary.org/obo/HP_0031973 -->

    <owl:Class rdf:about="http://purl.obolibrary.org/obo/HP_0031973">
        <rdfs:subClassOf rdf:resource="http://purl.obolibrary.org/obo/HP_0012796"/>
        <obo:IAO_0000115 xml:lang="cs">Abnormální zvýšení poměru výšky pohárku hlavy zrakového nervu k výšce disku.</obo:IAO_0000115>
        <obo:IAO_0000115>An abnormal increase in the ratio of the height of the cup of the optic nerve head to the height of the disk.</obo:IAO_0000115>
        <obo:IAO_0000115 xml:lang="tr">Optik sinir baş çukurunun yüksekliğinin disk yüksekliğine oranında anormal bir artış</obo:IAO_0000115>
        <dc:date rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2018-07-08T00:08:21Z</dc:date>
        <dcterms:creator rdf:resource="https://orcid.org/0000-0002-0736-9199"/>
        <rdfs:comment>Primary open angle glaucoma is causing a progressive optic neuropathy and its development is associated with loss of tissue in the neuroretinal rim of the optic disc and that will lead to increase in the size of the optic cup. Clinical estimation of the size of the cup using either the slit lamb or a simple imaging modalities such as fundus images is a significant clinical parameter and remains the simplest and most frequently performed assessment of the optic disc in the diagnosis and follows up the progression of the glaucoma suspect. The estimation of the size of the cup is usually made by comparison with the size of the disk and given as the ratio of the vertical and horizontal diameter of the cup to the vertical and horizontal diameter.</rdfs:comment>
        <rdfs:label xml:lang="tr">Artmış dikey çukurluk disk oranı</rdfs:label>
        <rdfs:label xml:lang="fr">Augmentation du rapport vertical cupule/disque</rdfs:label>
        <rdfs:label xml:lang="es">Aumento de la relación copa-disco vertical (CDR) del nervio óptico</rdfs:label>
        <rdfs:label>Increased vertical cup-to-disc ratio</rdfs:label>
        <rdfs:label xml:lang="cs">Zvýšený vertikální poměr pohárku k disku</rdfs:label>
        <rdfs:label xml:lang="ja">垂直カップ・ディスク比の増加</rdfs:label>
        <rdfs:label xml:lang="zh">垂直杯盘比增加</rdfs:label>
    </owl:Class>
    <owl:Axiom>
        <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/HP_0031973"/>
        <owl:annotatedProperty rdf:resource="http://purl.obolibrary.org/obo/IAO_0000115"/>
        <owl:annotatedTarget xml:lang="cs">Abnormální zvýšení poměru výšky pohárku hlavy zrakového nervu k výšce disku.</owl:annotatedTarget>
        <babelon:source_language>en</babelon:source_language>
        <babelon:source_value>An abnormal increase in the ratio of the height of the cup of the optic nerve head to the height of the disk.</babelon:source_value>
        <babelon:translation_language>cs</babelon:translation_language>
        <babelon:translation_status>CANDIDATE</babelon:translation_status>
    </owl:Axiom>
    <owl:Axiom>
        <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/HP_0031973"/>
        <owl:annotatedProperty rdf:resource="http://purl.obolibrary.org/obo/IAO_0000115"/>
        <owl:annotatedTarget>An abnormal increase in the ratio of the height of the cup of the optic nerve head to the height of the disk.</owl:annotatedTarget>
        <oboInOwl:hasDbXref rdf:resource="https://orcid.org/0000-0003-0986-4123"/>
    </owl:Axiom>
    <owl:Axiom>
        <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/HP_0031973"/>
        <owl:annotatedProperty rdf:resource="http://purl.obolibrary.org/obo/IAO_0000115"/>
        <owl:annotatedTarget xml:lang="tr">Optik sinir baş çukurunun yüksekliğinin disk yüksekliğine oranında anormal bir artış</owl:annotatedTarget>
        <babelon:source_language>en</babelon:source_language>
        <babelon:source_value>An abnormal increase in the ratio of the height of the cup of the optic nerve head to the height of the disk.</babelon:source_value>
        <babelon:translation_language>tr</babelon:translation_language>
        <babelon:translation_status>CANDIDATE</babelon:translation_status>
    </owl:Axiom>
    <owl:Axiom>
        <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/HP_0031973"/>
        <owl:annotatedProperty rdf:resource="http://www.w3.org/2000/01/rdf-schema#label"/>
        <owl:annotatedTarget xml:lang="tr">Artmış dikey çukurluk disk oranı</owl:annotatedTarget>
        <babelon:source_language>en</babelon:source_language>
        <babelon:source_value>Increased vertical cup-to-disc ratio</babelon:source_value>
        <babelon:translation_language>tr</babelon:translation_language>
        <babelon:translation_status>OFFICIAL</babelon:translation_status>
    </owl:Axiom>
    <owl:Axiom>
        <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/HP_0031973"/>
        <owl:annotatedProperty rdf:resource="http://www.w3.org/2000/01/rdf-schema#label"/>
        <owl:annotatedTarget xml:lang="fr">Augmentation du rapport vertical cupule/disque</owl:annotatedTarget>
        <babelon:comment>label of HP:0031973 (Increased vertical cup-to-disc ratio)  ; abnormality of the eye</babelon:comment>
        <babelon:source_language>en</babelon:source_language>
        <babelon:source_value>Increased vertical cup-to-disc ratio</babelon:source_value>
        <babelon:translation_language>fr</babelon:translation_language>
        <babelon:translation_status>OFFICIAL</babelon:translation_status>
    </owl:Axiom>
    <owl:Axiom>
        <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/HP_0031973"/>
        <owl:annotatedProperty rdf:resource="http://www.w3.org/2000/01/rdf-schema#label"/>
        <owl:annotatedTarget xml:lang="es">Aumento de la relación copa-disco vertical (CDR) del nervio óptico</owl:annotatedTarget>
        <babelon:source_language>en</babelon:source_language>
        <babelon:source_value>Increased vertical cup-to-disc ratio</babelon:source_value>
        <babelon:translation_language>es</babelon:translation_language>
        <babelon:translation_status>OFFICIAL</babelon:translation_status>
    </owl:Axiom>
    <owl:Axiom>
        <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/HP_0031973"/>
        <owl:annotatedProperty rdf:resource="http://www.w3.org/2000/01/rdf-schema#label"/>
        <owl:annotatedTarget xml:lang="cs">Zvýšený vertikální poměr pohárku k disku</owl:annotatedTarget>
        <babelon:source_language>en</babelon:source_language>
        <babelon:source_value>Increased vertical cup-to-disc ratio</babelon:source_value>
        <babelon:translation_language>cs</babelon:translation_language>
        <babelon:translation_status>OFFICIAL</babelon:translation_status>
    </owl:Axiom>
    <owl:Axiom>
        <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/HP_0031973"/>
        <owl:annotatedProperty rdf:resource="http://www.w3.org/2000/01/rdf-schema#label"/>
        <owl:annotatedTarget xml:lang="ja">垂直カップ・ディスク比の増加</owl:annotatedTarget>
        <babelon:source>http://purl.obolibrary.org/obo/hp.owl</babelon:source>
        <babelon:source_language>en</babelon:source_language>
        <babelon:source_value>Increased vertical cup-to-disc ratio</babelon:source_value>
        <babelon:source_version>http://purl.obolibrary.org/obo/hp/releases/2023-07-21/hp.owl</babelon:source_version>
        <babelon:translation_date>2023-07-31</babelon:translation_date>
        <babelon:translation_language>ja</babelon:translation_language>
        <babelon:translation_precision>EXACT</babelon:translation_precision>
        <babelon:translation_status>OFFICIAL</babelon:translation_status>
    </owl:Axiom>
    <owl:Axiom>
        <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/HP_0031973"/>
        <owl:annotatedProperty rdf:resource="http://www.w3.org/2000/01/rdf-schema#label"/>
        <owl:annotatedTarget xml:lang="zh">垂直杯盘比增加</owl:annotatedTarget>
        <babelon:source_language>en</babelon:source_language>
        <babelon:source_value>Increased vertical cup-to-disc ratio</babelon:source_value>
        <babelon:translation_language>zh</babelon:translation_language>
        <babelon:translation_status>OFFICIAL</babelon:translation_status>
    </owl:Axiom>
    


    <!-- http://purl.obolibrary.org/obo/HP_0031974 -->

    <owl:Class rdf:about="http://purl.obolibrary.org/obo/HP_0031974">
        <rdfs:subClassOf rdf:resource="http://purl.obolibrary.org/obo/HP_0031973"/>
        <obo:IAO_0000115 xml:lang="tr">Optik sinir baş çukur yüksekliğinin disk yüksekliğine oranı 0.6&apos;dır (normal çukur disk oranı 0.3&apos;tür)</obo:IAO_0000115>
        <obo:IAO_0000115 xml:lang="cs">Poměr výšky pohárku hlavičky zrakového nervu k výšce disku je 0,6 (normální poměr pohárku a disku je 0,3).</obo:IAO_0000115>
        <obo:IAO_0000115>Ratio of the height of the cup of the optic nerve head to the height of the disk is 0.6 (The normal cup-to-disc ratio is 0.3).</obo:IAO_0000115>
        <dc:date rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2018-07-08T00:13:08Z</dc:date>
        <dcterms:creator rdf:resource="https://orcid.org/0000-0002-0736-9199"/>
        <rdfs:label xml:lang="tr">Artmış dikey çukurluk disk oranı - 0.6</rdfs:label>
        <rdfs:label xml:lang="fr">Augmentation du rapport vertical coupe-disque - 0.6</rdfs:label>
        <rdfs:label xml:lang="es">Aumento de la relación copa-disco vertical (CDR) - 0.6 del nervio óptico</rdfs:label>
        <rdfs:label>Increased vertical cup-to-disc ratio - 0.6</rdfs:label>
        <rdfs:label xml:lang="cs">Zvýšený vertikální poměr pohárku k disku - 0,6</rdfs:label>
        <rdfs:label xml:lang="ja">垂直カップ・ディスク比の増加-0.6</rdfs:label>
        <rdfs:label xml:lang="zh">垂直杯盘比增加-0.6</rdfs:label>
    </owl:Class>
    <owl:Axiom>
        <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/HP_0031974"/>
        <owl:annotatedProperty rdf:resource="http://purl.obolibrary.org/obo/IAO_0000115"/>
        <owl:annotatedTarget xml:lang="tr">Optik sinir baş çukur yüksekliğinin disk yüksekliğine oranı 0.6&apos;dır (normal çukur disk oranı 0.3&apos;tür)</owl:annotatedTarget>
        <babelon:source_language>en</babelon:source_language>
        <babelon:source_value>Ratio of the height of the cup of the optic nerve head to the height of the disk is 0.6 (The normal cup-to-disc ratio is 0.3).</babelon:source_value>
        <babelon:translation_language>tr</babelon:translation_language>
        <babelon:translation_status>CANDIDATE</babelon:translation_status>
    </owl:Axiom>
    <owl:Axiom>
        <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/HP_0031974"/>
        <owl:annotatedProperty rdf:resource="http://purl.obolibrary.org/obo/IAO_0000115"/>
        <owl:annotatedTarget xml:lang="cs">Poměr výšky pohárku hlavičky zrakového nervu k výšce disku je 0,6 (normální poměr pohárku a disku je 0,3).</owl:annotatedTarget>
        <babelon:source_language>en</babelon:source_language>
        <babelon:source_value>Ratio of the height of the cup of the optic nerve head to the height of the disk is 0.6 (The normal cup-to-disc ratio is 0.3).</babelon:source_value>
        <babelon:translation_language>cs</babelon:translation_language>
        <babelon:translation_status>CANDIDATE</babelon:translation_status>
    </owl:Axiom>
    <owl:Axiom>
        <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/HP_0031974"/>
        <owl:annotatedProperty rdf:resource="http://purl.obolibrary.org/obo/IAO_0000115"/>
        <owl:annotatedTarget>Ratio of the height of the cup of the optic nerve head to the height of the disk is 0.6 (The normal cup-to-disc ratio is 0.3).</owl:annotatedTarget>
        <oboInOwl:hasDbXref rdf:resource="https://orcid.org/0000-0003-0986-4123"/>
    </owl:Axiom>
    <owl:Axiom>
        <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/HP_0031974"/>
        <owl:annotatedProperty rdf:resource="http://www.w3.org/2000/01/rdf-schema#label"/>
        <owl:annotatedTarget xml:lang="tr">Artmış dikey çukurluk disk oranı - 0.6</owl:annotatedTarget>
        <babelon:source_language>en</babelon:source_language>
        <babelon:source_value>Increased vertical cup-to-disc ratio - 0.6</babelon:source_value>
        <babelon:translation_language>tr</babelon:translation_language>
        <babelon:translation_status>OFFICIAL</babelon:translation_status>
    </owl:Axiom>
    <owl:Axiom>
        <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/HP_0031974"/>
        <owl:annotatedProperty rdf:resource="http://www.w3.org/2000/01/rdf-schema#label"/>
        <owl:annotatedTarget xml:lang="fr">Augmentation du rapport vertical coupe-disque - 0.6</owl:annotatedTarget>
        <babelon:comment>label of HP:0031974 (Increased vertical cup-to-disc ratio - 0.6)  ; abnormality of the eye</babelon:comment>
        <babelon:source_language>en</babelon:source_language>
        <babelon:source_value>Increased vertical cup-to-disc ratio - 0.6</babelon:source_value>
        <babelon:translation_language>fr</babelon:translation_language>
        <babelon:translation_status>OFFICIAL</babelon:translation_status>
    </owl:Axiom>
    <owl:Axiom>
        <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/HP_0031974"/>
        <owl:annotatedProperty rdf:resource="http://www.w3.org/2000/01/rdf-schema#label"/>
        <owl:annotatedTarget xml:lang="es">Aumento de la relación copa-disco vertical (CDR) - 0.6 del nervio óptico</owl:annotatedTarget>
        <babelon:source_language>en</babelon:source_language>
        <babelon:source_value>Increased vertical cup-to-disc ratio - 0.6</babelon:source_value>
        <babelon:translation_language>es</babelon:translation_language>
        <babelon:translation_status>OFFICIAL</babelon:translation_status>
    </owl:Axiom>
    <owl:Axiom>
        <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/HP_0031974"/>
        <owl:annotatedProperty rdf:resource="http://www.w3.org/2000/01/rdf-schema#label"/>
        <owl:annotatedTarget xml:lang="cs">Zvýšený vertikální poměr pohárku k disku - 0,6</owl:annotatedTarget>
        <babelon:source_language>en</babelon:source_language>
        <babelon:source_value>Increased vertical cup-to-disc ratio - 0.6</babelon:source_value>
        <babelon:translation_language>cs</babelon:translation_language>
        <babelon:translation_status>OFFICIAL</babelon:translation_status>
    </owl:Axiom>
    <owl:Axiom>
        <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/HP_0031974"/>
        <owl:annotatedProperty rdf:resource="http://www.w3.org/2000/01/rdf-schema#label"/>
        <owl:annotatedTarget xml:lang="ja">垂直カップ・ディスク比の増加-0.6</owl:annotatedTarget>
        <babelon:source>http://purl.obolibrary.org/obo/hp.owl</babelon:source>
        <babelon:source_language>en</babelon:source_language>
        <babelon:source_value>Increased vertical cup-to-disc ratio - 0.6</babelon:source_value>
        <babelon:source_version>http://purl.obolibrary.org/obo/hp/releases/2023-07-21/hp.owl</babelon:source_version>
        <babelon:translation_date>2023-07-31</babelon:translation_date>
        <babelon:translation_language>ja</babelon:translation_language>
        <babelon:translation_precision>EXACT</babelon:translation_precision>
        <babelon:translation_status>OFFICIAL</babelon:translation_status>
    </owl:Axiom>
    <owl:Axiom>
        <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/HP_0031974"/>
        <owl:annotatedProperty rdf:resource="http://www.w3.org/2000/01/rdf-schema#label"/>
        <owl:annotatedTarget xml:lang="zh">垂直杯盘比增加-0.6</owl:annotatedTarget>
        <babelon:source_language>en</babelon:source_language>
        <babelon:source_value>Increased vertical cup-to-disc ratio - 0.6</babelon:source_value>
        <babelon:translation_language>zh</babelon:translation_language>
        <babelon:translation_status>OFFICIAL</babelon:translation_status>
    </owl:Axiom>

This case may be anti-OBO from a philosophical standpoint, but its not really great that users of the obographs json file get a random mix of labels and definitions picked by the converter:

obographs version of the above
{
      "id" : "http://purl.obolibrary.org/obo/HP_0031973",
      "lbl" : "垂直杯盘比增加",
      "type" : "CLASS",
      "meta" : {
        "definition" : {
          "val" : "Optik sinir baş çukurunun yüksekliğinin disk yüksekliğine oranında anormal bir artış"
        },
        "comments" : [ "Primary open angle glaucoma is causing a progressive optic neuropathy and its development is associated with loss of tissue in the neuroretinal rim of the optic disc and that will lead to increase in the size of the optic cup. Clinical estimation of the size of the cup using either the slit lamb or a simple imaging modalities such as fundus images is a significant clinical parameter and remains the simplest and most frequently performed assessment of the optic disc in the diagnosis and follows up the progression of the glaucoma suspect. The estimation of the size of the cup is usually made by comparison with the size of the disk and given as the ratio of the vertical and horizontal diameter of the cup to the vertical and horizontal diameter." ],
        "basicPropertyValues" : [ {
          "pred" : "http://purl.org/dc/elements/1.1/date",
          "val" : "2018-07-08T00:08:21Z"
        }, {
          "pred" : "http://purl.org/dc/terms/creator",
          "val" : "https://orcid.org/0000-0002-0736-9199"
        } ]
      }
    }

As you can see, the converter randomly selected one of the 8 labels and combined it with one of the 3 definitions.

Here are some questions:

  1. In cases like this should we use meta instead of lbl and definition slots to reduce ambiguity?
  2. Fail hard during conversion?
  3. Rely on some notion of "default language"? (which we require to be asserted)
@cmungall
Copy link
Member

cmungall commented May 7, 2024

This has always been the case for obo format conversion, and we do (2), fail hard unless strict mode is relaxed.

However, I think for the multilingual use case we might want a more general multilingual solution

We have a test case here:

https://github.com/INCATools/ontology-access-kit/tree/main/tests/input/obo-compliance/invalid-name-duplicate

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

No branches or pull requests

2 participants