From 0d6e1f55b058b4967ffb5ec978f51f56c3e2581c Mon Sep 17 00:00:00 2001 From: Jim Balhoff Date: Tue, 5 Nov 2024 20:26:44 -0500 Subject: [PATCH] Add check for definition xrefs that are not also term xrefs. --- src/ontology/Makefile | 2 +- .../missing-defxref-as-xref-violation.sparql | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 src/sparql/missing-defxref-as-xref-violation.sparql 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 . + } +}