geneontology / obographs

Basic and Advanced OBO Graphs: specification and reference implementation
64 stars 12 forks source link

Improve data model for cross-references #92

Closed cthoyt closed 1 year ago

cthoyt commented 1 year ago

Add slot for explicit predicate

Currently, the data model for xrefs just contains val. I would also like to include a pred in the xref data model to make it possible to say what kind of xref it is (more specific than the implied oboinowl:hasDbXref).

There is precedent for this as properties and synonyms also include pred already.

Add slot for provenance

It might be a bit meta, but like synonyms and definitions, it would be nice to have an xrefs slot where you can put provenance on how the xref was created (i.e., the ORCID CURIE of the annotator). I'm not actually a fan of calling this xrefs in the other places throughout the OBO flat file format and OBO Graphs, but renaming this and better defining it is a job for another day.

cmungall commented 1 year ago

You you specify what the OWL should look like here?

Here is an example of some OWL that uses a mix of both oio + string literals and other OMO sanctioned properties (skos, dcterms) for both entities and axioms:

Prefix(:=<http://purl.obolibrary.org/obo/TEMP#>)
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/TEMP>

Declaration(Class(<http://purl.obolibrary.org/obo/T_1>))
Declaration(AnnotationProperty(<http://purl.obolibrary.org/obo/IAO_0000115>))
Declaration(AnnotationProperty(<http://purl.obolibrary.org/obo/skos_exactMatch>))
Declaration(AnnotationProperty(<http://www.geneontology.org/formats/oboInOwl#editor>))
Declaration(AnnotationProperty(<http://www.geneontology.org/formats/oboInOwl#hasDbXref>))
Declaration(AnnotationProperty(<http://www.geneontology.org/formats/oboInOwl#id>))
Declaration(AnnotationProperty(rdfs:label))
############################
#   Annotation Properties
############################

# Annotation Property: <http://purl.obolibrary.org/obo/IAO_0000115> (definition)

AnnotationAssertion(rdfs:label <http://purl.obolibrary.org/obo/IAO_0000115> "definition"^^xsd:string)

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

AnnotationAssertion(rdfs:label <http://www.geneontology.org/formats/oboInOwl#hasDbXref> "database_cross_reference"^^xsd:string)

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

# Class: <http://purl.obolibrary.org/obo/T_1> (term1)

AnnotationAssertion(Annotation(<http://purl.org/dc/terms/dcterms> <https://orcid.org/1234>) Annotation(<http://www.geneontology.org/formats/oboInOwl#hasDbXref> "PMID:1"^^xsd:string) <http://purl.obolibrary.org/obo/IAO_0000115> <http://purl.obolibrary.org/obo/T_1> "term1 def"^^xsd:string)
AnnotationAssertion(<http://www.w3.org/2004/02/skos/core#exactMatch> <http://purl.obolibrary.org/obo/T_1> <http://purl.obolibrary.org/obo/Y_1>)
AnnotationAssertion(<http://www.geneontology.org/formats/oboInOwl#hasDbXref> <http://purl.obolibrary.org/obo/T_1> "X:1"^^xsd:string)
AnnotationAssertion(<http://www.geneontology.org/formats/oboInOwl#id> <http://purl.obolibrary.org/obo/T_1> "T:1"^^xsd:string)
AnnotationAssertion(rdfs:label <http://purl.obolibrary.org/obo/T_1> "term1"^^xsd:string)
)

In obo format this would look like:

id: T:1
name: term1
def: "term1 def" [PMID:1] {editor="orcid:1234"}
xref: X:1 ! plain xref
property_value: skos:exactMatch Y:1 ! example of arbitrary annotation, to an entity/URI, not a literal

(but note there are some issues with translating axiom annotations with the current owlapi code)

you can see this mixes the traditional hardwired oboInOwl axiom annotation properties (e.g oio:hasDbXref as a general seeAlso style annotation on the definition) with ways that mix other vocabularies.

this is how it should look in the json

"id" : "http://purl.obolibrary.org/obo/T_1",
"lbl" : "term1",
"type" : "CLASS",
"meta" : {
  "definition" : {
   "val" : "term1 def",
   "xrefs" : [ "PMID:1" ],
   "meta": {
     "basicPropertyValues" : [ {
       "pred" : "http://purl.org/dc/terms/dcterms",
       "val" : "https://orcid.org/1234"
     }]
    },
  },
  "xrefs" : [ {
    "val" : "X:1"
  } ],
  "basicPropertyValues" : [ {
     "pred" : "http://www.w3.org/2004/02/skos/core#exactMatch",
     "val" : "http://purl.obolibrary.org/obo/Y_1"
  }]
}

this is pretty ugly, but this works for basically any annotations on entities or axioms, or even Nth order axiom annotations

I think what you are suggesting is that we could introduce for convenience first class fields for certain privileged OMO properties, as we did for xref, def, synonym, etc? I'm sympathetic to this but it would be a lot of churn and we haven't even agreed on a core set of properties in OMO yet

cmungall commented 1 year ago

Folded into