Ontology Version: 2.2.0

hotline: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.

Target Classes (1)

Shape Properties

Instances of hotline:HotlineReport can have the following properties:

PROPERTY

MIN COUNT

MAX COUNT

TYPE

hotline:HotlineReport
hotline:currentPhase 1 gufo:Phase
hotline:hasEvidence 1 hotline:EvidenceItem
hotline:intakeChannel 1 hotline:IntakeChannel
hotline:involvesCoordination hotline:MultiAgencyCoordination
hotline:receivedBy 1 hotline:HotlineOrganization
hotline:reportedBy 1
hotline:status 1

Implementation

@prefix hotline: <https://cacontology.projectvic.org/hotlines/core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
hotline: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 hotline: ;
            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 hotline: ;
            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 hotline: ;
            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 hotline: ;
            sh:severity sh:Violation ] ;
    sh:targetClass hotline:HotlineReport .