Skip to content

Commit 62aefff

Browse files
committed
Add duplicate exact mappings & dup unscoped xrefs reports to DO QC
These reports address issues with duplicate xrefs and mappings. Prompted by #1494.
1 parent d24a3e6 commit 62aefff

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Identify xrefs/exact mappings annotated to multiple diseases
2+
3+
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
4+
PREFIX owl: <http://www.w3.org/2002/07/owl#>
5+
PREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>
6+
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
7+
8+
SELECT DISTINCT ?entity ?property ?value
9+
WHERE {
10+
{
11+
SELECT ?value
12+
WHERE {
13+
VALUES ?property {
14+
oboInOwl:hasDbXref
15+
skos:exactMatch
16+
}
17+
?entity a owl:Class ;
18+
skos:exactMatch ?value .
19+
FILTER(
20+
STRSTARTS(STR(?entity), "http://purl.obolibrary.org/obo/DOID_")
21+
)
22+
FILTER NOT EXISTS { ?entity owl:deprecated ?any }
23+
}
24+
GROUP BY ?value
25+
HAVING (COUNT(DISTINCT ?entity) > 1)
26+
}
27+
?entity a owl:Class ;
28+
?property ?value .
29+
FILTER(STRSTARTS(STR(?entity), "http://purl.obolibrary.org/obo/DOID_"))
30+
FILTER NOT EXISTS { ?entity owl:deprecated ?any }
31+
}
32+
ORDER BY ?value ?entity ?property
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Identify "unscoped" xrefs (i.e. those without corresponding skos mappings)
2+
# that are annotated to multiple diseases
3+
4+
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
5+
PREFIX owl: <http://www.w3.org/2002/07/owl#>
6+
PREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>
7+
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
8+
9+
SELECT DISTINCT ?entity ?property ?value
10+
WHERE {
11+
{
12+
SELECT ?property ?value
13+
WHERE {
14+
VALUES ?property { oboInOwl:hasDbXref }
15+
?entity a owl:Class ;
16+
?property ?value .
17+
FILTER(
18+
STRSTARTS(STR(?entity), "http://purl.obolibrary.org/obo/DOID_")
19+
)
20+
FILTER NOT EXISTS { ?entity owl:deprecated ?any }
21+
FILTER NOT EXISTS {
22+
VALUES ?skos {
23+
skos:exactMatch
24+
skos:narrowMatch
25+
skos:broadMatch
26+
skos:relatedMatch
27+
}
28+
?entity ?skos ?value .
29+
}
30+
}
31+
GROUP BY ?property ?value
32+
HAVING (COUNT(DISTINCT ?entity) > 1)
33+
}
34+
?entity ?property ?value .
35+
FILTER(STRSTARTS(STR(?entity), "http://purl.obolibrary.org/obo/DOID_"))
36+
FILTER NOT EXISTS { ?entity owl:deprecated ?any }
37+
}
38+
ORDER BY ?value ?entity

src/sparql/report/report_profile.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
ERROR equivalent_pair
22
ERROR invalid_xref
33
ERROR file:./src/sparql/report/def_src_not_url.rq
4+
ERROR file:./src/sparql/report/duplicate_exact_mappings.rq
45
ERROR file:./src/sparql/report/invalid_class_id.rq
56
ERROR file:./src/sparql/report/invalid_obo_namespace.rq
67
ERROR file:./src/sparql/report/invalid_syn_type_property.rq
@@ -12,5 +13,6 @@ WARN file:./src/sparql/report/invalid_mapping.rq
1213
WARN file:./src/sparql/report/newline_in_text.rq
1314
WARN file:./src/sparql/report/unpunctuated_definition.rq
1415
WARN file:./src/sparql/report/xref_as_synonym.rq
16+
INFO file:./src/sparql/report/duplicate_unscoped_xrefs.rq
1517
INFO file:./src/sparql/report/missing_definition_xref.rq
1618
INFO file:./src/sparql/report/xref_is_url.rq

0 commit comments

Comments
 (0)