Ontology Version: 2.7.0

cacontology-hotlines:LifecycleValidationShape leaf node


URI

https://cacontology.projectvic.org/hotlines/core#LifecycleValidationShape

Label

Lifecycle Validation Shape

Description

Enhanced SHACL shape for hotline report lifecycle validation with comprehensive gUFO Event sequence and Phase transition validation.

Implementation

@prefix cacontology-hotlines: <https://cacontology.projectvic.org/hotlines/core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
cacontology-hotlines:LifecycleValidationShape a sh:NodeShape ;
    rdfs:label "Lifecycle Validation Shape"@en ;
    rdfs:comment "Enhanced SHACL shape for hotline report lifecycle validation with comprehensive gUFO Event sequence and Phase transition validation."@en ;
    sh:rule [ a sh:SPARQLRule ;
            sh:construct """
            INSERT { $this a hotline:LifecycleError . }
            WHERE {
                $this hotline:triggersAction ?action .
                ?action a hotline:HotlineAction .
                FILTER NOT EXISTS { ?prev hotline:nextStep ?action . }
                FILTER NOT EXISTS { ?action a hotline:ReportReviewAction . }
            }
        """ ;
            sh:message "The first action must be a ReportReviewAction"@en ;
            sh:prefixes cacontology-hotlines: ;
            sh:severity sh:Violation ],
        [ a sh:SPARQLRule ;
            sh:construct """
            INSERT { $this a hotline:PhaseSequenceError . }
            WHERE {
                $this hotline:currentPhase ?currentPhase .
                ?currentPhase a ?phaseType .
                ?phaseType rdfs:subClassOf gufo:Phase .
                # Invalid transitions logic would be implemented here
                FILTER EXISTS {
                    # Example: ActionPhase cannot directly follow IntakePhase
                    ?currentPhase a hotline:ActionPhase .
                    ?previousPhase hotline:nextPhase ?currentPhase .
                    ?previousPhase a hotline:IntakePhase .
                }
            }
        """ ;
            sh:message "Phases must follow logical sequence: Intake → Review → Action → Closure"@en ;
            sh:prefixes cacontology-hotlines: ;
            sh:severity sh:Violation ],
        [ a sh:SPARQLRule ;
            sh:construct """
            INSERT { $this a hotline:TemporalConsistencyError . }
            WHERE {
                $this hotline:triggersAction ?action .
                ?action a gufo:Event .
                ?action uco-core:startTime ?actionStart .
                $this hotline:currentPhase ?phase .
                ?phase hotline:phaseBeginTime ?phaseStart .
                FILTER(?actionStart < ?phaseStart)
            }
        """ ;
            sh:message "gUFO Events must maintain temporal consistency within phases"@en ;
            sh:prefixes cacontology-hotlines: ;
            sh:severity sh:Violation ],
        [ a sh:SPARQLRule ;
            sh:construct """
            INSERT { $this a hotline:RoleAssignmentError . }
            WHERE {
                $this hotline:triggersAction ?action .
                ?action uco-action:performer ?performer .
                FILTER NOT EXISTS { 
                    ?performer hotline:playsRole ?role .
                    ?role a gufo:Role .
                }
            }
        """ ;
            sh:message "All actions must be performed by entities with appropriate gUFO Roles"@en ;
            sh:prefixes cacontology-hotlines: ;
            sh:severity sh:Violation ] ;
    sh:targetClass cacontology-hotlines:HotlineReport .