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

Add label synonym polysemy check #2112

Merged
merged 4 commits into from
Sep 1, 2023
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
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