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

Add a prefixes header #97

Open
Tracked by #101
cmungall opened this issue May 3, 2023 · 7 comments
Open
Tracked by #101

Add a prefixes header #97

cmungall opened this issue May 3, 2023 · 7 comments

Comments

@cmungall
Copy link
Member

cmungall commented May 3, 2023

Consistent with other RDF serializations we should add a prefixes header

  prefixes:
    slot_uri: sh:declare
    range: PrefixDeclaration
    multivalued: true
    inlined: true
    description: >-
      A collection of mappings between prefixes and namespaces, used to map CURIEs (e.g. GO:0008150) to
      IRIs (e.g. http://purl.obolibrary.org/obo/GO_0008150)

range:

  PrefixDeclaration:
    class_uri: sh:PrefixDeclaration
    description: >-
      A mapping between an individual prefix (e.g. GO) and a namespace (e.g. http://purl.obolibrary.org/obo/GO_)
    attributes:
      prefix:
        key: true
        slot_uri: sh:prefix
        description: The prefix of a prefix declaration.
        range: string
        comments:
          - It is strongly recommended that the prefix is a valid NCName
      namespace:
        slot_uri: sh:namespace
        description: The namespace associated with a prefix in a prefix declaration.
        range: uri
@matentzn
Copy link

This is another very important issue for now.

@matentzn matentzn mentioned this issue Oct 26, 2023
6 tasks
@julesjacobsen
Copy link
Collaborator

julesjacobsen commented Nov 7, 2023

So this in on the Graph object?

graphDocument:
  graphs:
    -  id: hp
       prefixes:
           - prefix: "HP"
             namespace: "http://purl.obolibrary.org/obo/HP_"

To answer my own question, yes. However, this is also found on the GraphDocument, so presumably that is a unique set of all PrefixDefinitions found in all Graph instances?

@julesjacobsen
Copy link
Collaborator

Also, where are these gleamed from? Post-OWL translation or from the OWL file?

@cmungall
Copy link
Member Author

cmungall commented Nov 7, 2023

@balhoff can we align with how we want to do for obo format. I am still keen to place explicitly in owl domain of discourse via shacl data model but if you think prefix declarations persist enough...

@balhoff
Copy link
Member

balhoff commented Nov 7, 2023

@cmungall @julesjacobsen you can retrieve the prefix declarations that were used in the ontology when it was parsed, if the format was a PrefixOWLOntologyFormat: https://github.com/owlcs/owlapi/pull/1102/files#diff-dc57a7f9dedea84b58b14d5ac747bfcbf65c94ee8264219cacf2a35c67f78193R55-R57

I think this is the way that prefix declarations generally move between parsing and serializing in the OWL API.

@balhoff
Copy link
Member

balhoff commented Nov 7, 2023

By the way, the OBO format code assumes the http://purl.obolibrary.org/obo/{IDSPACE} mechanism outside of the rest of the prefix mappings (OBO ontology prefixes are implicit). I don't know if you want to do that here or not.

@matentzn
Copy link

matentzn commented Nov 8, 2023

Moving @julesjacobsen comment back here.

@cmungall can you help with this?

I wonder about this. Given the following synonym type def.

{
              "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"
                  }
              ]
          }
  1. Under which exact circumstances should which exact value of a pred slot be serialised as a CURIE?
  2. Under which exact circumstances should which exact value of a val slot be serialised as a CURIE?

You can use the above examples from above:

  1. "xrefs": [ "OMIM:617182"],
  2. "pred": "oboInOwl:source",
  3. "val": "OMIM:617182"
  4. "pred": "http://www.w3.org/2000/01/rdf-schema#seeAlso",
  5. "val": "https://github.com/monarch-initiative/mondo/issues/1623"

How is this driven by the obographs schema?

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

4 participants