-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1179 from allenbaron/query_update
Exclude some synonym types from duplicate_exact_synonym report query
- Loading branch information
Showing
3 changed files
with
56 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,40 @@ | ||
# Duplicate Exact Synonym | ||
|
||
**Problem:** Two entities share an exact synonym. This causes ambiguity. Excludes deprecated entities. | ||
**Problem:** Two entities share an exact synonym (case-insensitive). This causes ambiguity. Excludes deprecated entities and synonyms annotated as abbreviation or acronym. | ||
|
||
**Solution:** Avoid ambiguity by assigning unique exact synonyms or changing the exact synonym to a different annotation (e.g. broad synonym). | ||
**Solution:** Avoid ambiguity by assigning unique exact synonyms, changing the exact synonym to a different annotation (e.g. broad synonym), or annotating it as an abbreviation or acronym. | ||
|
||
```sparql | ||
PREFIX obo: <http://purl.obolibrary.org/obo/> | ||
PREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#> | ||
PREFIX owl: <http://www.w3.org/2002/07/owl#> | ||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
SELECT DISTINCT ?entity ?property ?value WHERE { | ||
VALUES ?property { | ||
obo:IAO_0000118 | ||
oboInOwl:hasExactSynonym | ||
SELECT DISTINCT ?entity ?property ?value | ||
WHERE { | ||
{ | ||
SELECT DISTINCT ?syn_std ?property (COUNT(DISTINCT ?entity) AS ?cnt) | ||
WHERE { | ||
VALUES ?property { obo:IAO_0000118 oboInOwl:hasExactSynonym } | ||
?entity ?property ?syn . | ||
OPTIONAL { | ||
VALUES ?syn_type { obo:OMO_0003000 obo:OMO_0003012 } | ||
?exclude a owl:Axiom ; | ||
owl:annotatedSource ?entity ; | ||
owl:annotatedProperty ?property ; | ||
owl:annotatedTarget ?syn ; | ||
oboInOwl:hasSynonymType ?syn_type . | ||
} | ||
BIND(UCASE(?syn) AS ?syn_std) | ||
FILTER (!isBlank(?entity) && !BOUND(?exclude)) | ||
FILTER NOT EXISTS { ?entity owl:deprecated true } | ||
} GROUP BY ?syn_std ?property HAVING (?cnt > 1) | ||
} | ||
?entity ?property ?value. | ||
?entity2 ?property ?value . | ||
FILTER NOT EXISTS { ?entity owl:deprecated true } | ||
FILTER NOT EXISTS { ?entity2 owl:deprecated true } | ||
FILTER (?entity != ?entity2) | ||
?entity ?property ?value . | ||
FILTER (!isBlank(?entity)) | ||
FILTER (!isBlank(?entity2)) | ||
FILTER NOT EXISTS { ?entity owl:deprecated true } | ||
FILTER (UCASE(?value) = ?syn_std) | ||
} | ||
ORDER BY DESC(UCASE(str(?value))) | ||
``` | ||
``` |
39 changes: 26 additions & 13 deletions
39
robot-core/src/main/resources/report_queries/duplicate_exact_synonym.rq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,38 @@ | ||
# # Duplicate Exact Synonym | ||
# | ||
# **Problem:** Two entities share an exact synonym. This causes ambiguity. Excludes deprecated entities. | ||
# **Problem:** Two entities share an exact synonym (case-insensitive). This causes ambiguity. Excludes deprecated entities and synonyms annotated as abbreviation or acronym. | ||
# | ||
# **Solution:** Avoid ambiguity by assigning unique exact synonyms or changing the exact synonym to a different annotation (e.g. broad synonym). | ||
# **Solution:** Avoid ambiguity by assigning unique exact synonyms, changing the exact synonym to a different annotation (e.g. broad synonym), or annotating it as an abbreviation or acronym. | ||
|
||
PREFIX obo: <http://purl.obolibrary.org/obo/> | ||
PREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#> | ||
PREFIX owl: <http://www.w3.org/2002/07/owl#> | ||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
|
||
SELECT DISTINCT ?entity ?property ?value WHERE { | ||
VALUES ?property { | ||
obo:IAO_0000118 | ||
oboInOwl:hasExactSynonym | ||
SELECT DISTINCT ?entity ?property ?value | ||
WHERE { | ||
{ | ||
SELECT DISTINCT ?syn_std ?property (COUNT(DISTINCT ?entity) AS ?cnt) | ||
WHERE { | ||
VALUES ?property { obo:IAO_0000118 oboInOwl:hasExactSynonym } | ||
?entity ?property ?syn . | ||
OPTIONAL { | ||
VALUES ?syn_type { obo:OMO_0003000 obo:OMO_0003012 } | ||
?exclude a owl:Axiom ; | ||
owl:annotatedSource ?entity ; | ||
owl:annotatedProperty ?property ; | ||
owl:annotatedTarget ?syn ; | ||
oboInOwl:hasSynonymType ?syn_type . | ||
} | ||
|
||
BIND(UCASE(?syn) AS ?syn_std) | ||
FILTER (!isBlank(?entity) && !BOUND(?exclude)) | ||
FILTER NOT EXISTS { ?entity owl:deprecated true } | ||
} GROUP BY ?syn_std ?property HAVING (?cnt > 1) | ||
} | ||
?entity ?property ?value. | ||
?entity2 ?property ?value . | ||
FILTER NOT EXISTS { ?entity owl:deprecated true } | ||
FILTER NOT EXISTS { ?entity2 owl:deprecated true } | ||
FILTER (?entity != ?entity2) | ||
?entity ?property ?value . | ||
FILTER (!isBlank(?entity)) | ||
FILTER (!isBlank(?entity2)) | ||
FILTER NOT EXISTS { ?entity owl:deprecated true } | ||
FILTER (UCASE(?value) = ?syn_std) | ||
} | ||
ORDER BY DESC(UCASE(str(?value))) | ||
ORDER BY DESC(UCASE(str(?value))) |