Skip to content

Commit

Permalink
Add check for definition xrefs that are not also term xrefs.
Browse files Browse the repository at this point in the history
  • Loading branch information
balhoff committed Dec 9, 2024
1 parent a94637d commit 0d6e1f5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ontology/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
24 changes: 24 additions & 0 deletions src/sparql/missing-defxref-as-xref-violation.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
prefix oio: <http://www.geneontology.org/formats/oboInOwl#>
prefix definition: <http://purl.obolibrary.org/obo/IAO_0000115>
prefix owl: <http://www.w3.org/2002/07/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 .
}
}

0 comments on commit 0d6e1f5

Please sign in to comment.