|
| 1 | +# Title: |
| 2 | +# cco:ont00001760 Value Must Point to a Declared CCO Ontology |
| 3 | +# Constraint Description: |
| 4 | +# The value of cco:ont00001760 [is curated in ontology] on every CCO ontology |
| 5 | +# element must be the IRI of a CCO ontology that is actually declared as |
| 6 | +# owl:Ontology within the CCO namespace |
| 7 | +# (https://www.commoncoreontologies.org/). |
| 8 | +# This catches values that: |
| 9 | +# - Point to a non-existent or deleted ontology module. |
| 10 | +# - Use the old v1 namespace (http://www.ontologyrepository.com/...). |
| 11 | +# - Contain a typo in the ontology name. |
| 12 | +# Severity: |
| 13 | +# Error |
| 14 | +# Reference: |
| 15 | +# CCO Release Process v2, Step 6c / Step 6f |
| 16 | +# Author: |
| 17 | +# github.com/shanmukhkalasamudram |
| 18 | + |
| 19 | +PREFIX owl: <http://www.w3.org/2002/07/owl#> |
| 20 | +PREFIX cco: <https://www.commoncoreontologies.org/> |
| 21 | + |
| 22 | +SELECT DISTINCT ?resource ?curatedIn ?error |
| 23 | +WHERE { |
| 24 | + VALUES ?type { |
| 25 | + owl:Class |
| 26 | + owl:ObjectProperty |
| 27 | + owl:AnnotationProperty |
| 28 | + owl:DatatypeProperty |
| 29 | + owl:NamedIndividual |
| 30 | + } |
| 31 | + ?resource a ?type . |
| 32 | + FILTER (STRSTARTS(STR(?resource), "https://www.commoncoreontologies.org/")) |
| 33 | + FILTER (!isBlank(?resource)) |
| 34 | + ?resource cco:ont00001760 ?curatedIn . |
| 35 | + # The merged file only carries one owl:Ontology IRI (CommonCoreOntologiesMerged), |
| 36 | + # so dynamic lookup against owl:Ontology triples is not feasible for merged runs. |
| 37 | + # Instead validate against the fixed allowlist of the 11 CCO module ontology IRIs. |
| 38 | + # Update this list whenever a module is added or removed. |
| 39 | + FILTER (STR(?curatedIn) NOT IN ( |
| 40 | + "https://www.commoncoreontologies.org/AgentOntology", |
| 41 | + "https://www.commoncoreontologies.org/ArtifactOntology", |
| 42 | + "https://www.commoncoreontologies.org/CurrencyUnitOntology", |
| 43 | + "https://www.commoncoreontologies.org/EventOntology", |
| 44 | + "https://www.commoncoreontologies.org/ExtendedRelationOntology", |
| 45 | + "https://www.commoncoreontologies.org/FacilityOntology", |
| 46 | + "https://www.commoncoreontologies.org/GeospatialOntology", |
| 47 | + "https://www.commoncoreontologies.org/InformationEntityOntology", |
| 48 | + "https://www.commoncoreontologies.org/QualityOntology", |
| 49 | + "https://www.commoncoreontologies.org/TimeOntology", |
| 50 | + "https://www.commoncoreontologies.org/UnitsOfMeasureOntology" |
| 51 | + )) |
| 52 | + BIND (CONCAT( |
| 53 | + "ERROR: Term <", STR(?resource), |
| 54 | + "> has cco:ont00001760 value <", STR(?curatedIn), |
| 55 | + "> which does not match any known CCO module ontology IRI." |
| 56 | + ) AS ?error) |
| 57 | +} |
| 58 | +ORDER BY ?resource |
0 commit comments