From 167a948eab3bd956476808334b13c19750ba8cbb Mon Sep 17 00:00:00 2001 From: Anita Caron Date: Mon, 4 Apr 2022 06:11:15 -0300 Subject: [PATCH] Add obsolete report with replaced_by information (#2372) * add sparql query * add sparql check config --- src/ontology/Makefile | 2 +- src/ontology/uberon-odk.yaml | 1 + .../obsolete-replaced_by-violation.sparql | 67 +++++++++++++++++++ 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 src/sparql/obsolete-replaced_by-violation.sparql diff --git a/src/ontology/Makefile b/src/ontology/Makefile index 1fe4230a2d..842192dfa6 100644 --- a/src/ontology/Makefile +++ b/src/ontology/Makefile @@ -39,7 +39,7 @@ REPORT_FAIL_ON = ERROR REPORT_LABEL = REPORT_PROFILE_OPTS = --profile $(ROBOT_PROFILE) OBO_FORMAT_OPTIONS = -SPARQL_VALIDATION_CHECKS = equivalent-classes owldef-self-reference illegal-annotation-property taxon-range orcid-contributor +SPARQL_VALIDATION_CHECKS = equivalent-classes owldef-self-reference illegal-annotation-property taxon-range orcid-contributor obsolete-replaced_by SPARQL_EXPORTS = basic-report ODK_VERSION_MAKEFILE = v1.3.0 diff --git a/src/ontology/uberon-odk.yaml b/src/ontology/uberon-odk.yaml index 2edf1907dc..d17438371e 100644 --- a/src/ontology/uberon-odk.yaml +++ b/src/ontology/uberon-odk.yaml @@ -98,6 +98,7 @@ robot_report: - illegal-annotation-property - taxon-range - orcid-contributor + - obsolete-replaced_by custom_sparql_exports: - basic-report owltools_memory: '20G' diff --git a/src/sparql/obsolete-replaced_by-violation.sparql b/src/sparql/obsolete-replaced_by-violation.sparql new file mode 100644 index 0000000000..9860902be6 --- /dev/null +++ b/src/sparql/obsolete-replaced_by-violation.sparql @@ -0,0 +1,67 @@ +PREFIX obo: +PREFIX oboInOwl: +PREFIX owl: +PREFIX rdfs: +PREFIX rdf: +PREFIX replaced_by: + +SELECT DISTINCT ?entity ?property ?value ?replaced_by WHERE { + { + VALUES ?property { + rdfs:subClassOf + } + ?entity a owl:Class; + owl:deprecated true ; + ?property ?value . + OPTIONAL { ?entity replaced_by: ?replaced_by } + FILTER ( ?value NOT IN (oboInOwl:ObsoleteClass, owl:Thing) ) + } + UNION + { + VALUES ?property { + owl:equivalentClass + owl:disjointWith + } + ?entity a owl:Class; + owl:deprecated true ; + ?property ?value . + OPTIONAL { ?entity replaced_by: ?replaced_by } + } + UNION + { + VALUES ?property { + rdfs:subClassOf + owl:equivalentClass + owl:disjointWith + } + ?entity a owl:Class; + owl:deprecated true . + ?value ?property ?entity . + OPTIONAL { ?entity replaced_by: ?replaced_by } + } + UNION + { + VALUES ?property { + owl:ObjectProperty + owl:DataProperty + } + ?entity a owl:Class ; + owl:deprecated true ; + ?property ?value . + OPTIONAL { ?entity replaced_by: ?replaced_by } + } + UNION + { + VALUES ?property { + owl:someValuesFrom + owl:allValuesFrom + } + ?value a owl:Class ; + owl:deprecated true . + ?rest a owl:Restriction ; + ?property ?value . + OPTIONAL { ?value replaced_by: ?replaced_by } + BIND("blank node" as ?entity) + } +} +ORDER BY ?entity \ No newline at end of file