diff --git a/src/ontology/Makefile b/src/ontology/Makefile index e3675599db..f84cdd48b7 100644 --- a/src/ontology/Makefile +++ b/src/ontology/Makefile @@ -643,7 +643,7 @@ imports/go-taxon-groupings.obo: imports/go-taxon-groupings.owl # these live in the ../sparql directory, and have suffix -violation.sparql # adding the name here will make the violation check live -VCHECKS = equivalent-classes trailing-whitespace owldef-self-reference synonym-label-match replacedby-obsolete replacedby-namespace duplicate-exact-synonym duplicate-synonym non-IRI-value non-anyURI-value obsolete-definition definition-constraints one-to-one-xrefs-by-subject one-to-one-xrefs-by-value xref-syntax +VCHECKS = equivalent-classes trailing-whitespace owldef-self-reference synonym-label-match replacedby-obsolete replacedby-namespace duplicate-exact-synonym duplicate-synonym non-IRI-value non-anyURI-value obsolete-definition definition-constraints one-to-one-xrefs-by-subject one-to-one-xrefs-by-value xref-syntax missing-defxref-as-xref # run all violation checks VARGS = $(foreach V,$(VCHECKS), $(SPARQLDIR)/$V-violation.sparql) diff --git a/src/sparql/missing-defxref-as-xref-violation.sparql b/src/sparql/missing-defxref-as-xref-violation.sparql new file mode 100644 index 0000000000..7635166784 --- /dev/null +++ b/src/sparql/missing-defxref-as-xref-violation.sparql @@ -0,0 +1,24 @@ +prefix oio: +prefix definition: +prefix owl: + +SELECT DISTINCT ?cls ?defxref +WHERE +{ + ?cls a owl:Class . + [ + a owl:Axiom ; + owl:annotatedSource ?cls ; + owl:annotatedProperty definition: ; + oio:hasDbXref ?defxref + ] + FILTER(STRSTARTS(?defxref, "RHEA") + || STRSTARTS(?defxref, "EC") + || STRSTARTS(?defxref, "MetaCyc") + || STRSTARTS(?defxref, "KEGG") + || STRSTARTS(?defxref, "UM-BBD") + || STRSTARTS(?defxref, "TC")) + FILTER NOT EXISTS { + ?cls oio:hasDbXref ?defxref . + } +}