Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude some synonym types from duplicate_exact_synonym report query #1179

Merged
merged 5 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Added option to input template strings from external file [#1152]

### Changed
- Updated `duplicate_exact_syonym` [`report`] query to be case-insensitive and ignore synoyms annotated as abbreviation or acronym synonym types [#1179]

### Fixed
- '--annotate-with-source true' does not work with extract --method subset [#1160]
- Fix how Template adds entities to the QuotedEntityChecker [#1104]
Expand Down Expand Up @@ -388,6 +391,7 @@ First official release of ROBOT!
[`validate`]: http://robot.obolibrary.org/validate
;
[#1181]: https://github.com/ontodev/robot/pull/1181
[#1179]: https://github.com/ontodev/robot/pull/1179
[#1171]: https://github.com/ontodev/robot/pull/1171
[#1168]: https://github.com/ontodev/robot/pull/1168
[#1160]: https://github.com/ontodev/robot/pull/1160
Expand Down
39 changes: 26 additions & 13 deletions docs/report_queries/duplicate_exact_synonym.md
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)))
```
```
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)))
Loading