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

Annotations on xref annotation assertions are not serialized in json #44

Open
Tracked by #101
cmungall opened this issue Jun 28, 2019 · 5 comments
Open
Tracked by #101

Comments

@cmungall
Copy link
Member

Carried over from monarch-initiative/mondo#753

test case

[Term]
id: X:1
xref: X:2 {source="X:3"}

produces:

      "meta" : {
        "xrefs" : [ {
          "val" : "X:2"
        } ]
      },

loses source

@matentzn
Copy link

We need to start acting on this. What about:

{
  "id": "http://purl.obolibrary.org/obo/MONDO_0014957",
  "meta": {
      "xrefs": [
          {
              "val": "OMIM:617182",
              "annotations": [
                  {
                      "pred": "oboInOwl:source",
                      "val": "OMIM:617182"
                  },
                  {
                      "pred": "http://www.w3.org/2000/01/rdf-schema#seeAlso",
                      "val": "https://github.com/monarch-initiative/mondo/issues/1623"
                  }
              ]
          },
          {
              "val": "UMLS:C4310678"
          }
      ],
      "synonyms": [
          {
              "pred": "hasExactSynonym",
              "val": "language delay and attention Deficit-hyperactivity disorder/cognitive impairment with or without Cardiac arrhythmia",
              "xrefs": [
                  "OMIM:617182"
              ],
              "annotations": [
                  {
                      "pred": "oboInOwl:source",
                      "val": "OMIM:617182"
                  },
                  {
                      "pred": "http://www.w3.org/2000/01/rdf-schema#seeAlso",
                      "val": "https://github.com/monarch-initiative/mondo/issues/1623"
                  }
              ]
          },
          {
              "pred": "hasExactSynonym",
              "val": "LADCI",
              "xrefs": [
                  "MONDOLEX:0014957",
                  "OMIM:617182"
              ],
              "synonymType": "http://purl.obolibrary.org/obo/mondo#ABBREVIATION"
          }
      ],
      "basicPropertyValues": [
          {
              "pred": "http://www.w3.org/2004/02/skos/core#exactMatch",
              "val": "http://linkedlifedata.com/resource/umls/id/C4310678",
              "annotations": [
                  {
                      "pred": "oboInOwl:source",
                      "val": "OMIM:617182"
                  },
                  {
                      "pred": "http://www.w3.org/2000/01/rdf-schema#seeAlso",
                      "val": "https://github.com/monarch-initiative/mondo/issues/1623"
                  }
              ]
          },
          {
              "pred": "http://www.w3.org/2004/02/skos/core#exactMatch",
              "val": "https://omim.org/entry/617182"
          }
      ]
  },
  "type": "CLASS",
  "lbl": "language delay and attention deficit-hyperactivity disorder/cognitive impairment with or without cardiac arrhythmia"
}

@cmungall
Copy link
Member Author

I realize annotations is quite user-friendly to an OWL user, but the intended translation is

id: X:1
xref: X:2 {source="X:3"}

to

nodes:
  - id: X:1
     meta:
        xrefs:
           - val: X:2
              meta:
                 basicPropertyValues:
                   pred: oboInOwl:source
                   val: X:3

While I don't love the excessive nesting here, this is consistent with the composition-over-inheritance design of obographs dating back to <2015.

The basic principle is that (owl) annotations go on a meta object. This applies to entity axioms and to axiom annotations. Commonly used annotation predicates get their own priviliged key (xrefs, synonyms, def), others go in a generic basicPropertyValues object.

Note this design allows for arbitrary Nth order annotations. I think nesting any more than the above would be an anti-pattern. However, others in the OBO community have expressed a desire to do this, and OWL allows it, so the genericity buys us something here

@matentzn
Copy link

matentzn commented Oct 26, 2023

Can you carefully check that this is what you mean?

{
    "id": "http://purl.obolibrary.org/obo/MONDO_0014957",
    "meta": {
        "xrefs": [
            {
                "val": "OMIM:617182",
                "meta": {
                    "basicPropertyValues": [
                        {
                            "pred": "oboInOwl:source",
                            "val": "OMIM:617182"
                        },
                        {
                            "pred": "http://www.w3.org/2000/01/rdf-schema#seeAlso",
                            "val": "https://github.com/monarch-initiative/mondo/issues/1623"
                        }
                    ]
                }
            },
            {
                "val": "UMLS:C4310678"
            }
        ],
        "synonyms": [
            {
                "pred": "hasExactSynonym",
                "val": "language delay and attention Deficit-hyperactivity disorder/cognitive impairment with or without Cardiac arrhythmia",
                "xrefs": [
                    "OMIM:617182"
                ],
                "meta": {
                    "basicPropertyValues": [
                        {
                            "pred": "oboInOwl:source",
                            "val": "OMIM:617182"
                        },
                        {
                            "pred": "http://www.w3.org/2000/01/rdf-schema#seeAlso",
                            "val": "https://github.com/monarch-initiative/mondo/issues/1623"
                        }
                    ]
                }
            },
            {
                "pred": "hasExactSynonym",
                "val": "LADCI",
                "xrefs": [
                    "MONDOLEX:0014957",
                    "OMIM:617182"
                ],
                "synonymType": "http://purl.obolibrary.org/obo/mondo#ABBREVIATION"
            }
        ],
        "basicPropertyValues": [
            {
                "pred": "http://www.w3.org/2004/02/skos/core#exactMatch",
                "val": "http://linkedlifedata.com/resource/umls/id/C4310678",
                "meta": {
                    "basicPropertyValues": [
                        {
                            "pred": "oboInOwl:source",
                            "val": "OMIM:617182"
                        },
                        {
                            "pred": "http://www.w3.org/2000/01/rdf-schema#seeAlso",
                            "val": "https://github.com/monarch-initiative/mondo/issues/1623"
                        }
                    ]
                }
            },
            {
                "pred": "http://www.w3.org/2004/02/skos/core#exactMatch",
                "val": "https://omim.org/entry/617182"
            }
        ]
    },
    "type": "CLASS",
    "lbl": "language delay and attention deficit-hyperactivity disorder/cognitive impairment with or without cardiac arrhythmia"
}

@cmungall
Copy link
Member Author

yes!

@julesjacobsen
Copy link
Collaborator

Related to #97, what are the prefix definitions for oboInOwl:source or http://www.w3.org/2004/02/skos/core#exactMatch or http://www.w3.org/2000/01/rdf-schema#seeAlso.

Presumably the fully qualified URIs do not require a prefix definition as they are complete. But otherwise, is it possible that any field of a PropertyValue e.g. pred, val or xref can be a CURIE which requires a PrefixDefinition?

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

3 participants