Skip to content

Commit

Permalink
Add label synonym polysemy check (#2112)
Browse files Browse the repository at this point in the history
* add label synonym polysemy check

* update annotation to use obo:cl#abbreviation in sparql qc

---------

Co-authored-by: Anita Caron <[email protected]>
  • Loading branch information
Anita Caron and anitacaron authored Sep 1, 2023
1 parent 949e6ba commit 4256b6f
Show file tree
Hide file tree
Showing 3 changed files with 38 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 @@ -41,7 +41,7 @@ REPORT_FAIL_ON = ERROR
REPORT_LABEL =
REPORT_PROFILE_OPTS =
OBO_FORMAT_OPTIONS =
SPARQL_VALIDATION_CHECKS = equivalent-classes owldef-self-reference nolabels pmid-not-dbxref obsolete-replaced_by obsolete-alt-id orcid-contributor illegal-annotation-property
SPARQL_VALIDATION_CHECKS = equivalent-classes owldef-self-reference nolabels pmid-not-dbxref obsolete-replaced_by obsolete-alt-id orcid-contributor illegal-annotation-property label-synonym-polysemy
SPARQL_EXPORTS = basic-report
ODK_VERSION_MAKEFILE = v1.4.1

Expand Down
1 change: 1 addition & 0 deletions src/ontology/cl-odk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ robot_report:
- obsolete-alt-id
- orcid-contributor
- illegal-annotation-property
- label-synonym-polysemy
custom_sparql_exports :
- basic-report
components:
Expand Down
36 changes: 36 additions & 0 deletions src/sparql/label-synonym-polysemy-violation.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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 ?entity ?property ?value WHERE {
VALUES ?property {
obo:IAO_0000118
oboInOwl:hasExactSynonym
rdfs:label
}
{ SELECT DISTINCT ?iname (COUNT(DISTINCT ?entity) AS ?cnt) WHERE {
VALUES ?property {
obo:IAO_0000118
oboInOwl:hasExactSynonym
rdfs:label
}
?entity ?property ?name .
OPTIONAL {
?abbr a owl:Axiom;
owl:annotatedSource ?entity;
owl:annotatedProperty oboInOwl:hasExactSynonym;
owl:annotatedTarget ?name;
oboInOwl:hasSynonymType <http://purl.obolibrary.org/obo/cl#abbreviation>.
}

BIND(UCASE((?name)) AS ?iname)
FILTER (!isBlank(?entity) && !BOUND(?abbr))
FILTER NOT EXISTS { ?entity owl:deprecated true }
} GROUP BY ?iname HAVING (?cnt > 1)
}
?entity ?property ?value .
FILTER (!isBlank(?entity))
FILTER NOT EXISTS { ?entity owl:deprecated true }
FILTER (UCASE(?value) = ?iname)
} ORDER BY ?entity

0 comments on commit 4256b6f

Please sign in to comment.