geneontology / go-ontology

Source ontology files for the Gene Ontology
http://geneontology.org/page/download-ontology
Creative Commons Attribution 4.0 International
219 stars 40 forks source link

Create a script to test if an ontology class is used by another ontology, to be used prior to obsoleting #21723

Open cmungall opened 3 years ago

cmungall commented 3 years ago

Context: https://github.com/geneontology/go-ontology/issues/20764

@balhoff and I will provide a script that can be run (ideally this would be a Protege plugin).

There are various ways to do this

one it to run a SPARQL query against ontobee

SELECT ?s ?p ?g WHERE {
  GRAPH ?g {
  ?s ?p <http://purl.obolibrary.org/obo/GO_0098537>}}

this is not super-useful as it returns blank nodes, we would need to traverse up, but at least it shows where to start looking:

__bnode1,owl:someValuesFrom,obomerged:MP
__bnode2,owl:someValuesFrom,obomerged:CL
__bnode3,owl:someValuesFrom,obomerged:CL
__bnode4,owl:someValuesFrom,obomerged:CL
__bnode5,owl:someValuesFrom,obomerged:CL
__bnode6,owl:someValuesFrom,obomerged:CL
__bnode7,owl:someValuesFrom,obomerged:CL
__bnode8,owl:someValuesFrom,obomerged:KTAO
__bnode9,owl:someValuesFrom,obomerged:KTAO
__bnode10,owl:annotatedSource,obomerged:CL
__bnode11,owl:annotatedSource,obomerged:GO

it still has "false positives", e.g MP is in the list above, but this is because MP uses CL:

http://www.ontobee.org/ontology/MP?iri=http://purl.obolibrary.org/obo/GO_0098537

cmungall commented 3 years ago

this query works when the ontology has been put through robot relax and there is no nesting:

SELECT ?c ?g WHERE {
  GRAPH ?g {
  ?s ?p <http://purl.obolibrary.org/obo/GO_0098537>} .
  ?c <http://www.w3.org/2000/01/rdf-schema#subClassOf> ?s}
obo:CL_0000041,obomerged:CL
obo:CL_0000043,obomerged:CL
obo:CL_0000096,obomerged:CL
obo:CL_0000096,obomerged:KTAO

but it may be easier to use an API, e.g. bioportal or OLS

ValWood commented 2 years ago

Could you also include FYPO in this list?