diff --git a/patterns/change of qualities with TQCs/shape-data.ttl b/patterns/change of qualities with TQCs/shape-data.ttl new file mode 100644 index 000000000..de3aa4bb1 --- /dev/null +++ b/patterns/change of qualities with TQCs/shape-data.ttl @@ -0,0 +1,62 @@ +@prefix mo: . +@prefix si: . +@prefix : . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix xml: . +@prefix xsd: . +@prefix rdfs: . +@base . + + + rdf:type owl:Ontology . + +@prefix independent_continuant: . +@prefix material: . +@prefix object: . +@prefix temporally_qualified_continuant: . +@prefix exists_at: . +@prefix temporal_region: . +@prefix quality: . +@prefix has_characteristic: . +@prefix has_state: . +@prefix is_state_of: . +@prefix thickness: . +@prefix specified_by_value: . +@prefix svs: . +@prefix has_specified_numeric_value: . +@prefix has_measurement_unit_label: . + + +thickness: rdfs:subClassOf quality: . +material: rdfs:subClassOf independent_continuant: . + +# Define anchor/base +ex:base_material a material: . +ex:base_material has_state: ex:object_at_t1 . +ex:base_material has_state: ex:object_at_t2 . + +# tcq1 has quality thickness with value 40 mm +ex:object_at_t1 a temporally_qualified_continuant: . +ex:object_at_t1 a object: . +ex:object_at_t1 is_state_of: ex:base_material . +ex:object_at_t1 has_characteristic: ex:thickness_t1 . +ex:thickness_t1 a thickness: . +ex:thickness_t1 specified_by_value: ex:SVS_40_mm . +ex:SVS_40_mm a svs: ; + has_measurement_unit_label: ; # millimeter + has_specified_numeric_value: "40"^^xsd:float . + + + +# tcq2 has quality thickness with value 2.5 mm +ex:object_at_t2 a temporally_qualified_continuant: . +ex:object_at_t2 a object: . +ex:object_at_t2 is_state_of: ex:base_material . +ex:object_at_t2 has_characteristic: ex:thickness_t2 . +ex:thickness_t2 a thickness: . +ex:thickness_t2 specified_by_value: ex:SVS_2.5_mm . +ex:SVS_2.5_mm a svs: ; + has_measurement_unit_label: ; # millimeter + has_specified_numeric_value: "2.5"^^xsd:float . \ No newline at end of file diff --git a/patterns/change of qualities with TQCs/shape.ttl b/patterns/change of qualities with TQCs/shape.ttl new file mode 100644 index 000000000..cd21eee6c --- /dev/null +++ b/patterns/change of qualities with TQCs/shape.ttl @@ -0,0 +1,73 @@ +@prefix obo: . +@prefix owl: . +@prefix pmd: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . +@prefix shape: . +@base shape: . + +shape:tqc_pair_quality_change + a sh:NodeShape ; + sh:targetClass pmd:PMD_0000068 ; # temporally qualified continuant + sh:description """ + For any TQC (tqc1) that is a state of some base individual, if there exists + another TQC (tqc2) that is also a state of the same individual, and both TQCs + bear qualities of the same lowest-level class, then those quality values must differ. + This captures that a change of quality actually occurred between two states. + """ ; + + sh:severity sh:Violation ; + sh:message "Two TQCs that are states of the same individual bear qualities of the same lowest-level class, but their quality values are identical — no change of quality occurred." ; + + sh:sparql + [ + a sh:SPARQLConstraint ; + sh:select """ + PREFIX pmd: + PREFIX obo: + PREFIX rdfs: + + SELECT DISTINCT $this ?tqc2 ?sharedQualityClass ?svs1 ?svs2 + WHERE { + + # STEP 1. Both TQCs are states of the same base individual + ?baseIndividual pmd:PMD_0000069 $this . # base -->has state--> tqc1 + ?baseIndividual pmd:PMD_0000069 ?tqc2 . # base -->has state--> tqc2 + FILTER ( $this != ?tqc2 ) # they must be distinct TQCs + + # STEP 2. tqc1 has quality; find its lowest-level class ─ + $this obo:RO_0000053 ?quality1 . # has characteristic + ?quality1 a ?sharedQualityClass . + FILTER NOT EXISTS { + ?childClass1 rdfs:subClassOf ?sharedQualityClass . + ?quality1 a ?childClass1 + } + + # STEP 3. tqc2 has quality of the same lowest-level class ─ + ?tqc2 obo:RO_0000053 ?quality2 . # has characteristic + ?quality2 a ?sharedQualityClass . # same class as quality1 + FILTER NOT EXISTS { + ?childClass2 rdfs:subClassOf ?sharedQualityClass . + ?quality2 a ?childClass2 + } + + # STEP 4. Get the concrete values of both qualities + ?quality1 pmd:PMD_0000077 ?svs1 . # WARNING: THE PREDICATE MIGHT CHANGE SOON + ?quality2 pmd:PMD_0000077 ?svs2 . + + ?svs1 obo:OBI_0001937 ?value1 ; + obo:IAO_0000039 ?unit1 . + + ?svs2 obo:OBI_0001937 ?value2 ; + obo:IAO_0000039 ?unit2 . + + # STEP 5. The values must NOT be equal — violation if they are ─ + FILTER ( ?value1 = ?value2 && ?unit1 = ?unit2) + } + """ ; + ] ; + + sh:closed false ; + sh:ignoredProperties ( rdf:type owl:topDataProperty owl:topObjectProperty ) . \ No newline at end of file diff --git a/patterns/change of quality with tqc/shape-data.ttl b/patterns/qualities of TQC vs Anchor (base)/shape-data.ttl similarity index 100% rename from patterns/change of quality with tqc/shape-data.ttl rename to patterns/qualities of TQC vs Anchor (base)/shape-data.ttl diff --git a/patterns/change of quality with tqc/shape.ttl b/patterns/qualities of TQC vs Anchor (base)/shape.ttl similarity index 100% rename from patterns/change of quality with tqc/shape.ttl rename to patterns/qualities of TQC vs Anchor (base)/shape.ttl diff --git a/src/ontology/components/pmdco-shared.owl b/src/ontology/components/pmdco-shared.owl index 8b60ed2fb..f78c1d03e 100644 --- a/src/ontology/components/pmdco-shared.owl +++ b/src/ontology/components/pmdco-shared.owl @@ -478,4 +478,7 @@ EquivalentClasses(:PMD_0080205 ObjectIntersectionOf(obo:OBI_0001931 :PMD_0060001 ) +AnnotationAssertion( :PMD_0060002 ) + ) \ No newline at end of file