Skip to content

Commit

Permalink
Add INFO-level report test identifying URLs as xrefs
Browse files Browse the repository at this point in the history
Primarily to identify where a definition source URL was
accidentally added as an annotation on the class instead of an
annotation on the definition.
  • Loading branch information
allenbaron committed Oct 17, 2023
1 parent 5e4c98c commit c2a0b33
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/sparql/report/report_profile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ WARN file:./src/sparql/report/mixup_xref_synonym.rq
WARN missing_definition
INFO file:./src/sparql/report/invalid_class_id.rq
INFO file:./src/sparql/report/missing_definition_xref.rq
INFO file:./src/sparql/report/xref_is_url.rq
INFO lowercase_definition
INFO missing_superclass
17 changes: 17 additions & 0 deletions src/sparql/report/xref_is_url.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# identifies definition xrefs (URLs) annotated on the class instead of
# directly annotated on the definition

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>

SELECT DISTINCT ?entity ?property ?value
WHERE {
VALUES ?property { oboInOwl:hasDbXref }
?entity a owl:Class ;
?property ?value .

FILTER(REGEX(?value, "https?:"))
FILTER NOT EXISTS { ?entity owl:deprecated "true"^^xsd:boolean }
}

0 comments on commit c2a0b33

Please sign in to comment.