Ontology Version: 2.2.0

cacontology-multi:TaskForceCompositionShape leaf node


URI

https://cacontology.projectvic.org/multi-jurisdiction#TaskForceCompositionShape

Label

Task Force Composition Shape

Description

Validates gUFO part-whole relationships for task force composition.

Target Classes (1)

Shape Properties

Instances of cacontology-multi:TaskForce can have the following properties:

PROPERTY

MIN COUNT

MAX COUNT

TYPE

Implementation

@prefix cacontology-multi: <https://cacontology.projectvic.org/multi-jurisdiction#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
cacontology-multi:TaskForceCompositionShape a sh:NodeShape ;
    rdfs:label "Task Force Composition Shape"@en ;
    rdfs:comment "Validates gUFO part-whole relationships for task force composition."@en ;
    sh:sparql [ sh:message "Task force composition must include agencies from at least 2 different jurisdictional levels (gUFO part-whole constraint)."@en ;
            sh:select """
            SELECT $this
            WHERE {
                $this rdf:type cacontology-multi:TaskForce .
                {
                    SELECT $this (COUNT(DISTINCT ?level) AS ?levelCount)
                    WHERE {
                        $this cacontology-multi:includesAgency ?agency .
                        ?agency rdf:type ?agencyType .
                        ?agencyType rdfs:subClassOf* cacontology-multi:LawEnforcementAgency .
                        BIND(
                            IF(?agencyType = cacontology-multi:FederalAgency, "federal",
                            IF(?agencyType = cacontology-multi:StateAgency, "state",
                            IF(?agencyType = cacontology-multi:LocalAgency, "local", "other"))) AS ?level
                        )
                    }
                    GROUP BY $this
                }
                FILTER (?levelCount < 2)
            }
        """ ] ;
    sh:targetClass cacontology-multi:TaskForce .