# =============================================================================
#  PWM 0.10 SHACL shapes
#
#  The rules from the ontology that can be checked on data. Each shape names
#  the references it enforces (dcterms:source) and each message gives the
#  paragraph or item. Validate data together with pwm.ttl, with RDFS
#  inference on, so that subclass targets and sub-properties resolve:
#
#    pyshacl -s pwm-shapes.ttl -e pwm.ttl -i rdfs data.ttl
# =============================================================================

@prefix rdf:      <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:     <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl:      <http://www.w3.org/2002/07/owl#> .
@prefix xsd:      <http://www.w3.org/2001/XMLSchema#> .
@prefix sh:       <http://www.w3.org/ns/shacl#> .
@prefix skos:     <http://www.w3.org/2004/02/skos/core#> .
@prefix dcterms:  <http://purl.org/dc/terms/> .
@prefix prov:     <http://www.w3.org/ns/prov#> .
@prefix cmns-rlcmp: <https://www.omg.org/spec/Commons/RolesAndCompositions/> .
@prefix fibo-fnd-aap-ppl: <https://spec.edmcouncil.org/fibo/ontology/FND/AgentsAndPeople/People/> .
@prefix fibo-fbc-fi-fi: <https://spec.edmcouncil.org/fibo/ontology/FBC/FinancialInstruments/FinancialInstruments/> .
@prefix fibo-fbc-pas-caa: <https://spec.edmcouncil.org/fibo/ontology/FBC/ProductsAndServices/ClientsAndAccounts/> .
@prefix pwm:      <https://ahmedmuzammil.com/ontology/pwm#> .
@prefix pwmref:   <https://ahmedmuzammil.com/ontology/pwm#ref-> .
@prefix pwmsh:    <https://ahmedmuzammil.com/ontology/pwm/shapes#> .

<https://ahmedmuzammil.com/ontology/pwm/shapes>
    a owl:Ontology ;
    owl:versionIRI <https://ahmedmuzammil.com/ontology/pwm/0.10/pwm-shapes.ttl> ;
    owl:versionInfo "0.10 (draft)" ;
    owl:priorVersion <https://ahmedmuzammil.com/ontology/pwm/0.8/pwm-shapes.ttl> ;
    dcterms:created "2026-11-02"^^xsd:date ;
    dcterms:modified "2026-11-19"^^xsd:date ;
    dcterms:title "Private Wealth Management Ontology: SHACL shapes"@en ;
    dcterms:description "Data rules for the Private Wealth Management Ontology 0.10. Shapes stay generic; a firm adds its own thresholds and jurisdiction rules in a separate shapes graph."@en ;
    dcterms:creator "Ahmed Muzammil" ;
    dcterms:license <https://creativecommons.org/licenses/by-sa/4.0/> ;
    dcterms:requires <https://ahmedmuzammil.com/ontology/pwm/0.10> ;
    sh:declare [ sh:prefix "prov" ; sh:namespace "http://www.w3.org/ns/prov#"^^xsd:anyURI ] ;
    sh:declare
        [ sh:prefix "xsd" ; sh:namespace "http://www.w3.org/2001/XMLSchema#"^^xsd:anyURI ] ,
        [ sh:prefix "pwm" ; sh:namespace "https://ahmedmuzammil.com/ontology/pwm#"^^xsd:anyURI ] ,
        [ sh:prefix "skos" ; sh:namespace "http://www.w3.org/2004/02/skos/core#"^^xsd:anyURI ] ,
        [ sh:prefix "cmns-rlcmp" ; sh:namespace "https://www.omg.org/spec/Commons/RolesAndCompositions/"^^xsd:anyURI ] ,
        [ sh:prefix "prov" ; sh:namespace "http://www.w3.org/ns/prov#"^^xsd:anyURI ] .

# --- Accountability: a named person, never an agent --------------------------------------

pwmsh:AccountabilityRoleShape a sh:NodeShape ;
    rdfs:label "Accountability role"@en ;
    sh:targetClass pwm:AccountabilityRole ;
    dcterms:source pwmref:KOG-ROADMAP , pwmref:MAS-AIRG ;
    sh:property [
        sh:path cmns-rlcmp:isPlayedBy ;
        sh:minCount 1 ;
        sh:class fibo-fnd-aap-ppl:Person ;
        sh:message "An accountability role must be held by a named person (Kognita 0.4 item 8; MAS AIRG 4.7 key roles)." ;
    ] ;
    sh:property [
        sh:path cmns-rlcmp:isPlayedBy ;
        sh:not [ sh:class pwm:AIAgent ] ;
        sh:message "An AI agent can never be named in an accountability role (Kognita 0.4 item 8)." ;
    ] .

# --- AI use case register ----------------------------------------------------------------

pwmsh:AIUseCaseShape a sh:NodeShape ;
    rdfs:label "AI use case"@en ;
    sh:targetClass pwm:AIUseCase ;
    dcterms:source pwmref:MAS-AIRG , pwmref:KOG-ROADMAP ;
    sh:property [ sh:path pwm:hasPurpose ; sh:minCount 1 ;
        sh:message "A use case records its purpose (MAS AIRG 4.7)." ] ;
    sh:property [ sh:path pwm:approvedJurisdiction ; sh:minCount 1 ; sh:pattern "^[A-Z]{2}$" ;
        sh:message "A use case records its approved jurisdiction as an ISO 3166-1 alpha-2 code (MAS AIRG 4.7 approved scope of use)." ] ;
    sh:property [ sh:path pwm:lifecycleStatus ; sh:minCount 1 ; sh:maxCount 1 ;
        sh:in ( pwm:StatusPilot pwm:StatusLive pwm:StatusSuspended pwm:StatusRetired ) ;
        sh:message "A use case has one lifecycle status: pilot, live, suspended or retired (MAS AIRG 4.7; Kognita 0.4 item 8)." ] ;
    sh:property [ sh:path pwm:riskTier ; sh:minCount 1 ; sh:maxCount 1 ;
        sh:in ( pwm:Tier1 pwm:Tier2 pwm:Tier3 pwm:Tier4 ) ;
        sh:message "A use case has one risk tier, 1 to 4 (Kognita 0.4 item 8)." ] ;
    sh:property [ sh:path pwm:isMediated ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ;
        sh:message "A use case states whether the control plane mediates it. Embedded vendor AI is registered too, marked unmediated (Kognita 0.4 item 8; MAS AIRG 4.2)." ] ;
    sh:property [ sh:path pwm:nextReviewDate ; sh:minCount 1 ; sh:datatype xsd:dateTime ;
        sh:message "A use case carries a review date set by its tier; past it, the use case is refused (Kognita 0.4 item 8)." ] ;
    sh:property [ sh:path pwm:hasAccountabilityRole ;
        sh:qualifiedValueShape [ sh:class pwm:BusinessOwner ] ; sh:qualifiedMinCount 1 ;
        sh:message "A use case with no business owner is refused (Kognita 0.4 item 8; MAS AIRG 4.7)." ] ;
    sh:or (
        [ sh:property [ sh:path pwm:riskTier ; sh:hasValue pwm:Tier1  ; sh:message "riskTier: required value Tier1." ] ]
        [ sh:property [ sh:path pwm:hasAccountabilityRole ;
            sh:qualifiedValueShape [ sh:class pwm:KnowledgeLead ] ; sh:qualifiedMinCount 1  ; sh:message "hasAccountabilityRole: satisfy the stated field restrictions." ] ]
    ) ;
    sh:message "A use case at tier 2 or above with no named Knowledge Lead is refused (Kognita 0.4 item 8)." .

pwmsh:LiveUseCaseShape a sh:NodeShape ;
    rdfs:label "Live use case"@en ;
    sh:targetClass pwm:AIUseCase ;
    dcterms:source pwmref:MAS-AIRG , pwmref:KOG-ROADMAP ;
    sh:or (
        [ sh:not [ sh:property [ sh:path pwm:lifecycleStatus ; sh:hasValue pwm:StatusLive  ; sh:message "lifecycleStatus: required value StatusLive." ] ] ]
        [ sh:property [ sh:path pwm:hasMaterialityAssessment ;
            sh:qualifiedValueShape pwmsh:ApprovedMaterialityShape ; sh:qualifiedMinCount 1  ; sh:message "hasMaterialityAssessment: satisfy the stated field restrictions." ] ]
    ) ;
    sh:message "A live use case needs a materiality assessment with inherent and residual ratings, approved by the designated control function (MAS AIRG 4.11, 4.13; Kognita 0.4 item 8)." .

pwmsh:ApprovedMaterialityShape a sh:NodeShape ;
    rdfs:label "Approved materiality assessment"@en ;
    rdfs:comment "Used inside LiveUseCaseShape. Has no target of its own."@en ;
    sh:property [ sh:path pwm:approvedBy ; sh:minCount 1 ; sh:class pwm:DesignatedControlFunction  ; sh:message "approvedBy: minimum count 1; class DesignatedControlFunction." ] ;
    sh:property [ sh:path pwm:inherentMateriality ; sh:minCount 1  ; sh:message "inherentMateriality: minimum count 1." ] ;
    sh:property [ sh:path pwm:residualMateriality ; sh:minCount 1  ; sh:message "residualMateriality: minimum count 1." ] .

pwmsh:ControlFunctionSeparationShape a sh:NodeShape ;
    rdfs:label "Control function separation"@en ;
    sh:targetClass pwm:AIUseCase ;
    dcterms:source pwmref:KOG-ROADMAP , pwmref:MAS-AIRG ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "The person who approves a use case's materiality rating for the control function cannot also be its business or technology owner (Kognita 0.4 item 8; MAS AIRG 4.13 independent oversight)." ;
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:select """
            SELECT $this ?value WHERE {
                $this pwm:hasMaterialityAssessment/pwm:approvedBy/cmns-rlcmp:isPlayedBy ?value .
                $this pwm:hasAccountabilityRole ?owner .
                ?owner cmns-rlcmp:isPlayedBy ?value .
                { ?owner a pwm:BusinessOwner } UNION { ?owner a pwm:TechnologyOwner }
            }
        """ ;
    ] .

pwmsh:RiskMaterialityAssessmentShape a sh:NodeShape ;
    rdfs:label "Risk materiality assessment"@en ;
    sh:targetClass pwm:RiskMaterialityAssessment ;
    dcterms:source pwmref:MAS-AIRG ;
    sh:property [ sh:path pwm:impact ; sh:minCount 1 ; sh:maxCount 1 ;
        sh:in ( pwm:RatingLow pwm:RatingMedium pwm:RatingHigh pwm:RatingCritical ) ;
        sh:message "Rate impact, low to critical (MAS AIRG 4.12(a))." ] ;
    sh:property [ sh:path pwm:complexity ; sh:minCount 1 ; sh:maxCount 1 ;
        sh:in ( pwm:RatingLow pwm:RatingMedium pwm:RatingHigh pwm:RatingCritical ) ;
        sh:message "Rate complexity, low to critical (MAS AIRG 4.12(b))." ] ;
    sh:property [ sh:path pwm:reliance ; sh:minCount 1 ; sh:maxCount 1 ;
        sh:in ( pwm:RatingLow pwm:RatingMedium pwm:RatingHigh pwm:RatingCritical ) ;
        sh:message "Rate reliance, including the autonomy granted, low to critical (MAS AIRG 4.12(c))." ] ;
    sh:property [ sh:path pwm:inherentMateriality ; sh:minCount 1 ; sh:maxCount 1 ;
        sh:message "Record materiality before controls (MAS AIRG 4.11)." ] ;
    sh:property [ sh:path pwm:residualMateriality ; sh:minCount 1 ; sh:maxCount 1 ;
        sh:message "Record materiality after controls (MAS AIRG 4.11)." ] .

# --- Agents, tools and delegated authority -------------------------------------------------

pwmsh:AIAgentShape a sh:NodeShape ;
    rdfs:label "AI agent"@en ;
    sh:targetClass pwm:AIAgent ;
    dcterms:source pwmref:MAS-AIRG , pwmref:KOG-ROADMAP ;
    sh:property [ sh:path pwm:agentIdentifier ; sh:minCount 1 ; sh:maxCount 1 ;
        sh:message "An agent has one identifier (MAS AIRG footnote 25; Kognita 0.5 item 1)." ] ;
    sh:property [ sh:path pwm:maxAutonomyLevel ; sh:minCount 1 ; sh:maxCount 1 ;
        sh:in ( pwm:L0Retrieve pwm:L1Explain pwm:L2Recommend pwm:L3Draft pwm:L4ActAfterApproval pwm:L5BoundedAutonomy pwm:L6BroadAutonomy ) ;
        sh:message "An agent carries one maximum autonomy level, L0 to L6 (Kognita 0.5 item 3)." ] ;
    sh:property [ sh:path pwm:registeredForUseCase ; sh:minCount 1 ;
        sh:message "An agent is linked to at least one registered use case (Kognita 0.5 item 1)." ] ;
    sh:property [ sh:path pwm:deploymentVersion ; sh:minCount 1 ; sh:maxCount 1 ;
        sh:message "An agent's deployment version covers prompt, tools, permissions and data sources, not only code (Kognita 0.5 item 1; MAS AIRG 5.25(b))." ] ;
    sh:property [ sh:path pwm:nextReviewDate ; sh:minCount 1 ; sh:datatype xsd:dateTime ;
        sh:message "An agent past its review date is refused, so it needs one (Kognita 0.5 item 1)." ] .

pwmsh:AgentToolLevelShape a sh:NodeShape ;
    rdfs:label "Agent tool level"@en ;
    sh:targetClass pwm:AIAgent ;
    dcterms:source pwmref:KOG-ROADMAP ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "An agent is permitted a tool that needs a higher autonomy level than the agent's maximum. A call above the agent's level is refused (Kognita 0.5 item 3)." ;
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        rdfs:comment "The level order is written into the query, so the check does not depend on the ontology's concept data being loaded with the data graph. An unknown level fails closed."@en ;
        sh:select """
            SELECT $this ?value WHERE {
                $this pwm:maxAutonomyLevel ?agentLevel ;
                      pwm:permittedTool ?value .
                ?value pwm:requiredAutonomyLevel ?toolLevel .
                BIND (IF(?agentLevel = pwm:L0Retrieve, 0, IF(?agentLevel = pwm:L1Explain, 1,
                      IF(?agentLevel = pwm:L2Recommend, 2, IF(?agentLevel = pwm:L3Draft, 3,
                      IF(?agentLevel = pwm:L4ActAfterApproval, 4, IF(?agentLevel = pwm:L5BoundedAutonomy, 5,
                      IF(?agentLevel = pwm:L6BroadAutonomy, 6, -1))))))) AS ?agentRank)
                BIND (IF(?toolLevel = pwm:L0Retrieve, 0, IF(?toolLevel = pwm:L1Explain, 1,
                      IF(?toolLevel = pwm:L2Recommend, 2, IF(?toolLevel = pwm:L3Draft, 3,
                      IF(?toolLevel = pwm:L4ActAfterApproval, 4, IF(?toolLevel = pwm:L5BoundedAutonomy, 5,
                      IF(?toolLevel = pwm:L6BroadAutonomy, 6, 99))))))) AS ?toolRank)
                FILTER (?toolRank > ?agentRank)
            }
        """ ;
    ] .

pwmsh:ToolShape a sh:NodeShape ;
    rdfs:label "Tool"@en ;
    sh:targetClass pwm:Tool ;
    dcterms:source pwmref:KOG-ROADMAP ;
    sh:property [ sh:path pwm:requiredAutonomyLevel ; sh:minCount 1 ; sh:maxCount 1 ;
        sh:message "Every tool declares the autonomy level it requires (Kognita 0.5 item 3)." ] ;
    sh:property [ sh:path pwm:actionVerb ; sh:minCount 1 ;
        sh:message "A tool declares the verbs it performs, because action permissions are per verb (Kognita 0.5 item 3)." ] .

pwmsh:DelegatedAuthorityShape a sh:NodeShape ;
    rdfs:label "Delegated authority"@en ;
    sh:targetClass pwm:DelegatedAuthority ;
    dcterms:source pwmref:KOG-ROADMAP ;
    sh:property [ sh:path pwm:delegatedBy ; sh:minCount 1 ; sh:maxCount 1 ; sh:class fibo-fnd-aap-ppl:Person ;
        sh:message "A delegation is granted by one named person (Kognita 0.5 item 2)." ] ;
    sh:property [ sh:path pwm:delegatedTo ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AIAgent ;
        sh:message "A delegation is granted to one registered agent (Kognita 0.5 item 2)." ] ;
    sh:property [ sh:path pwm:hasPurpose ; sh:minCount 1 ;
        sh:message "A delegation is bound to a purpose (Kognita 0.5 item 2)." ] ;
    sh:property [ sh:path pwm:actionVerb ; sh:minCount 1 ;
        sh:message "A delegation names the actions it allows (Kognita 0.5 item 2)." ] ;
    sh:property [ sh:path pwm:validUntil ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ;
        sh:message "A delegation must expire even when it also ends on task completion (Kognita 0.5 item 2)." ] .

# --- Client communication ------------------------------------------------------------------

pwmsh:ClientCommunicationShape a sh:NodeShape ;
    rdfs:label "Client communication"@en ;
    sh:targetClass pwm:ClientCommunication ;
    dcterms:source pwmref:KOG-ROADMAP ;
    sh:property [ sh:path pwm:derivedFromDecision ; sh:minCount 1 ;
        sh:message "A communication that does not trace back to a final decision is refused (Kognita 0.4 item 12)." ] ;
    sh:property [ sh:path pwm:communicationLevel ; sh:minCount 1 ; sh:maxCount 1 ;
        sh:message "Every communication is classified by communication level (Kognita 0.4 item 12)." ] ;
    sh:property [ sh:path pwm:contentProvenance ; sh:minCount 1 ; sh:maxCount 1 ;
        sh:message "Every communication carries its content provenance label (Kognita 0.4 item 11)." ] ;
    sh:property [ sh:path pwm:viaChannel ; sh:minCount 1 ;
        sh:node [ sh:property [ sh:path pwm:isApprovedChannel ; sh:hasValue true  ; sh:message "isApprovedChannel: required value true." ] ] ;
        sh:message "Client communication goes only through a registered, approved channel (Kognita 0.4 item 12)." ] .

pwmsh:AIDisclosureShape a sh:NodeShape ;
    rdfs:label "AI disclosure"@en ;
    rdfs:comment "Kognita's private-banking pack applies this rule in SG, HK, CH and AE. Where no disclosure rule applies, a firm can switch the shape off in its own shapes graph with sh:deactivated true."@en ;
    sh:targetClass pwm:ClientCommunication ;
    dcterms:source pwmref:KOG-PB-PACK , pwmref:MAS-AIRG ;
    sh:or (
        [ sh:property [ sh:path pwm:contentProvenance ; sh:in ( pwm:ProvenanceHuman pwm:ProvenanceHumanAIAssisted )  ; sh:message "contentProvenance: allowed values ProvenanceHuman, ProvenanceHumanAIAssisted." ] ]
        [ sh:property [ sh:path pwm:aiDisclosureGiven ; sh:hasValue true  ; sh:message "aiDisclosureGiven: required value true." ] ]
    ) ;
    sh:message "When AI generated the content, the client communication must say so (Kognita private-banking pack, client-ai-disclosure; MAS AIRG 5.6)." .

# --- Claims, facts and figures --------------------------------------------------------------

pwmsh:ClaimShape a sh:NodeShape ;
    rdfs:label "Claim"@en ;
    sh:targetClass pwm:Claim ;
    dcterms:source pwmref:KOG-ROADMAP ;
    sh:property [ sh:path pwm:claimType ; sh:minCount 1 ; sh:maxCount 1 ;
        sh:message "Unlabeled claims cannot be shown to an RM or sent to a client (Kognita 0.6 item 5)." ] ;
    sh:property [ sh:path pwm:validatorStatus ; sh:maxCount 1  ; sh:message "validatorStatus: maximum count 1." ] ;
    sh:or (
        [ sh:not [ sh:property [ sh:path pwm:claimType ; sh:hasValue pwm:VerifiedFact  ; sh:message "claimType: required value VerifiedFact." ] ] ]
        [ sh:property [ sh:path pwm:citesSource ; sh:minCount 1  ; sh:message "citesSource: minimum count 1." ] ;
          sh:property [ sh:path pwm:validatorStatus ; sh:hasValue pwm:ValidatorVerified  ; sh:message "validatorStatus: required value ValidatorVerified." ] ]
    ) ;
    sh:message "A claim typed as verified fact must cite a source and carry the validator status verified. The model's own knowledge is never a source, and an inference cannot become a fact without verification (Kognita 0.6 items 3, 5 and 7)." .

pwmsh:FactShape a sh:NodeShape ;
    rdfs:label "Fact"@en ;
    sh:targetClass pwm:Fact ;
    dcterms:source pwmref:KOG-ROADMAP ;
    sh:property [ sh:path pwm:asOf ; sh:minCount 1 ; sh:datatype xsd:dateTime ;
        sh:message "A fact carries its as-of time (Kognita 0.6 item 2)." ] ;
    sh:property [ sh:path pwm:freshnessThresholdSeconds ; sh:minCount 1 ; sh:datatype xsd:positiveInteger ;
        sh:message "A fact carries a freshness threshold (Kognita 0.6 item 2)." ] ;
    sh:property [ sh:path pwm:classification ; sh:minCount 1 ;
        sh:message "A fact carries its classification (Kognita 0.6 item 2)." ] ;
    sh:property [ sh:path prov:wasAttributedTo ; sh:minCount 1 ;
        sh:message "A fact names its source system (Kognita 0.6 item 2)." ] .

pwmsh:ValuationShape a sh:NodeShape ;
    rdfs:label "Valuation"@en ;
    sh:targetClass pwm:Valuation ;
    dcterms:source pwmref:KOG-ROADMAP ;
    sh:property [ sh:path pwm:amount ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal  ; sh:message "amount: minimum count 1; maximum count 1; datatype decimal." ] ;
    sh:property [ sh:path pwm:currency ; sh:minCount 1 ; sh:maxCount 1  ; sh:message "currency: minimum count 1; maximum count 1." ] ;
    sh:property [ sh:path pwm:asOf ; sh:minCount 1 ; sh:datatype xsd:dateTime  ; sh:message "asOf: minimum count 1; datatype dateTime." ] ;
    sh:property [ sh:path pwm:calculatedBy ; sh:minCount 1 ;
        sh:message "A figure presented as authoritative must cite a registered calculation service (Kognita 0.6 item 6)." ] .

# --- Suitability ---------------------------------------------------------------------------

pwmsh:SuitabilityAssessmentShape a sh:NodeShape ;
    rdfs:label "Suitability assessment"@en ;
    sh:targetClass pwm:SuitabilityAssessment ;
    dcterms:source pwmref:EU-MIFID2 , pwmref:EU-MIFID2-DR , pwmref:KOG-PB-PACK ;
    sh:property [ sh:path pwm:assessesRecommendation ; sh:minCount 1 ;
        sh:message "Name the recommendation being assessed." ] ;
    sh:property [ sh:path pwm:usesRiskProfile ; sh:minCount 1 ; sh:maxCount 1 ;
        sh:message "Cite the one risk profile in force when the assessment was made (MiFID II Art. 25(2); Delegated Regulation (EU) 2017/565 Art. 54)." ] ;
    sh:property [ sh:path pwm:usesMandate ; sh:minCount 1 ;
        sh:message "Check the recommendation against the recorded mandate (Kognita private-banking pack, mandate)." ] ;
    sh:property [ sh:path pwm:suitabilityOutcome ; sh:minCount 1 ; sh:maxCount 1 ;
        sh:in ( pwm:Suitable pwm:SuitableWithConditions pwm:NotSuitable pwm:InsufficientInformation )  ; sh:message "suitabilityOutcome: minimum count 1; maximum count 1; allowed values Suitable, SuitableWithConditions, NotSuitable, InsufficientInformation." ] ;
    sh:property [ sh:path pwm:rationale ; sh:minCount 1 ;
        sh:message "Record how the recommendation meets the client's objectives and characteristics, not a bare score (MiFID II Art. 25(6))." ] ;
    sh:property [ sh:path prov:wasAttributedTo ; sh:minCount 1 ;
        sh:message "Record who made the assessment." ] .

pwmsh:InvestorRiskProfileShape a sh:NodeShape ;
    rdfs:label "Investor risk profile"@en ;
    sh:targetClass pwm:InvestorRiskProfile ;
    dcterms:source pwmref:EU-MIFID2-DR ;
    sh:property [ sh:path pwm:riskProfileLevel ; sh:minCount 1 ; sh:maxCount 1  ; sh:message "riskProfileLevel: minimum count 1; maximum count 1." ] ;
    sh:property [ sh:path pwm:validFrom ; sh:minCount 1 ; sh:datatype xsd:dateTime  ; sh:message "validFrom: minimum count 1; datatype dateTime." ] ;
    sh:property [ sh:path prov:wasAttributedTo ; sh:minCount 1  ; sh:message "wasAttributedTo: minimum count 1." ] .

pwmsh:InvestorClassificationShape a sh:NodeShape ;
    rdfs:label "Investor classification"@en ;
    sh:targetClass pwm:InvestorClassification ;
    dcterms:source pwmref:SG-SFA , pwmref:CH-FINSA , pwmref:EU-MIFID2 ;
    sh:property [ sh:path pwm:investorCategory ; sh:minCount 1 ; sh:maxCount 1  ; sh:message "investorCategory: minimum count 1; maximum count 1." ] ;
    sh:property [ sh:path pwm:jurisdictionCode ; sh:minCount 1 ; sh:maxCount 1 ;
        sh:message "A classification is made under one jurisdiction's rules." ] ;
    sh:property [ sh:path pwm:optStatus ; sh:maxCount 1  ; sh:message "optStatus: maximum count 1." ] .

# --- Information governance and evidence ---------------------------------------------------

pwmsh:GovernedInformationAssetShape a sh:NodeShape ;
    rdfs:label "Governed information asset"@en ;
    sh:targetClass pwm:GovernedInformationAsset ;
    dcterms:source pwmref:AM-FILING-CABINET ;
    sh:property [ sh:path pwm:informationOwner ; sh:minCount 1 ; sh:message "Minimum label: owner (Filing Cabinet, slide 8)." ] ;
    sh:property [ sh:path pwm:approvalStatus ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "Minimum label: approval status (Filing Cabinet, slide 8)." ] ;
    sh:property [ sh:path pwm:validFrom ; sh:minCount 1 ; sh:message "Minimum label: effective date (Filing Cabinet, slide 8)." ] ;
    sh:property [ sh:path pwm:retentionUntil ; sh:minCount 1 ; sh:message "Minimum label: retention date (Filing Cabinet, slide 8)." ] ;
    sh:or (
        [ sh:property [ sh:path pwm:versionId ; sh:minCount 1  ; sh:message "versionId: minimum count 1." ] ]
        [ sh:property [ sh:path pwm:contentHash ; sh:minCount 1  ; sh:message "contentHash: minimum count 1." ] ]
    ) ;
    sh:message "Minimum label: version identifier or content hash (Filing Cabinet, slide 8)." .

pwmsh:DocumentSectionShape a sh:NodeShape ;
    rdfs:label "Document section"@en ;
    sh:targetClass pwm:DocumentSection ;
    dcterms:source pwmref:AM-FILING-CABINET ;
    sh:property [ sh:path pwm:classification ; sh:minCount 1 ; sh:maxCount 1 ;
        sh:message "Classify per section, not per document (Filing Cabinet, slide 8)." ] .

pwmsh:PolicyRuleShape a sh:NodeShape ;
    rdfs:label "Policy rule"@en ;
    sh:targetClass pwm:PolicyRule ;
    dcterms:source pwmref:KOG-ROADMAP ;
    sh:property [ sh:path pwm:ruleCitation ; sh:minCount 1 ;
        sh:message "Every rule carries a citation to what it implements (Kognita 0.4 item 3)." ] ;
    sh:property [ sh:path pwm:validFrom ; sh:minCount 1 ;
        sh:message "Rules are effective-dated (Kognita 0.3 item 7)." ] ;
    sh:property [ sh:path pwm:versionId ; sh:minCount 1 ;
        sh:message "A change to a rule is a new version, never an edit in place (Kognita 0.3 item 7)." ] .

pwmsh:CrossBorderRuleShape a sh:NodeShape ;
    rdfs:label "Cross-border rule"@en ;
    sh:targetClass pwm:CrossBorderRule ;
    dcterms:source pwmref:KOG-PB-PACK ;
    sh:property [ sh:path pwm:appliesToActivity ; sh:minCount 1  ; sh:message "appliesToActivity: minimum count 1." ] ;
    sh:property [ sh:path pwm:permitted ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean  ; sh:message "permitted: minimum count 1; maximum count 1; datatype boolean." ] ;
    sh:property [ sh:path pwm:clientDomicileCode ; sh:minCount 1 ; sh:pattern "^[A-Z]{2}$" ;
        sh:message "Client domicile is an ISO 3166-1 alpha-2 code." ] ;
    sh:property [ sh:path pwm:bookingCenterCode ; sh:minCount 1 ; sh:pattern "^[A-Z]{2}$" ;
        sh:message "Booking center is an ISO 3166-1 alpha-2 code." ] .

pwmsh:PolicyDecisionShape a sh:NodeShape ;
    rdfs:label "Policy decision"@en ;
    sh:targetClass pwm:PolicyDecision ;
    sh:property [ sh:path prov:generatedAtTime ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:pattern "(Z|[+-][0-9]{2}:[0-9]{2})$" ; sh:message "Record exactly one decision timestamp with an explicit timezone (Z or an offset)." ] ;
    dcterms:source pwmref:KOG-ROADMAP , pwmref:AM-FILING-CABINET ;
    sh:property [ sh:path pwm:decisionOutcome ; sh:minCount 1 ; sh:maxCount 1 ;
        sh:in ( pwm:OutcomeDeny pwm:OutcomeEscalate pwm:OutcomeHumanApproval pwm:OutcomeAllow pwm:OutcomeObserve )  ; sh:message "decisionOutcome: minimum count 1; maximum count 1; allowed values OutcomeDeny, OutcomeEscalate, OutcomeHumanApproval, OutcomeAllow, OutcomeObserve." ] ;
    sh:property [ sh:path pwm:decidedByRule ; sh:minCount 1 ;
        sh:message "Every decision names the rule and rule version that decided it (Filing Cabinet, slide 14)." ] ;
    sh:property [ sh:path pwm:underUseCase ; sh:minCount 1 ;
        sh:message "Every decision references a registered use case (Kognita 0.4 item 8)." ] .

pwmsh:EvidenceRecordShape a sh:NodeShape ;
    rdfs:label "Evidence record"@en ;
    sh:targetClass pwm:EvidenceRecord ;
    dcterms:source pwmref:KOG-CONTROLS , pwmref:MAS-AIRG ;
    sh:property [ sh:path pwm:eventType ; sh:minCount 1 ; sh:maxCount 1  ; sh:message "eventType: minimum count 1; maximum count 1." ] ;
    sh:property [ sh:path pwm:recordHash ; sh:minCount 1 ; sh:maxCount 1 ;
        sh:message "Evidence records are hash-chained (Kognita control frameworks)." ] ;
    sh:property [ sh:path prov:generatedAtTime ; sh:minCount 1 ; sh:datatype xsd:dateTime ;
        sh:message "An evidence record states when the event happened (MAS AIRG 5.23(d))." ] ;
    sh:property [ sh:path pwm:previousRecordHash ; sh:maxCount 1  ; sh:message "previousRecordHash: maximum count 1." ] ;
    sh:xone (
        [ sh:property [ sh:path pwm:previousRecordHash ; sh:minCount 1  ; sh:message "previousRecordHash: minimum count 1." ] ]
        [ sh:property [ sh:path pwm:chainStart ; sh:hasValue true  ; sh:message "chainStart: required value true." ] ]
    ) ;
    sh:message "Every evidence record names the hash of the record before it, except the first record of a chain, which is marked chain start (Kognita control frameworks: hash-chained evidence)." .

# --- Identifier and code formats (ISO) -----------------------------------------------------

pwmsh:CurrencyCodeShape a sh:NodeShape ;
    rdfs:label "Currency code"@en ;
    sh:targetSubjectsOf pwm:currency ;
    dcterms:source pwmref:ISO-4217 ;
    sh:property [ sh:path pwm:currency ; sh:pattern "^[A-Z]{3}$" ;
        sh:message "Currency is an ISO 4217 alphabetic code, such as SGD." ] .

pwmsh:CountryCodeShape a sh:NodeShape ;
    rdfs:label "Country code"@en ;
    sh:targetSubjectsOf pwm:residenceCountry , pwm:domicileCountry , pwm:nationalityCountry , pwm:jurisdictionCode , pwm:taxResidenceCountry ;
    dcterms:source pwmref:ISO-3166 ;
    sh:property [ sh:path pwm:residenceCountry ; sh:pattern "^[A-Z]{2}$" ; sh:message "Residence is an ISO 3166-1 alpha-2 code, such as SG." ] ;
    sh:property [ sh:path pwm:domicileCountry ; sh:pattern "^[A-Z]{2}$" ; sh:message "Domicile is an ISO 3166-1 alpha-2 code, such as SG." ] ;
    sh:property [ sh:path pwm:nationalityCountry ; sh:pattern "^[A-Z]{2}$" ; sh:message "Nationality is an ISO 3166-1 alpha-2 code, such as SG." ] ;
    sh:property [ sh:path pwm:jurisdictionCode ; sh:pattern "^[A-Z]{2}$" ; sh:message "Jurisdiction is an ISO 3166-1 alpha-2 code, such as SG." ] ;
    sh:property [ sh:path pwm:taxResidenceCountry ; sh:pattern "^[A-Z]{2}$" ; sh:message "Tax residence is an ISO 3166-1 alpha-2 code, such as SG." ] .

pwmsh:LEIShape a sh:NodeShape ;
    rdfs:label "Legal Entity Identifier"@en ;
    sh:targetSubjectsOf pwm:legalEntityIdentifier ;
    dcterms:source pwmref:ISO-17442 ;
    sh:property [ sh:path pwm:legalEntityIdentifier ; sh:pattern "^[A-Z0-9]{18}[0-9]{2}$" ;
        sh:message "An LEI is 18 letters or digits followed by two check digits (ISO 17442)." ] .

pwmsh:ISINShape a sh:NodeShape ;
    rdfs:label "ISIN"@en ;
    sh:targetSubjectsOf pwm:isin ;
    dcterms:source pwmref:ISO-6166 ;
    sh:property [ sh:path pwm:isin ; sh:pattern "^[A-Z]{2}[A-Z0-9]{9}[0-9]$" ;
        sh:message "An ISIN is a two-letter prefix, nine letters or digits and a check digit (ISO 6166)." ] .

pwmsh:CFIShape a sh:NodeShape ;
    rdfs:label "CFI code"@en ;
    sh:targetSubjectsOf pwm:cfiCode ;
    dcterms:source pwmref:ISO-10962 ;
    sh:property [ sh:path pwm:cfiCode ; sh:pattern "^[A-Z]{6}$" ;
        sh:message "A CFI code is six letters (ISO 10962)." ] .


# Article 54 is jurisdiction-specific. A firm records EU applicability explicitly.
pwmsh:EUSustainabilityAssessmentShape a sh:NodeShape ;
    rdfs:label "EU sustainability assessment"@en ;
    sh:targetClass pwm:SuitabilityAssessment ;
    dcterms:source pwmref:EU-SUSTAINABILITY ;
    sh:or (
        [ sh:not [ sh:property [ sh:path pwm:jurisdictionCode ; sh:hasValue "EU"  ; sh:message "jurisdictionCode: required value EU." ] ] ]
        [ sh:property [ sh:path pwm:usesSustainabilityPreference ; sh:minCount 1 ; sh:maxCount 1 ;
            sh:class pwm:SustainabilityPreference  ; sh:message "usesSustainabilityPreference: minimum count 1; maximum count 1; class SustainabilityPreference." ] ]
    ) ;
    sh:message "EU suitability cites one recorded sustainability preference, including explicit no preference (2017/565 Art. 54(2)(a), (5), as amended by 2021/1253 Art. 1(6))." .

pwmsh:SustainabilityPreferenceShape a sh:NodeShape ;
    rdfs:label "Sustainability preference"@en ;
    sh:targetClass pwm:SustainabilityPreference ;
    dcterms:source pwmref:EU-SUSTAINABILITY ;
    sh:property [ sh:path pwm:sustainabilityPreferenceKind ; sh:minCount 1  ; sh:message "sustainabilityPreferenceKind: minimum count 1." ] ;
    sh:property [ sh:path pwm:minimumTaxonomyAlignedProportion ; sh:maxCount 1 ;
        sh:datatype xsd:decimal ; sh:minInclusive 0.0 ; sh:maxInclusive 1.0  ; sh:message "minimumTaxonomyAlignedProportion: maximum count 1; datatype decimal; minimum inclusive 0.0; maximum inclusive 1.0." ] ;
    sh:property [ sh:path pwm:minimumSFDRSustainableProportion ; sh:maxCount 1 ;
        sh:datatype xsd:decimal ; sh:minInclusive 0.0 ; sh:maxInclusive 1.0  ; sh:message "minimumSFDRSustainableProportion: maximum count 1; datatype decimal; minimum inclusive 0.0; maximum inclusive 1.0." ] ;
    sh:property [ sh:path pwm:paiConsiderationElements ; sh:datatype xsd:string ; sh:minLength 1  ; sh:message "paiConsiderationElements: datatype string." ] ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:message "Record the minimum proportion for each selected category and client-determined PAI elements; no preference is exclusive and has no category details (2017/565 Art. 2(7)(a)-(c))." ;
        sh:select """
          SELECT $this WHERE {
            FILTER (
              (EXISTS { $this pwm:sustainabilityPreferenceKind pwm:TaxonomyAlignedMinimum }
               != EXISTS { $this pwm:minimumTaxonomyAlignedProportion ?tax }) ||
              (EXISTS { $this pwm:sustainabilityPreferenceKind pwm:SFDRSustainableMinimum }
               != EXISTS { $this pwm:minimumSFDRSustainableProportion ?sfdr }) ||
              (EXISTS { $this pwm:sustainabilityPreferenceKind pwm:PAIConsideration }
               != EXISTS { $this pwm:paiConsiderationElements ?pai }) ||
              (EXISTS { $this pwm:sustainabilityPreferenceKind pwm:NoSustainabilityPreference }
               && EXISTS { $this pwm:sustainabilityPreferenceKind ?other .
                           FILTER (?other != pwm:NoSustainabilityPreference) })
            )
          }
        """
    ] .

pwmsh:RunShape a sh:NodeShape ; rdfs:label "RunShape"@en ; sh:targetClass pwm:Run ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.3 item 1."@en ;
    sh:property [ sh:path pwm:hasBudget ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:RunBudget ; sh:message "Record hasBudget (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:runState ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "Record runState (roadmap milestone 0.3)." ] ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:message "A resumed run must have a resumption referencing a resolved approval (0.3 item 2)." ;
        sh:select """SELECT $this WHERE {
          $this pwm:runState pwm:RunResumed . FILTER NOT EXISTS {
            ?resumption a pwm:RunResumption ; pwm:inRun $this ; pwm:resolvedApproval ?resolution .
            ?resolution pwm:approvalResolution ?result .
            FILTER (?result IN (pwm:ApprovalApproved,pwm:ApprovalDenied))
          }
        }""" ] .


pwmsh:RunBudgetShape a sh:NodeShape ; rdfs:label "RunBudgetShape"@en ; sh:targetClass pwm:RunBudget ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.3 item 1."@en ;
    sh:property [ sh:path pwm:maxCalls ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "Record maxCalls (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:maxTokens ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "Record maxTokens (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:maxCostUSD ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:minInclusive 0.0 ; sh:message "Record maxCostUSD (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:wallClockSeconds ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:minInclusive 0.0 ; sh:message "Record wallClockSeconds (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:consumedCalls ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "Record consumedCalls (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:consumedTokens ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "Record consumedTokens (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:consumedCostUSD ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:minInclusive 0.0 ; sh:message "Record consumedCostUSD (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:elapsedSeconds ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:minInclusive 0.0 ; sh:message "Record elapsedSeconds (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:classificationCeiling ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "Record classificationCeiling (roadmap milestone 0.3)." ] .


pwmsh:BudgetExceededDenialShape a sh:NodeShape ; rdfs:label "BudgetExceededDenialShape"@en ; sh:targetClass pwm:BudgetExceededDenial ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.3 item 1."@en ;
    sh:property [ sh:path pwm:exceededBudget ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:RunBudget ; sh:message "Record exceededBudget (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:budgetDimension ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record budgetDimension (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:decisionOutcome ; sh:hasValue pwm:OutcomeDeny  ; sh:message "decisionOutcome: required value OutcomeDeny." ] .


pwmsh:CheckpointShape a sh:NodeShape ; rdfs:label "CheckpointShape"@en ; sh:targetClass pwm:RunCheckpoint ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.3 item 2."@en ;
    sh:property [ sh:path pwm:inRun ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:Run ; sh:message "Record inRun (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:contentHash ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record contentHash (roadmap milestone 0.3)." ] .


pwmsh:ApprovalRequestShape a sh:NodeShape ; rdfs:label "ApprovalRequestShape"@en ; sh:targetClass pwm:ApprovalRequest ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.3 item 2."@en ;
    sh:property [ sh:path pwm:requestsDecision ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:PolicyDecision ; sh:message "Record requestsDecision (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:atCheckpoint ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:RunCheckpoint ; sh:message "Record atCheckpoint (roadmap milestone 0.3)." ] .


pwmsh:ApprovalResolutionShape a sh:NodeShape ; rdfs:label "ApprovalResolutionShape"@en ; sh:targetClass pwm:ApprovalResolution ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.3 item 2."@en ;
    sh:property [ sh:path pwm:resolvesApproval ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:ApprovalRequest ; sh:message "Record resolvesApproval (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:approvalResolution ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "Record approvalResolution (roadmap milestone 0.3)." ] ; sh:property [ sh:path prov:wasAttributedTo ; sh:minCount 1 ; sh:maxCount 1 ; sh:class fibo-fnd-aap-ppl:Person  ; sh:message "wasAttributedTo: minimum count 1; maximum count 1; class Person." ] ; sh:property [ sh:path prov:generatedAtTime ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime  ; sh:message "generatedAtTime: minimum count 1; maximum count 1; datatype dateTime." ] .


pwmsh:RunResumptionShape a sh:NodeShape ; rdfs:label "RunResumptionShape"@en ; sh:targetClass pwm:RunResumption ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.3 item 2."@en ;
    sh:property [ sh:path pwm:inRun ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:Run ; sh:message "Record inRun (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:resumedFrom ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:RunCheckpoint ; sh:message "Record resumedFrom (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:resolvedApproval ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:ApprovalResolution ; sh:message "Record resolvedApproval (roadmap milestone 0.3)." ] ; sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Resumption must cite a resolved approval for its run checkpoint (0.3 item 2)." ; sh:select """SELECT DISTINCT $this WHERE { $this pwm:inRun ?run ; pwm:resumedFrom ?cp ; pwm:resolvedApproval ?resolution . FILTER NOT EXISTS { ?cp pwm:inRun ?run . ?resolution pwm:resolvesApproval ?request ; pwm:approvalResolution ?result . ?request pwm:atCheckpoint ?cp . FILTER (?result IN (pwm:ApprovalApproved, pwm:ApprovalDenied)) } }""" ] .


pwmsh:ModelCallShape a sh:NodeShape ; rdfs:label "ModelCallShape"@en ; sh:targetClass pwm:ModelCall ;
    sh:property [ sh:path pwm:usesModel ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AIModel ; sh:message "Record usesModel (Kognita 0.4 item 8)." ] ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.3 item 7."@en ;
    sh:property [ sh:path pwm:modelName ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record modelName (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:modelVersion ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record modelVersion (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:promptTemplateVersion ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record promptTemplateVersion (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:promptHash ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record promptHash (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:responseHash ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record responseHash (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:providedBy ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:ModelProvider ; sh:message "Record providedBy (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:inputTokens ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "Record inputTokens (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:outputTokens ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "Record outputTokens (roadmap milestone 0.3)." ] .


pwmsh:ToolCallShape a sh:NodeShape ; rdfs:label "ToolCallShape"@en ; sh:targetClass pwm:ToolCall ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.3 item 7."@en ;
    sh:property [ sh:path pwm:responseHash ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record responseHash (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:invokedTool ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:Tool ; sh:message "Record invokedTool (roadmap milestone 0.3)." ] .


pwmsh:MCPProxiedCallShape a sh:NodeShape ; rdfs:label "MCPProxiedCallShape"@en ; sh:targetClass pwm:MCPProxiedCall ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.3 item 5."@en ;
    sh:property [ sh:path pwm:mcpBackend ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record mcpBackend (roadmap milestone 0.3)." ] .


pwmsh:ClassifierOutputShape a sh:NodeShape ; rdfs:label "ClassifierOutputShape"@en ; sh:targetClass pwm:ClassifierOutput ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.3 item 4."@en ;
    sh:property [ sh:path pwm:classifierModelId ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record classifierModelId (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:classifierVersion ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record classifierVersion (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:classifierLabel ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record classifierLabel (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:inputHash ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record inputHash (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:confidence ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:minInclusive 0.0 ; sh:maxInclusive 1.0 ; sh:message "Record confidence (roadmap milestone 0.3)." ] .


pwmsh:EnvelopeAttributeShape a sh:NodeShape ; rdfs:label "EnvelopeAttributeShape"@en ; sh:targetClass pwm:EnvelopeAttribute ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.3 item 4."@en ;
    sh:property [ sh:path pwm:attributeName ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record attributeName (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:attributeValue ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record attributeValue (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:attributeSource ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "Record attributeSource (roadmap milestone 0.3)." ] ; sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Classifier-derived attribute needs calibrated confidence and classifier version (0.3 item 4)." ; sh:select """SELECT DISTINCT $this WHERE { $this pwm:attributeSource pwm:AttributeClassifierDerived . FILTER NOT EXISTS { $this pwm:derivedFromClassifier ?c . ?c pwm:confidence ?confidence ; pwm:classifierVersion ?version } }""" ] ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
      sh:message "Identity attributes come from authentication, never classifier text (0.3 item 4 and Tier 0)." ;
      sh:select """SELECT $this WHERE { $this pwm:attributeSource pwm:AttributeClassifierDerived ; pwm:attributeName ?name .
        FILTER (?name IN ("principal", "agent", "agent_name", "system_trigger", "client_configuration")) }""" ] .

pwmsh:ClassifierThresholdShape a sh:NodeShape ; rdfs:label "ClassifierThresholdShape"@en ; sh:targetSubjectsOf pwm:hasAttribute , pwm:escalationThreshold ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.3 item 4."@en ;
    sh:property [ sh:path pwm:escalationThreshold ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:minInclusive 0.0 ; sh:maxInclusive 1.0  ; sh:message "escalationThreshold: maximum count 1; datatype decimal; minimum inclusive 0.0; maximum inclusive 1.0." ] ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Below-threshold or missing-threshold classifier evidence cannot yield ALLOW (0.3 item 4)." ; sh:select """SELECT DISTINCT $this WHERE { { $this pwm:decisionOutcome pwm:OutcomeAllow . BIND($this AS ?decision) } UNION { $this pwm:governedByDecision ?decision . ?decision pwm:decisionOutcome pwm:OutcomeAllow } $this pwm:hasAttribute ?a . ?a pwm:attributeSource pwm:AttributeClassifierDerived ; pwm:derivedFromClassifier ?c . ?c pwm:confidence ?confidence . FILTER NOT EXISTS { ?decision pwm:escalationThreshold ?t . FILTER (?confidence >= ?t) } }""" ] ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
      sh:message "Classifier fills gaps only; a typed attribute remains authoritative (0.3 item 4)." ;
      sh:select """SELECT DISTINCT $this WHERE {
        $this pwm:hasAttribute ?typed, ?derived .
        ?typed pwm:attributeSource pwm:AttributeTyped ; pwm:attributeName ?name .
        ?derived pwm:attributeSource pwm:AttributeClassifierDerived ; pwm:attributeName ?name .
      }""" ] .

pwmsh:PolicyCheckShape a sh:NodeShape ; rdfs:label "PolicyCheckShape"@en ; sh:targetClass pwm:PolicyCheck ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.3 item 7."@en ;
    sh:property [ sh:path pwm:checkedRule ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:PolicyRule ; sh:message "Record checkedRule (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:policyContentHash ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record policyContentHash (roadmap milestone 0.3)." ] .


pwmsh:RetrievedItemShape a sh:NodeShape ; rdfs:label "RetrievedItemShape"@en ; sh:targetClass pwm:RetrievedItem ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.3 item 7."@en ;
    sh:property [ sh:path pwm:contentHash ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record contentHash (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:embeddingModel ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record embeddingModel (roadmap milestone 0.3)." ] .


pwmsh:RetentionEntryShape a sh:NodeShape ; rdfs:label "RetentionEntryShape"@en ; sh:targetClass pwm:RetentionEntry ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.3 item 7."@en ;
    sh:property [ sh:path pwm:contentHash ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record contentHash (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:underUseCase ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AIUseCase ; sh:message "Record underUseCase (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:storeLocator ; sh:maxCount 1 ; sh:datatype xsd:anyURI  ; sh:message "storeLocator: maximum count 1; datatype anyURI." ] .


pwmsh:RetentionPolicyShape a sh:NodeShape ; rdfs:label "RetentionPolicyShape"@en ; sh:targetClass pwm:RetentionPolicy ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.3 item 7."@en ;
    sh:property [ sh:path pwm:retentionDuration ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "Record retentionDuration (roadmap milestone 0.3)." ] .


pwmsh:ErasureShape a sh:NodeShape ; rdfs:label "ErasureShape"@en ; sh:targetClass pwm:ErasureEvent ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.3 item 7."@en ;
    sh:property [ sh:path pwm:erasedEntry ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:RetentionEntry ; sh:message "Record erasedEntry (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:contentHash ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record contentHash (roadmap milestone 0.3)." ] ; sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Erasure removes stored content reference and keeps the same hash on the entry, event and surviving chain evidence (0.3 item 7)." ; sh:select """SELECT DISTINCT $this WHERE { $this pwm:erasedEntry ?entry ; pwm:contentHash ?hash . FILTER NOT EXISTS { ?entry pwm:contentHash ?hash ; pwm:erased true . FILTER NOT EXISTS { ?entry pwm:storeLocator ?locator } ?e pwm:evidenceFor $this ; pwm:eventType pwm:EventErasure ; pwm:contentHash ?hash ; pwm:recordHash ?recordHash } }""" ] .


pwmsh:ReconstructionReportShape a sh:NodeShape ; rdfs:label "ReconstructionReportShape"@en ; sh:targetClass pwm:ReconstructionReport ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.3 item 8."@en ;
    sh:property [ sh:path pwm:partOfInteraction ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:ClientInteraction ; sh:message "Record partOfInteraction (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:chainVerified ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "Record chainVerified (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:pinnedHashesVerified ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "Record pinnedHashesVerified (roadmap milestone 0.3)." ] ; sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Cover all ten questions explicitly, marking absent evidence not recorded (0.3 item 8)." ; sh:select """SELECT DISTINCT $this WHERE { FILTER (NOT EXISTS { $this pwm:questionCoverage ?coverage . ?coverage pwm:reconstructionQuestion pwm:QuestionWhyClient ; pwm:coverageStatus ?status . FILTER (?status IN (pwm:QuestionAnswered,pwm:QuestionNotRecorded)) } || NOT EXISTS { $this pwm:questionCoverage ?coverage . ?coverage pwm:reconstructionQuestion pwm:QuestionWhyProduct ; pwm:coverageStatus ?status . FILTER (?status IN (pwm:QuestionAnswered,pwm:QuestionNotRecorded)) } || NOT EXISTS { $this pwm:questionCoverage ?coverage . ?coverage pwm:reconstructionQuestion pwm:QuestionInformation ; pwm:coverageStatus ?status . FILTER (?status IN (pwm:QuestionAnswered,pwm:QuestionNotRecorded)) } || NOT EXISTS { $this pwm:questionCoverage ?coverage . ?coverage pwm:reconstructionQuestion pwm:QuestionModelAgent ; pwm:coverageStatus ?status . FILTER (?status IN (pwm:QuestionAnswered,pwm:QuestionNotRecorded)) } || NOT EXISTS { $this pwm:questionCoverage ?coverage . ?coverage pwm:reconstructionQuestion pwm:QuestionAuthority ; pwm:coverageStatus ?status . FILTER (?status IN (pwm:QuestionAnswered,pwm:QuestionNotRecorded)) } || NOT EXISTS { $this pwm:questionCoverage ?coverage . ?coverage pwm:reconstructionQuestion pwm:QuestionControls ; pwm:coverageStatus ?status . FILTER (?status IN (pwm:QuestionAnswered,pwm:QuestionNotRecorded)) } || NOT EXISTS { $this pwm:questionCoverage ?coverage . ?coverage pwm:reconstructionQuestion pwm:QuestionRMChanges ; pwm:coverageStatus ?status . FILTER (?status IN (pwm:QuestionAnswered,pwm:QuestionNotRecorded)) } || NOT EXISTS { $this pwm:questionCoverage ?coverage . ?coverage pwm:reconstructionQuestion pwm:QuestionFinalDecision ; pwm:coverageStatus ?status . FILTER (?status IN (pwm:QuestionAnswered,pwm:QuestionNotRecorded)) } || NOT EXISTS { $this pwm:questionCoverage ?coverage . ?coverage pwm:reconstructionQuestion pwm:QuestionCommunication ; pwm:coverageStatus ?status . FILTER (?status IN (pwm:QuestionAnswered,pwm:QuestionNotRecorded)) } || NOT EXISTS { $this pwm:questionCoverage ?coverage . ?coverage pwm:reconstructionQuestion pwm:QuestionReproduction ; pwm:coverageStatus ?status . FILTER (?status IN (pwm:QuestionAnswered,pwm:QuestionNotRecorded)) }) }""" ] ; sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Report hash mismatches as findings (0.3 item 8)." ; sh:select """SELECT DISTINCT $this WHERE { $this pwm:pinnedHashesVerified false . FILTER NOT EXISTS { $this pwm:hasFinding ?finding . ?finding pwm:findingKind "hash_mismatch" } }""" ] .


pwmsh:QuestionCoverageShape a sh:NodeShape ; rdfs:label "QuestionCoverageShape"@en ; sh:targetClass pwm:QuestionCoverage ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.3 item 8."@en ;
    sh:property [ sh:path pwm:reconstructionQuestion ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "Record reconstructionQuestion (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:coverageStatus ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "Record coverageStatus (roadmap milestone 0.3)." ] ; sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Answered question must cite recorded evidence (0.3 item 8)." ; sh:select """SELECT DISTINCT $this WHERE { $this pwm:coverageStatus pwm:QuestionAnswered . FILTER NOT EXISTS { $this pwm:citesSource ?source } }""" ] .


pwmsh:ReconstructionFindingShape a sh:NodeShape ; rdfs:label "ReconstructionFindingShape"@en ; sh:targetClass pwm:ReconstructionFinding ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.3 item 8."@en ;
    sh:property [ sh:path pwm:findingKind ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record findingKind (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:findingRecord ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "Record findingRecord (roadmap milestone 0.3)." ] ; sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Hash mismatch finding records different expected and observed hashes (0.3 item 8)." ; sh:select """SELECT DISTINCT $this WHERE { $this pwm:findingKind "hash_mismatch" . FILTER NOT EXISTS { $this pwm:expectedHash ?expected ; pwm:observedHash ?observed . FILTER (?expected != ?observed) } }""" ] .


pwmsh:GatewayConfigurationShape a sh:NodeShape ; rdfs:label "GatewayConfigurationShape"@en ; sh:targetClass pwm:AIUseCase ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.3 item 9."@en ;
    sh:property [ sh:path pwm:gatewayFailureMode ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "Record gatewayFailureMode (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:retentionPolicy ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:RetentionPolicy  ; sh:message "retentionPolicy: minimum count 1; maximum count 1; class RetentionPolicy." ] .


pwmsh:GovernedCallShape a sh:NodeShape ; rdfs:label "GovernedCallShape"@en ; sh:targetClass pwm:GovernedCall ;
    dcterms:source pwmref:KOG-ROADMAP , pwmref:MAS-AIRG ;
    rdfs:comment "Roadmap milestone 0.3 items 2 and 3; MAS AIRG 5.9 human oversight."@en ;
    sh:property [ sh:path pwm:callAgent ; sh:maxCount 1  ; sh:message "callAgent: maximum count 1." ] ;
    sh:property [ sh:path pwm:systemTrigger ; sh:maxCount 1  ; sh:message "systemTrigger: maximum count 1." ] ;
    sh:property [ sh:path pwm:inRun ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:Run ; sh:message "Record inRun (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:governedByDecision ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:PolicyDecision ; sh:message "Record governedByDecision (roadmap milestone 0.3)." ] ; sh:property [ sh:path pwm:clientConfiguration ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AuthenticatedClientConfiguration ; sh:message "Record clientConfiguration (roadmap milestone 0.3)." ] ; sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Call identity must be an agent bound to the authenticated client or a listed system trigger (0.3 Tier 0)." ; sh:select """SELECT DISTINCT $this WHERE { $this pwm:clientConfiguration ?config . FILTER NOT EXISTS { { $this pwm:callAgent ?agent . ?config pwm:boundAgent ?agent . FILTER NOT EXISTS { $this pwm:systemTrigger ?trigger } } UNION { $this pwm:systemTrigger ?trigger . ?config pwm:listedTrigger ?trigger . FILTER NOT EXISTS { $this pwm:callAgent ?agent } } } }""" ] ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:message "A call governed by a held decision requires that decision in the same run and an ApprovalRequest at a checkpoint in the call's run with an ApprovalApproved resolution (KOG roadmap 0.3 item 2; MAS AIRG 5.9)." ;
        sh:select """SELECT DISTINCT $this WHERE {
          $this pwm:inRun ?run ; pwm:governedByDecision ?decision .
          ?decision pwm:decisionOutcome pwm:OutcomeHumanApproval .
          FILTER NOT EXISTS {
            ?decision pwm:inRun ?run .
            ?request a pwm:ApprovalRequest ; pwm:requestsDecision ?decision ; pwm:atCheckpoint ?checkpoint .
            ?checkpoint pwm:inRun ?run .
            ?approved pwm:resolvesApproval ?request ; pwm:approvalResolution pwm:ApprovalApproved .
          }
        }""" ] .

# Pin each decision's component checks, including checks on denied requests.
pwmsh:PinnedDecisionShape a sh:NodeShape ;
    rdfs:label "Pinned decision checks"@en ; sh:targetClass pwm:PolicyDecision ;
    dcterms:source pwmref:KOG-ROADMAP , pwmref:MAS-AIRG ;
    rdfs:comment "Roadmap milestone 0.3 item 7; MAS AIRG 5.23(d) record keeping."@en ;
    sh:property [ sh:path pwm:hasCheck ; sh:minCount 1 ; sh:class pwm:PolicyCheck ;
        sh:message "Every policy decision carries pinned component checks (0.3 item 7)." ] .

pwmsh:SuspendedApprovalShape a sh:NodeShape ;
    rdfs:label "Approval checkpoint consistency"@en ; sh:targetClass pwm:ApprovalRequest ;
    dcterms:source pwmref:KOG-ROADMAP , pwmref:MAS-AIRG ;
    rdfs:comment "Roadmap milestone 0.3 item 2; MAS AIRG 5.9 human oversight."@en ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:message "An approval request holds a HUMAN_APPROVAL decision at a suspended checkpoint of the same run (0.3 item 2)." ;
        sh:select """SELECT DISTINCT $this WHERE {
          $this pwm:requestsDecision ?decision ; pwm:atCheckpoint ?checkpoint .
          FILTER NOT EXISTS {
            ?decision pwm:decisionOutcome pwm:OutcomeHumanApproval ; pwm:inRun ?run .
            ?checkpoint pwm:inRun ?run ; pwm:runState pwm:RunSuspended .
          }
        }""" ] .

pwmsh:IngestedDocumentShape a sh:NodeShape ; rdfs:label "IngestedDocumentShape"@en ; sh:targetClass pwm:IngestedDocument ; dcterms:source pwmref:KOG-ROADMAP ;
    sh:property [ sh:path pwm:parserName ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record parserName (Kognita 0.4 item 1)." ] ;
    sh:property [ sh:path pwm:parserVersion ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record parserVersion (Kognita 0.4 item 1)." ] ;
    sh:property [ sh:path pwm:contentHash ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record contentHash (Kognita 0.4 item 1)." ] .

pwmsh:DocumentElementShape a sh:NodeShape ; rdfs:label "DocumentElementShape"@en ; sh:targetClass pwm:DocumentElement ; dcterms:source pwmref:KOG-ROADMAP ;
    sh:property [ sh:path pwm:ingestedFrom ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:IngestedDocument ; sh:message "Record ingestedFrom (Kognita 0.4 item 1)." ] ;
    sh:property [ sh:path pwm:pageNumber ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:positiveInteger ; sh:message "Record pageNumber (Kognita 0.4 item 1)." ] ;
    sh:property [ sh:path pwm:sectionPath ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:minLength 1 ; sh:message "Record sectionPath (Kognita 0.4 item 1)." ] ;
    sh:property [ sh:path pwm:characterStart ; sh:lessThan pwm:characterEnd ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "Record characterStart (Kognita 0.4 item 1)." ] ;
    sh:property [ sh:path pwm:characterEnd ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "Record characterEnd (Kognita 0.4 item 1)." ] ;
    sh:property [ sh:path pwm:classification ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "Record classification (Kognita 0.4 item 1)." ] ;
    sh:property [ sh:path pwm:contentHash ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record contentHash (Kognita 0.4 item 1)." ] .

pwmsh:DeclarativePolicyShape a sh:NodeShape ; rdfs:label "DeclarativePolicyShape"@en ; sh:targetClass pwm:DeclarativePolicy ; dcterms:source pwmref:KOG-ROADMAP ;
    sh:property [ sh:path pwm:versionId ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record versionId (Kognita 0.4 item 3)." ] ;
    sh:property [ sh:path pwm:containsRule ; sh:minCount 1 ; sh:class pwm:PolicyRule ; sh:message "Record containsRule (Kognita 0.4 item 3)." ] ;
    sh:property [ sh:path pwm:policySerialization ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record policySerialization (Kognita 0.4 item 3)." ] ;
    sh:property [ sh:path pwm:hasPolicyTest ; sh:minCount 1 ; sh:class pwm:PolicyTestCase ; sh:message "Record hasPolicyTest (Kognita 0.4 item 3)." ] .

pwmsh:PolicyTestCaseShape a sh:NodeShape ; rdfs:label "PolicyTestCaseShape"@en ; sh:targetClass pwm:PolicyTestCase ; dcterms:source pwmref:KOG-ROADMAP ;
    sh:property [ sh:path pwm:testsRule ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:PolicyRule ; sh:message "Record testsRule (Kognita 0.4 item 4)." ] ;
    sh:property [ sh:path pwm:givenAttributes ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record givenAttributes (Kognita 0.4 item 4)." ] ;
    sh:property [ sh:path pwm:whenAction ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record whenAction (Kognita 0.4 item 4)." ] ;
    sh:property [ sh:path pwm:expectedOutcome ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "Record expectedOutcome (Kognita 0.4 item 4)." ] .

pwmsh:PolicyPackShape a sh:NodeShape ; rdfs:label "PolicyPackShape"@en ; sh:targetClass pwm:PolicyPack ; dcterms:source pwmref:KOG-ROADMAP ;
    sh:property [ sh:path pwm:versionId ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record versionId (Kognita 0.4 item 5)." ] ;
    sh:property [ sh:path pwm:packPolicy ; sh:minCount 1 ; sh:class pwm:DeclarativePolicy ; sh:message "Record packPolicy (Kognita 0.4 item 5)." ] ;
    sh:property [ sh:path pwm:fixtureLocator ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:anyURI ; sh:message "Record fixtureLocator (Kognita 0.4 item 5)." ] .

pwmsh:RMReviewEditShape a sh:NodeShape ; rdfs:label "RMReviewEditShape"@en ; sh:targetClass pwm:RMReviewEdit ; dcterms:source pwmref:KOG-ROADMAP ;
    sh:property [ sh:path pwm:diffLocator ; sh:minLength 1 ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:anyURI ; sh:message "Record diffLocator (Kognita 0.4 item 11)." ] ;
    sh:property [ sh:path pwm:beforeHash ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:pattern "^sha256:[0-9a-f]{64}$" ; sh:message "Record beforeHash (Kognita 0.4 item 11)." ] ;
    sh:property [ sh:path pwm:afterHash ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:pattern "^sha256:[0-9a-f]{64}$" ; sh:message "Record afterHash (Kognita 0.4 item 11)." ] ;
    sh:property [ sh:path pwm:editDiffHash ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:pattern "^sha256:[0-9a-f]{64}$" ; sh:message "Record editDiffHash (Kognita 0.4 item 11)." ] .

pwmsh:ReviewQueueEntryShape a sh:NodeShape ; rdfs:label "ReviewQueueEntryShape"@en ; sh:targetClass pwm:ReviewQueueEntry ; dcterms:source pwmref:KOG-ROADMAP ;
    sh:property [ sh:path pwm:inReviewQueue ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:ReviewQueue ; sh:message "Record inReviewQueue (Kognita 0.4 item 13)." ] ;
    sh:property [ sh:path pwm:partOfInteraction ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:ClientInteraction ; sh:message "Record partOfInteraction (Kognita 0.4 item 13)." ] ;
    sh:property [ sh:path pwm:queueReason ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record queueReason (Kognita 0.4 item 13)." ] ;
    sh:property [ sh:path pwm:queuedAt ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "Record queuedAt (Kognita 0.4 item 13)." ] ;
    sh:property [ sh:path pwm:reviewBeforeDelivery ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "Record reviewBeforeDelivery (Kognita 0.4 item 13)." ] .

pwmsh:ReviewCoverageReportShape a sh:NodeShape ; rdfs:label "ReviewCoverageReportShape"@en ; sh:targetClass pwm:ReviewCoverageReport ; dcterms:source pwmref:KOG-ROADMAP ;
    sh:property [ sh:path pwm:eligibleCount ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "Record eligibleCount (Kognita 0.4 item 13)." ] ;
    sh:property [ sh:path pwm:screenedCount ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "Record screenedCount (Kognita 0.4 item 13)." ] ;
    sh:property [ sh:path pwm:queuedCount ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "Record queuedCount (Kognita 0.4 item 13)." ] ;
    sh:property [ sh:path pwm:reviewedCount ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "Record reviewedCount (Kognita 0.4 item 13)." ] ;
    sh:property [ sh:path pwm:underUseCase ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "Record underUseCase (Kognita 0.4 item 13)." ] ;
    sh:property [ sh:path pwm:windowStart ; sh:lessThan pwm:windowEnd ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "Record windowStart (Kognita 0.4 item 13)." ] ;
    sh:property [ sh:path pwm:windowEnd ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "Record windowEnd (Kognita 0.4 item 13)." ] .

pwmsh:CircuitBreakerTripShape a sh:NodeShape ; rdfs:label "CircuitBreakerTripShape"@en ; sh:targetClass pwm:CircuitBreakerTrip ; dcterms:source pwmref:KOG-ROADMAP ;
    sh:property [ sh:path pwm:trippedBreaker ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:CircuitBreaker ; sh:message "Record trippedBreaker (Kognita 0.4 item 14)." ] ;
    sh:property [ sh:path pwm:flagThreshold ; sh:lessThanOrEquals pwm:observedFlags ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:positiveInteger ; sh:message "Record flagThreshold (Kognita 0.4 item 14)." ] ;
    sh:property [ sh:path pwm:observedFlags ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "Record observedFlags (Kognita 0.4 item 14)." ] ;
    sh:property [ sh:path pwm:prohibitingRule ; sh:minCount 1 ; sh:class pwm:PolicyRule ; sh:message "Record prohibitingRule (Kognita 0.4 item 14)." ] ;
    sh:property [ sh:path pwm:windowStart ; sh:lessThan pwm:windowEnd ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "Record windowStart (Kognita 0.4 item 14)." ] ;
    sh:property [ sh:path pwm:windowEnd ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "Record windowEnd (Kognita 0.4 item 14)." ] .

pwmsh:AffectedClientQueryShape a sh:NodeShape ; rdfs:label "AffectedClientQueryShape"@en ; sh:targetClass pwm:AffectedClientQuery ; dcterms:source pwmref:KOG-ROADMAP ;
    sh:property [ sh:path pwm:windowStart ; sh:lessThan pwm:windowEnd ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "Record windowStart (Kognita 0.4 item 14)." ] ;
    sh:property [ sh:path pwm:windowEnd ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "Record windowEnd (Kognita 0.4 item 14)." ] ;
    sh:property [ sh:path pwm:queryResult ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AffectedClientResult ; sh:message "Record queryResult (Kognita 0.4 item 14)." ] .

pwmsh:InteractionOutcomeShape a sh:NodeShape ; rdfs:label "InteractionOutcomeShape"@en ; sh:targetClass pwm:InteractionOutcome ; dcterms:source pwmref:KOG-ROADMAP ;
    sh:property [ sh:path pwm:outcomeKind ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "Record outcomeKind (Kognita 0.4 item 15)." ] ;
    sh:property [ sh:path pwm:partOfInteraction ; sh:minCount 1 ; sh:class pwm:ClientInteraction ; sh:message "Record partOfInteraction (Kognita 0.4 item 15)." ] ;
    sh:property [ sh:path pwm:affectedOutput ; sh:minCount 1 ; sh:class pwm:Recommendation ; sh:message "Record affectedOutput (Kognita 0.4 item 15)." ] ;
    sh:property [ sh:path pwm:implicatedModel ; sh:minCount 1 ; sh:class pwm:AIModel ; sh:message "Record implicatedModel (Kognita 0.4 item 15)." ] ;
    sh:property [ sh:path pwm:outcomeApprover ; sh:minCount 1 ; sh:class fibo-fnd-aap-ppl:Person ; sh:message "Record outcomeApprover (Kognita 0.4 item 15)." ] .

pwmsh:BreakerScopeShape a sh:NodeShape ; rdfs:label "BreakerScopeShape"@en ; sh:targetClass pwm:CircuitBreakerTrip ; sh:targetClass pwm:CircuitBreaker ; sh:targetClass pwm:AffectedClientQuery ; dcterms:source pwmref:KOG-ROADMAP ; sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "A breaker, trip or affected-client query requires a use-case, model, policy or prompt-version scope (Kognita 0.4 item 14)." ; sh:select """SELECT DISTINCT $this WHERE { FILTER NOT EXISTS { $this (pwm:scopeUseCase|pwm:scopeModel|pwm:scopePolicy|pwm:scopePromptVersion) ?scope } }""" ] .

pwmsh:TwoSignatureShape a sh:NodeShape ; rdfs:label "TwoSignatureShape"@en ; sh:targetSubjectsOf pwm:requiresTwoSignatures ; dcterms:source pwmref:KOG-ROADMAP ; sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "A communication requiring two signatures must name two distinct human signers (Kognita 0.4 item 12)." ; sh:select """SELECT DISTINCT $this WHERE { $this pwm:requiresTwoSignatures true . FILTER NOT EXISTS { $this pwm:communicationSigner ?a, ?b . ?a a <https://spec.edmcouncil.org/fibo/ontology/FND/AgentsAndPeople/People/Person> . ?b a <https://spec.edmcouncil.org/fibo/ontology/FND/AgentsAndPeople/People/Person> . FILTER (?a != ?b) } }""" ] .

# A review time is an instant. A decision made after it must be DENY. Comparison is on typed
# instants, so offsets are honored; a value without an offset is read as UTC.
pwmsh:PastReviewDecisionShape a sh:NodeShape ;
    rdfs:label "PastReviewDecisionShape"@en ;
    sh:targetClass pwm:PolicyDecision ;
    dcterms:source pwmref:KOG-ROADMAP ;
    sh:sparql [
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:message "A decision made after the use-case review time expires must be DENY (Kognita 0.4 item 8)." ;
        sh:select """
            SELECT DISTINCT $this WHERE {
                $this pwm:underUseCase ?uc ; pwm:decisionOutcome ?out ;
                    <http://www.w3.org/ns/prov#generatedAtTime> ?at .
                ?uc pwm:nextReviewDate ?due .
                FILTER(DATATYPE(?at) = xsd:dateTime && DATATYPE(?due) = xsd:dateTime)
                FILTER(?at > ?due && ?out != pwm:OutcomeDeny)
            }
        """
    ] .

pwmsh:RiskAppetiteDecisionShape a sh:NodeShape ; rdfs:label "RiskAppetiteDecisionShape"@en ; sh:targetClass pwm:PolicyDecision ; dcterms:source pwmref:KOG-ROADMAP ; sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "A decision outside the recorded risk appetite must be DENY (Kognita 0.4 item 8)." ; sh:select """SELECT DISTINCT $this WHERE { $this pwm:underUseCase ?uc ; pwm:decisionOutcome ?out . ?uc pwm:appetitePermits false . FILTER (?out != pwm:OutcomeDeny) }""" ] .

pwmsh:CoverageCountsShape a sh:NodeShape ; rdfs:label "CoverageCountsShape"@en ; sh:targetClass pwm:ReviewCoverageReport ; dcterms:source pwmref:KOG-ROADMAP ; sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Coverage counts must satisfy reviewed <= queued <= screened <= eligible (Kognita 0.4 item 13)." ; sh:select """SELECT DISTINCT $this WHERE { $this pwm:eligibleCount ?e ; pwm:screenedCount ?s ; pwm:queuedCount ?q ; pwm:reviewedCount ?r . FILTER (?s > ?e || ?q > ?s || ?r > ?q) }""" ] .

pwmsh:CircuitBreakerConfigurationShape a sh:NodeShape ; rdfs:label "CircuitBreakerConfigurationShape"@en ; sh:targetClass pwm:CircuitBreaker ; dcterms:source pwmref:KOG-ROADMAP ; sh:property [ sh:path pwm:flagThreshold ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:positiveInteger ; sh:message "Record flagThreshold (Kognita 0.4 item 14)." ] ; sh:property [ sh:path pwm:windowStart ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:lessThan pwm:windowEnd ; sh:message "Record windowStart (Kognita 0.4 item 14)." ] ; sh:property [ sh:path pwm:windowEnd ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "Record windowEnd (Kognita 0.4 item 14)." ] .

pwmsh:FlightRecorderSessionShape a sh:NodeShape ; rdfs:label "FlightRecorderSessionShape"@en ; sh:targetClass pwm:FlightRecorderSession ; dcterms:source pwmref:KOG-ROADMAP ; sh:property [ sh:path pwm:recordedRun ; sh:minCount 1 ; sh:class pwm:Run ; sh:message "Record recordedRun (Kognita 0.4 item 7)." ] ; sh:property [ sh:path pwm:contentHash ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record contentHash (Kognita 0.4 item 7)." ] .

pwmsh:ReplayShape a sh:NodeShape ; rdfs:label "ReplayShape"@en ; sh:targetClass pwm:Replay ; dcterms:source pwmref:KOG-ROADMAP ; sh:property [ sh:path pwm:replaysSession ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:FlightRecorderSession ; sh:message "Record replaysSession (Kognita 0.4 item 7)." ] ; sh:property [ sh:path pwm:replayReport ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:ReconstructionReport ; sh:message "Record replayReport (Kognita 0.4 item 7)." ] .

pwmsh:PolicyChangeShape a sh:NodeShape ; rdfs:label "PolicyChangeShape"@en ; sh:targetClass pwm:PolicyChange ; dcterms:source pwmref:KOG-ROADMAP ; sh:property [ sh:path pwm:changesPolicy ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:DeclarativePolicy ; sh:message "Record changesPolicy (Kognita 0.4 item 3)." ] ; sh:property [ sh:path pwm:deltaText ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "Record deltaText (Kognita 0.4 item 3)." ] ; sh:property [ sh:path pwm:changeStage ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:in ( "propose" "review" "validated" "applied" ) ; sh:message "Record changeStage (Kognita 0.4 item 3)." ] .

pwmsh:NearMissClassificationShape a sh:NodeShape ; rdfs:label "NearMissClassificationShape"@en ; sh:targetClass pwm:NearMiss ; dcterms:source pwmref:KOG-ROADMAP ; sh:property [ sh:path pwm:nearMissKind ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "Record nearMissKind (Kognita 0.4 item 15)." ] ; sh:property [ sh:path pwm:partOfInteraction ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:ClientInteraction ; sh:message "Record partOfInteraction (Kognita 0.4 item 15)." ] .

pwmsh:ReviewSamplingRateShape a sh:NodeShape ; rdfs:label "ReviewSamplingRateShape"@en ; sh:targetSubjectsOf pwm:lowRiskSamplingRate ; dcterms:source pwmref:KOG-ROADMAP ; sh:property [ sh:path pwm:lowRiskSamplingRate ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:minInclusive 0 ; sh:maxInclusive 1 ; sh:message "Record lowRiskSamplingRate (Kognita 0.4 item 13)." ] .

pwmsh:AffectedClientResultShape a sh:NodeShape ; rdfs:label "AffectedClientResultShape"@en ; sh:targetClass pwm:AffectedClientResult ; dcterms:source pwmref:KOG-ROADMAP ; sh:property [ sh:path pwm:resultCount ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "Record resultCount (Kognita 0.4 item 14)." ] .

pwmsh:AffectedClientCountShape a sh:NodeShape ; rdfs:label "AffectedClientCountShape"@en ; sh:targetClass pwm:AffectedClientResult ; dcterms:source pwmref:KOG-ROADMAP ; sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Affected-client count must equal distinct recipients of the returned communications (0.4 item 14)." ; sh:select """SELECT DISTINCT $this WHERE {  $this pwm:resultCount ?n . { SELECT $this (COUNT(DISTINCT ?client) AS ?actual) WHERE { $this a pwm:AffectedClientResult . OPTIONAL { $this pwm:affectedCommunication ?comm . ?comm pwm:withClient ?client } } GROUP BY $this } FILTER (?n != ?actual)  }""" ]  ; sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Each affected communication must record withClient (Kognita 0.4 item 14)." ; sh:select """SELECT DISTINCT $this WHERE { $this pwm:affectedCommunication ?comm . FILTER NOT EXISTS { ?comm pwm:withClient ?client } }""" ] .

pwmsh:ModelCallCardShape a sh:NodeShape ; rdfs:label "ModelCallCardShape"@en ; sh:targetClass pwm:ModelCall ; dcterms:source pwmref:KOG-ROADMAP ; sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Pinned model calls must link to their approved model card and exact version (0.4 item 8)." ; sh:select """SELECT DISTINCT $this WHERE { $this pwm:usesModel ?model ; pwm:modelVersion ?version . FILTER NOT EXISTS { $this pwm:hasModelCard ?card . ?model pwm:hasModelCard ?card . ?card pwm:modelVersion ?version } }""" ] .

pwmsh:LiveRiskAppetiteShape a sh:NodeShape ;
    rdfs:label "Live use case risk appetite"@en ;
    sh:targetClass pwm:AIUseCase ; dcterms:source pwmref:KOG-ROADMAP, pwmref:MAS-AIRG ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:message "An explicit failed risk-appetite evaluation prevents activation (Kognita 0.4 item 8; MAS AIRG 4.11)." ;
        sh:select """SELECT $this WHERE { $this pwm:lifecycleStatus pwm:StatusLive ; pwm:appetitePermits false . }""" ] .

# Written 0.5 rules

pwmsh:AgentIdentityShape a sh:NodeShape ; rdfs:label "AgentIdentityShape"@en ; sh:targetClass pwm:AIAgent ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 1. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:workloadIdentity ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:WorkloadIdentity ; sh:message "pwm:workloadIdentity: minimum count 1, maximum count 1, class pwm:WorkloadIdentity." ] ;
    sh:property [ sh:path pwm:agentOwner ; sh:minCount 1 ; sh:maxCount 1 ; sh:class fibo-fnd-aap-ppl:Person ; sh:message "pwm:agentOwner: minimum count 1, maximum count 1, class fibo-fnd-aap-ppl:Person." ] ;
    sh:property [ sh:path pwm:operatesFor ; sh:minCount 1 ; sh:maxCount 1 ; sh:class fibo-fnd-aap-ppl:Person ; sh:message "pwm:operatesFor: minimum count 1, maximum count 1, class fibo-fnd-aap-ppl:Person." ] ;
    sh:property [ sh:path pwm:hasPurpose ; sh:minCount 1 ; sh:class pwm:Purpose ; sh:message "pwm:hasPurpose: minimum count 1, class pwm:Purpose." ] ;
    sh:property [ sh:path pwm:deploymentDate ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:deploymentDate: minimum count 1, maximum count 1, datatype xsd:dateTime." ] ;
    sh:property [ sh:path pwm:deploymentModel ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AIModel ; sh:message "pwm:deploymentModel: minimum count 1, maximum count 1, class pwm:AIModel." ] ;
    sh:property [ sh:path pwm:deploymentEnvironment ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:deploymentEnvironment: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:agentStatus ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:agentStatus: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:approvedDeploymentVersion ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:approvedDeploymentVersion: minimum count 1, maximum count 1, datatype xsd:string." ] .

pwmsh:WorkloadIdentityShape a sh:NodeShape ; rdfs:label "WorkloadIdentityShape"@en ; sh:targetClass pwm:WorkloadIdentity ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 1. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:credentialReference ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:anyURI ; sh:message "pwm:credentialReference: minimum count 1, maximum count 1, datatype xsd:anyURI." ] ;
    sh:property [ sh:path pwm:credentialIssuer ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:anyURI ; sh:message "pwm:credentialIssuer: minimum count 1, maximum count 1, datatype xsd:anyURI." ] ;
    sh:property [ sh:path pwm:workloadSubject ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:workloadSubject: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:deploymentEnvironment ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:deploymentEnvironment: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Workload subjects must not be shared (Kognita 0.5 item 1)." ;
        sh:select """SELECT DISTINCT $this WHERE { $this pwm:workloadSubject ?s . ?other pwm:workloadSubject ?s . FILTER(?other != $this) }""" ] ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Credential references must not be shared by distinct workload identities (Kognita 0.5 item 1)." ;
        sh:select """SELECT DISTINCT $this WHERE { $this pwm:credentialReference ?credential . ?other a pwm:WorkloadIdentity ; pwm:credentialReference ?credential . FILTER(?other != $this) }""" ] .

pwmsh:AgentDecisionShape a sh:NodeShape ; rdfs:label "AgentDecisionShape"@en ; sh:targetClass pwm:GovernedCall ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 1. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Agent calls require live approved deployment, current review, registered decision use case and unrevoked own workload identity (Kognita 0.5 item 1)." ;
        sh:select """SELECT DISTINCT $this WHERE { $this pwm:callAgent ?agent ; pwm:governedByDecision ?decision . ?decision pwm:decisionOutcome ?out . FILTER (?out != pwm:OutcomeDeny)
 FILTER NOT EXISTS { ?agent pwm:deploymentVersion ?v ; pwm:approvedDeploymentVersion ?v ; pwm:agentStatus pwm:StatusLive ; pwm:nextReviewDate ?due ; pwm:workloadIdentity ?identity ; pwm:registeredForUseCase ?uc .
 ?decision pwm:underUseCase ?uc .
 $this pwm:workloadIdentity ?identity . ?decision <http://www.w3.org/ns/prov#generatedAtTime> ?at .
 FILTER(?at <= ?due)
 FILTER NOT EXISTS { ?rev pwm:revokedAuthority ?identity ; pwm:revokedAt ?rt . FILTER(?rt <= ?at) } } }""" ] .

pwmsh:AuthorityScopeShape a sh:NodeShape ; rdfs:label "AuthorityScopeShape"@en ; sh:targetClass pwm:AuthorityScope ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 2. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:aboutClient ; sh:minCount 1 ; sh:class pwm:Client ; sh:message "pwm:aboutClient: minimum count 1, class pwm:Client." ] ;
    sh:property [ sh:path pwm:hasPurpose ; sh:minCount 1 ; sh:class pwm:Purpose ; sh:message "pwm:hasPurpose: minimum count 1, class pwm:Purpose." ] ;
    sh:property [ sh:path pwm:actionVerb ; sh:minCount 1 ; sh:message "pwm:actionVerb: minimum count 1." ] ;
    sh:property [ sh:path pwm:classification ; sh:minCount 1 ; sh:message "pwm:classification: minimum count 1." ] ;
    sh:property [ sh:path pwm:scopeTool ; sh:minCount 1 ; sh:class pwm:Tool ; sh:message "pwm:scopeTool: minimum count 1, class pwm:Tool." ] ;
    sh:property [ sh:path pwm:scopeField ; sh:minCount 1 ; sh:datatype xsd:string ; sh:message "pwm:scopeField: minimum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:jurisdictionCode ; sh:minCount 1 ; sh:datatype xsd:string ; sh:message "pwm:jurisdictionCode: minimum count 1, datatype xsd:string." ]  ;
    sh:property [ sh:path pwm:scopeAutonomyLevel ; sh:minCount 1 ; sh:maxCount 1  ; sh:message "scopeAutonomyLevel: minimum count 1; maximum count 1." ] .

pwmsh:HumanEntitlementShape a sh:NodeShape ; rdfs:label "HumanEntitlementShape"@en ; sh:targetClass pwm:HumanEntitlement ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 2. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:authorityScope ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AuthorityScope ; sh:message "pwm:authorityScope: minimum count 1, maximum count 1, class pwm:AuthorityScope." ] ;
    sh:property [ sh:path pwm:validFrom ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:validFrom: minimum count 1, maximum count 1, datatype xsd:dateTime." ] ;
    sh:property [ sh:path pwm:validUntil ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:validUntil: minimum count 1, maximum count 1, datatype xsd:dateTime." ] ;
    sh:property [ sh:path pwm:validFrom ; sh:lessThan pwm:validUntil ; sh:message "validFrom must be earlier than validUntil (Kognita 0.5 item 2)." ] .

pwmsh:DelegationScopeShape a sh:NodeShape ; rdfs:label "DelegationScopeShape"@en ; sh:targetClass pwm:DelegatedAuthority ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 2. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:authorityScope ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AuthorityScope ; sh:message "pwm:authorityScope: minimum count 1, maximum count 1, class pwm:AuthorityScope." ] ;
    sh:property [ sh:path pwm:validFrom ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:validFrom: minimum count 1, maximum count 1, datatype xsd:dateTime." ] ;
    sh:property [ sh:path pwm:delegationDepth ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "pwm:delegationDepth: minimum count 1, maximum count 1, datatype xsd:nonNegativeInteger." ] ;
    sh:property [ sh:path pwm:maxDelegationDepth ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "pwm:maxDelegationDepth: minimum count 1, maximum count 1, datatype xsd:nonNegativeInteger." ] ;
    sh:property [ sh:path pwm:validFrom ; sh:lessThan pwm:validUntil ; sh:message "validFrom must be earlier than validUntil (Kognita 0.5 item 2)." ] ;
    sh:property [ sh:path pwm:delegationDepth ; sh:lessThanOrEquals pwm:maxDelegationDepth ; sh:message "delegationDepth must not exceed maxDelegationDepth (Kognita 0.5 item 2)." ] ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Grantor must hold an entitlement covering the complete explicit delegation scope and time (Kognita 0.5 item 2)." ;
        sh:select """SELECT DISTINCT $this WHERE { $this pwm:delegatedBy ?human ; pwm:authorityScope ?scope ; pwm:validFrom ?start ; pwm:validUntil ?end .
 FILTER NOT EXISTS { ?human pwm:holdsEntitlement ?e . ?e pwm:authorityScope ?hs ; pwm:validFrom ?es ; pwm:validUntil ?ee . FILTER (?es <= ?start && ?ee >= ?end)

 ?scope pwm:classification ?childClass . ?hs pwm:classification ?parentClass .
 BIND(IF(?childClass = pwm:C0,0,IF(?childClass = pwm:C1,1,IF(?childClass = pwm:C2,2,3))) AS ?childRank)
 BIND(IF(?parentClass = pwm:C0,0,IF(?parentClass = pwm:C1,1,IF(?parentClass = pwm:C2,2,3))) AS ?parentRank)
 FILTER(?childRank <= ?parentRank)
 FILTER NOT EXISTS { ?scope ?dim ?value . FILTER (?dim IN (pwm:aboutClient,pwm:hasPurpose,pwm:actionVerb,pwm:scopeTool,pwm:scopeField,pwm:scopeSystem,pwm:scopeProduct,pwm:jurisdictionCode)) FILTER NOT EXISTS { ?hs ?dim ?value } }
 } }""" ] .

pwmsh:AuthorityRevocationShape a sh:NodeShape ; rdfs:label "AuthorityRevocationShape"@en ; sh:targetClass pwm:AuthorityRevocation ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 2. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:revokedAuthority ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:revokedAuthority: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:revokedAt ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:revokedAt: minimum count 1, maximum count 1, datatype xsd:dateTime." ] ;
    sh:property [ sh:path pwm:rationale ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:rationale: minimum count 1, maximum count 1, datatype xsd:string." ] .

pwmsh:LiveAuthorityDecisionShape a sh:NodeShape ; rdfs:label "LiveAuthorityDecisionShape"@en ; sh:targetClass pwm:GovernedCall ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 2. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Both call and decision must cite the same live delegation to this agent and a live, unrevoked human entitlement covering the complete delegation scope (Kognita 0.5 item 2)." ;
        sh:select """SELECT DISTINCT $this WHERE { $this pwm:callAgent ?a ; pwm:governedByDecision ?d . ?d pwm:decisionOutcome ?out . FILTER (?out != pwm:OutcomeDeny)
 FILTER NOT EXISTS { $this pwm:reliesOnDelegation ?auth . ?d pwm:reliesOnDelegation ?auth ; <http://www.w3.org/ns/prov#generatedAtTime> ?at .
 ?auth pwm:delegatedTo ?a ; pwm:delegatedBy ?h ; pwm:authorityScope ?s ; pwm:validFrom ?start ; pwm:validUntil ?end .
 FILTER(?at >= ?start && ?at < ?end)
 ?h pwm:holdsEntitlement ?e . ?e pwm:validFrom ?es ; pwm:validUntil ?ee ; pwm:authorityScope ?hs . FILTER (?at >= ?es && ?at < ?ee)

 ?s pwm:classification ?childClass . ?hs pwm:classification ?parentClass .
 BIND(IF(?childClass = pwm:C0,0,IF(?childClass = pwm:C1,1,IF(?childClass = pwm:C2,2,3))) AS ?childRank)
 BIND(IF(?parentClass = pwm:C0,0,IF(?parentClass = pwm:C1,1,IF(?parentClass = pwm:C2,2,3))) AS ?parentRank)
 FILTER(?childRank <= ?parentRank)
 FILTER NOT EXISTS { ?s ?dim ?v . FILTER (?dim IN (pwm:aboutClient,pwm:hasPurpose,pwm:actionVerb,pwm:scopeTool,pwm:scopeField,pwm:scopeSystem,pwm:scopeProduct,pwm:jurisdictionCode)) FILTER NOT EXISTS { ?hs ?dim ?v } }
 FILTER NOT EXISTS { ?rev pwm:revokedAuthority ?e ; pwm:revokedAt ?et . FILTER(?et <= ?at) }
 FILTER NOT EXISTS { ?auth pwm:parentDelegation* ?ancestor . ?rev pwm:revokedAuthority ?ancestor ; pwm:revokedAt ?rt . FILTER(?rt <= ?at) }
 FILTER NOT EXISTS { ?auth pwm:parentDelegation+ ?ancestor . ?ancestor pwm:validUntil ?ae . FILTER(?at >= ?ae) }
 } }""" ] .

pwmsh:SubDelegationShape a sh:NodeShape ; rdfs:label "SubDelegationShape"@en ; sh:targetSubjectsOf pwm:parentDelegation ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 9. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Sub-delegation must be acyclic, narrow every explicit scope set and period, and respect depth (Kognita 0.5 item 9)." ;
        sh:select """SELECT DISTINCT $this WHERE { $this pwm:parentDelegation ?parent .
 FILTER (EXISTS { $this pwm:parentDelegation+ $this } || NOT EXISTS {
 $this pwm:authorityScope ?s ; pwm:delegationDepth ?depth ; pwm:maxDelegationDepth ?max ; pwm:validFrom ?start ; pwm:validUntil ?end ; pwm:delegatedBy ?human .
 ?parent pwm:authorityScope ?ps ; pwm:delegationDepth ?pd ; pwm:maxDelegationDepth ?pm ; pwm:validFrom ?pstart ; pwm:validUntil ?pend ; pwm:delegatedBy ?human .
 FILTER(?depth = ?pd + 1 && ?depth <= ?max && ?max <= ?pm && ?start >= ?pstart && ?end <= ?pend)

 ?s pwm:classification ?childClass . ?ps pwm:classification ?parentClass .
 BIND(IF(?childClass = pwm:C0,0,IF(?childClass = pwm:C1,1,IF(?childClass = pwm:C2,2,3))) AS ?childRank)
 BIND(IF(?parentClass = pwm:C0,0,IF(?parentClass = pwm:C1,1,IF(?parentClass = pwm:C2,2,3))) AS ?parentRank)
 FILTER(?childRank <= ?parentRank)
 FILTER NOT EXISTS { ?s ?dim ?v . FILTER (?dim IN (pwm:aboutClient,pwm:hasPurpose,pwm:actionVerb,pwm:scopeTool,pwm:scopeField,pwm:scopeSystem,pwm:scopeProduct,pwm:jurisdictionCode)) FILTER NOT EXISTS { ?ps ?dim ?v } }
 }) }""" ]  ;
    sh:property [ sh:path pwm:parentDelegation ; sh:maxCount 1 ; sh:class pwm:DelegatedAuthority  ; sh:message "parentDelegation: maximum count 1; class DelegatedAuthority." ] .

pwmsh:PromotionGateShape a sh:NodeShape ; rdfs:label "PromotionGateShape"@en ; sh:targetClass pwm:AutonomyPromotionGate ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 3. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:minimumSample ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:positiveInteger ; sh:message "pwm:minimumSample: minimum count 1, maximum count 1, datatype xsd:positiveInteger." ] ;
    sh:property [ sh:path pwm:minimumWindowSeconds ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:minimumWindowSeconds: minimum count 1, maximum count 1, datatype xsd:decimal." ] ;
    sh:property [ sh:path pwm:qualityThreshold ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:qualityThreshold: minimum count 1, maximum count 1, datatype xsd:decimal." ] ;
    sh:property [ sh:path pwm:exceptionRateThreshold ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:exceptionRateThreshold: minimum count 1, maximum count 1, datatype xsd:decimal." ] ;
    sh:property [ sh:path pwm:requiresFullTraceability ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:requiresFullTraceability: minimum count 1, maximum count 1, datatype xsd:boolean." ] ;
    sh:property [ sh:path pwm:stepDownThreshold ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:stepDownThreshold: minimum count 1, maximum count 1, datatype xsd:decimal." ] ;
    sh:property [ sh:path pwm:qualityThreshold ; sh:minInclusive 0 ; sh:maxInclusive 1 ; sh:message "pwm:qualityThreshold: minimum inclusive 0, maximum inclusive 1." ] ;
    sh:property [ sh:path pwm:exceptionRateThreshold ; sh:minInclusive 0 ; sh:maxInclusive 1 ; sh:message "pwm:exceptionRateThreshold: minimum inclusive 0, maximum inclusive 1." ] ;
    sh:property [ sh:path pwm:stepDownThreshold ; sh:minInclusive 0 ; sh:lessThan pwm:qualityThreshold ; sh:message "pwm:stepDownThreshold: minimum inclusive 0, must be earlier or lower than pwm:qualityThreshold." ] ;
    sh:property [ sh:path pwm:minimumWindowSeconds ; sh:minExclusive 0 ; sh:message "pwm:minimumWindowSeconds: minimum exclusive 0." ] .

pwmsh:AutonomyTransitionShape a sh:NodeShape ; rdfs:label "AutonomyTransitionShape"@en ; sh:targetClass pwm:AutonomyTransition ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 3. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:transitionAgent ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AIAgent ; sh:message "pwm:transitionAgent: minimum count 1, maximum count 1, class pwm:AIAgent." ] ;
    sh:property [ sh:path pwm:promotionGate ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AutonomyPromotionGate ; sh:message "pwm:promotionGate: minimum count 1, maximum count 1, class pwm:AutonomyPromotionGate." ] ;
    sh:property [ sh:path pwm:fromAutonomyLevel ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:fromAutonomyLevel: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:toAutonomyLevel ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:toAutonomyLevel: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:sampleCount ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "pwm:sampleCount: minimum count 1, maximum count 1, datatype xsd:nonNegativeInteger." ] ;
    sh:property [ sh:path pwm:observedQuality ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:observedQuality: minimum count 1, maximum count 1, datatype xsd:decimal." ] ;
    sh:property [ sh:path pwm:observedExceptionRate ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:observedExceptionRate: minimum count 1, maximum count 1, datatype xsd:decimal." ] ;
    sh:property [ sh:path pwm:fullyReconstructable ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:fullyReconstructable: minimum count 1, maximum count 1, datatype xsd:boolean." ] ;
    sh:property [ sh:path pwm:transitionApproved ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:transitionApproved: minimum count 1, maximum count 1, datatype xsd:boolean." ] ;
    sh:property [ sh:path pwm:windowStart ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:windowStart: minimum count 1, maximum count 1, datatype xsd:dateTime." ] ;
    sh:property [ sh:path pwm:windowEnd ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:windowEnd: minimum count 1, maximum count 1, datatype xsd:dateTime." ] ;
    sh:property [ sh:path pwm:windowStart ; sh:lessThan pwm:windowEnd ; sh:message "pwm:windowStart: must be earlier or lower than pwm:windowEnd." ] ;
    sh:property [ sh:path pwm:observedQuality ; sh:minInclusive 0 ; sh:maxInclusive 1 ; sh:message "pwm:observedQuality: minimum inclusive 0, maximum inclusive 1." ] ;
    sh:property [ sh:path pwm:observedExceptionRate ; sh:minInclusive 0 ; sh:maxInclusive 1 ; sh:message "pwm:observedExceptionRate: minimum inclusive 0, maximum inclusive 1." ] .

pwmsh:AutonomyEvidenceShape a sh:NodeShape ; rdfs:label "AutonomyEvidenceShape"@en ; sh:targetClass pwm:AutonomyTransition ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 3. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Promotion requires evidence thresholds, sample/window, owner and independent validation; step-down is one level and alerts owners (Kognita 0.5 item 3)." ;
        sh:select """SELECT DISTINCT $this WHERE { $this pwm:fromAutonomyLevel ?from ; pwm:toAutonomyLevel ?to ; pwm:promotionGate ?g ; pwm:transitionAgent ?a ; pwm:observedQuality ?q .
 BIND(IF(?from = pwm:L0Retrieve, 0, IF(?from = pwm:L1Explain, 1, IF(?from = pwm:L2Recommend, 2, IF(?from = pwm:L3Draft, 3, IF(?from = pwm:L4ActAfterApproval, 4, IF(?from = pwm:L5BoundedAutonomy, 5, IF(?from = pwm:L6BroadAutonomy, 6, 99))))))) AS ?fr) BIND(IF(?to = pwm:L0Retrieve, 0, IF(?to = pwm:L1Explain, 1, IF(?to = pwm:L2Recommend, 2, IF(?to = pwm:L3Draft, 3, IF(?to = pwm:L4ActAfterApproval, 4, IF(?to = pwm:L5BoundedAutonomy, 5, IF(?to = pwm:L6BroadAutonomy, 6, 99))))))) AS ?tr)
 FILTER ((?tr > ?fr && EXISTS { $this pwm:transitionApproved true } && NOT EXISTS {
 $this pwm:sampleCount ?n ; pwm:observedExceptionRate ?ex ; pwm:fullyReconstructable ?trace ; pwm:windowStart ?start ; pwm:windowEnd ?end ; pwm:ownerApproval ?owner ; pwm:independentValidation ?validator .
 ?a pwm:agentOwner ?owner . ?validator cmns-rlcmp:isPlayedBy ?person . FILTER(?person != ?owner)
 ?g pwm:minimumSample ?min ; pwm:qualityThreshold ?qt ; pwm:exceptionRateThreshold ?et ; pwm:requiresFullTraceability ?req ; pwm:minimumWindowSeconds ?seconds .
 FILTER(?n >= ?min && ?q >= ?qt && ?ex < ?et && (!?req || ?trace))
 BIND(STR(?end - ?start) AS ?span)
 BIND(IF(REGEX(?span, "[0-9]+D"), <http://www.w3.org/2001/XMLSchema#decimal>(REPLACE(?span, "^P([0-9]+)D.*$", "$1")), 0) AS ?days)
 BIND(IF(REGEX(?span, "[0-9]+H"), <http://www.w3.org/2001/XMLSchema#decimal>(REPLACE(?span, "^.*T([0-9]+)H.*$", "$1")), 0) AS ?hours)
 BIND(IF(REGEX(?span, "T.*[0-9]+M"), <http://www.w3.org/2001/XMLSchema#decimal>(REPLACE(?span, "^.*[TH]([0-9]+)M.*$", "$1")), 0) AS ?minutes)
 BIND(IF(REGEX(?span, "[0-9.]+S"), <http://www.w3.org/2001/XMLSchema#decimal>(REPLACE(?span, "^.*[THM]([0-9.]+)S$", "$1")), 0) AS ?secs)
 FILTER(?days * 86400 + ?hours * 3600 + ?minutes * 60 + ?secs >= ?seconds)
 }) || (?tr < ?fr && (?tr != ?fr - 1 || NOT EXISTS { ?g pwm:stepDownThreshold ?st . FILTER(?q < ?st || EXISTS { $this pwm:qualityDrift true }) $this pwm:notifiedRole ?ownerRole, ?kl . ?ownerRole a pwm:BusinessOwner . ?kl a pwm:KnowledgeLead . }))) }""" ] .

pwmsh:BlastRadiusLimitShape a sh:NodeShape ; rdfs:label "BlastRadiusLimitShape"@en ; sh:targetClass pwm:BlastRadiusLimit ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 4. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:limitDimension ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:limitDimension: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:limitWindowBasis ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:limitWindowBasis: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:limitUnit ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:limitUnit: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:limitMaximum ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:limitMaximum: minimum count 1, maximum count 1, datatype xsd:decimal." ] ;
    sh:property [ sh:path pwm:limitMaximum ; sh:minInclusive 0 ; sh:message "pwm:limitMaximum: minimum inclusive 0." ] ;
    sh:property [ sh:path pwm:limitDimension ; sh:in ( "records" "clients" "value" "actions" "transactions" "clients-contacted" ) ; sh:message "pwm:limitDimension: allowed values ( 'records' 'clients' 'value' 'actions' 'transactions' 'clients-contacted' )." ] ;
    sh:property [ sh:path pwm:limitWindowBasis ; sh:in ( "action" "run" "minute" "hour" "UTC-day" ) ; sh:message "pwm:limitWindowBasis: allowed values ( 'action' 'run' 'minute' 'hour' 'UTC-day' )." ] .

pwmsh:BlastRadiusObservationShape a sh:NodeShape ; rdfs:label "BlastRadiusObservationShape"@en ; sh:targetClass pwm:BlastRadiusObservation ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 4. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:observedLimit ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:BlastRadiusLimit ; sh:message "pwm:observedLimit: minimum count 1, maximum count 1, class pwm:BlastRadiusLimit." ] ;
    sh:property [ sh:path pwm:projectedConsumption ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:projectedConsumption: minimum count 1, maximum count 1, datatype xsd:decimal." ] ;
    sh:property [ sh:path pwm:projectedConsumption ; sh:minInclusive 0 ; sh:message "pwm:projectedConsumption: minimum inclusive 0." ] .

pwmsh:BlastRadiusDecisionShape a sh:NodeShape ; rdfs:label "BlastRadiusDecisionShape"@en ; sh:targetClass pwm:PolicyDecision ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 4. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Projected consumption exceeding any agent blast-radius cap cannot be ALLOW (Kognita 0.5 item 4)." ;
        sh:select """SELECT DISTINCT $this WHERE { $this pwm:decisionOutcome pwm:OutcomeAllow ; pwm:limitObservation ?o . ?o pwm:observedLimit/pwm:limitMaximum ?max ; pwm:projectedConsumption ?n . FILTER (?n > ?max) }""" ]  ;
 sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "ALLOW requires exactly one observation for each calling agent and delegation scope limit and no unrelated limits." ; sh:select """SELECT DISTINCT $this WHERE {
 $this pwm:decisionOutcome pwm:OutcomeAllow . ?call pwm:governedByDecision $this ; pwm:callAgent ?agent .
 { ?agent pwm:hasBlastRadiusLimit ?limit } UNION { ?call pwm:reliesOnDelegation/pwm:authorityScope/pwm:scopeLimit ?limit }
 FILTER (NOT EXISTS { $this pwm:limitObservation ?obs . ?obs pwm:observedLimit ?limit } ||
 EXISTS { $this pwm:limitObservation ?obs1, ?obs2 . ?obs1 pwm:observedLimit ?limit . ?obs2 pwm:observedLimit ?limit . FILTER(?obs1 != ?obs2) } ||
 EXISTS { $this pwm:limitObservation/pwm:observedLimit ?other . FILTER NOT EXISTS { ?agent pwm:hasBlastRadiusLimit ?other } FILTER NOT EXISTS { ?call pwm:reliesOnDelegation/pwm:authorityScope/pwm:scopeLimit ?other } })
 }""" ] .

pwmsh:ToolAllowListShape a sh:NodeShape ; rdfs:label "ToolAllowListShape"@en ; sh:targetClass pwm:ToolCall ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 5. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "A tool outside the agent allow-list must be DENY (Kognita 0.5 item 5)." ;
        sh:select """SELECT DISTINCT $this WHERE { $this pwm:callAgent ?agent ; pwm:invokedTool ?tool ; pwm:governedByDecision ?d . ?d pwm:decisionOutcome ?out . FILTER (?out != pwm:OutcomeDeny) FILTER NOT EXISTS { ?agent pwm:permittedTool ?tool } }""" ] .

pwmsh:FieldMinimizationShape a sh:NodeShape ; rdfs:label "FieldMinimizationShape"@en ; sh:targetClass pwm:ToolCall ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 5. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Requested fields outside purpose-specific agent permissions must be DENY (Kognita 0.5 item 5)." ;
        sh:select """SELECT DISTINCT $this WHERE { $this pwm:callAgent ?agent ; pwm:requestedField ?field ; pwm:governedByDecision ?d . ?d pwm:decisionOutcome ?out . FILTER (?out != pwm:OutcomeDeny) FILTER NOT EXISTS { ?agent pwm:permittedField ?field } }""" ] .

pwmsh:ExternalContentShape a sh:NodeShape ; rdfs:label "ExternalContentShape"@en ; sh:targetClass pwm:ExternalContent ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 6. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:trustLabel ; sh:minCount 1 ; sh:message "pwm:trustLabel: minimum count 1." ] ;
    sh:property [ sh:path pwm:trustLabel ; sh:hasValue pwm:TrustExternal ; sh:message "pwm:trustLabel: required value pwm:TrustExternal." ] ;
    sh:property [ sh:path pwm:contentHash ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:contentHash: minimum count 1, maximum count 1, datatype xsd:string." ] .

pwmsh:ContentIsolationShape a sh:NodeShape ; rdfs:label "ContentIsolationShape"@en ; sh:targetClass pwm:ToolCall ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 6. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Externally tainted runs cannot write; client-data taint cannot reach public-content tools (Kognita 0.5 item 6)." ;
        sh:select """SELECT DISTINCT $this WHERE { $this pwm:governedByDecision ?d ; pwm:invokedTool ?t . ?d pwm:decisionOutcome ?out . FILTER(?out != pwm:OutcomeDeny)
 { $this (pwm:inputContent|pwm:inRun/pwm:inputContent)/pwm:trustLabel pwm:TrustExternal . ?t pwm:actionVerb ?v . FILTER (?v IN (pwm:VerbDraft,pwm:VerbQueue,pwm:VerbSend,pwm:VerbExecute)) }
 UNION { $this (pwm:inputContent|pwm:inRun/pwm:inputContent)/pwm:trustLabel pwm:TrustClientData . ?t pwm:publicContentTool true } }""" ] .

pwmsh:AuthenticatedInstructionShape a sh:NodeShape ; rdfs:label "AuthenticatedInstructionShape"@en ; sh:targetClass pwm:AuthenticatedInstruction ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 7. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:instructionSource ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:anyURI ; sh:message "pwm:instructionSource: minimum count 1, maximum count 1, datatype xsd:anyURI." ] ;
    sh:property [ sh:path pwm:instructionPrincipal ; sh:minCount 1 ; sh:maxCount 1 ; sh:class fibo-fnd-aap-ppl:Person ; sh:message "pwm:instructionPrincipal: minimum count 1, maximum count 1, class fibo-fnd-aap-ppl:Person." ] ;
    sh:property [ sh:path pwm:assuranceLevel ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:assuranceLevel: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:assuranceLevel ; sh:in ( "channel-only" "authenticated" "step-up" ) ; sh:message "pwm:assuranceLevel: allowed values ( 'channel-only' 'authenticated' 'step-up' )." ] ;
    sh:property [ sh:path pwm:transactionContext ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:transactionContext: minimum count 1, maximum count 1, datatype xsd:string." ] .

pwmsh:InstructionAssuranceShape a sh:NodeShape ; rdfs:label "InstructionAssuranceShape"@en ; sh:targetSubjectsOf pwm:requiresStepUp ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 7. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Allowed high-risk instructions require signed step-up evidence and a completed approval of a held decision in the same run, strictly before the allowed decision (Kognita 0.5 item 7)." ;
        sh:select """SELECT DISTINCT $this WHERE { $this pwm:requiresStepUp true ; pwm:decisionOutcome pwm:OutcomeAllow . FILTER NOT EXISTS { $this pwm:instructionEvidence ?i ; pwm:humanApproval ?approval . ?i pwm:assuranceLevel "step-up" ; pwm:signatureReference ?signature . ?approval pwm:approvalResolution pwm:ApprovalApproved ; pwm:resolvesApproval ?request . ?request a pwm:ApprovalRequest ; pwm:requestsDecision ?held ; pwm:atCheckpoint ?checkpoint . ?held pwm:decisionOutcome pwm:OutcomeHumanApproval ; pwm:inRun ?run ; pwm:underUseCase ?approvalUseCase ; pwm:decidedByRule ?approvalRule . ?checkpoint pwm:inRun ?run ; pwm:runState pwm:RunSuspended . $this pwm:inRun ?run ; pwm:underUseCase ?approvalUseCase ; pwm:decidedByRule ?approvalRule ; prov:generatedAtTime ?decisionAt . ?approval prov:generatedAtTime ?approvedAt . FILTER(?approvedAt < ?decisionAt) } }""" ] .

pwmsh:BehaviorBaselineShape a sh:NodeShape ; rdfs:label "BehaviorBaselineShape"@en ; sh:targetClass pwm:BehaviorBaseline ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 8. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:baselineAgent ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AIAgent ; sh:message "pwm:baselineAgent: minimum count 1, maximum count 1, class pwm:AIAgent." ] ;
    sh:property [ sh:path pwm:versionId ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:versionId: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:baselineMetric ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:baselineMetric: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:baselineExpected ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:baselineExpected: minimum count 1, maximum count 1, datatype xsd:decimal." ] ;
    sh:property [ sh:path pwm:anomalyThreshold ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:anomalyThreshold: minimum count 1, maximum count 1, datatype xsd:decimal." ] ;
    sh:property [ sh:path pwm:windowStart ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:windowStart: minimum count 1, maximum count 1, datatype xsd:dateTime." ] ;
    sh:property [ sh:path pwm:windowEnd ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:windowEnd: minimum count 1, maximum count 1, datatype xsd:dateTime." ] .

pwmsh:BehaviorAnomalyShape a sh:NodeShape ; rdfs:label "BehaviorAnomalyShape"@en ; sh:targetClass pwm:BehaviorAnomaly ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 8. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:anomalyBaseline ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:BehaviorBaseline ; sh:message "pwm:anomalyBaseline: minimum count 1, maximum count 1, class pwm:BehaviorBaseline." ] ;
    sh:property [ sh:path pwm:anomalyValue ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:anomalyValue: minimum count 1, maximum count 1, datatype xsd:decimal." ] ;
    sh:property [ sh:path pwm:containmentApplied ; sh:hasValue true ; sh:message "pwm:containmentApplied: required value true." ] ;
    sh:property [ sh:path pwm:anomalyIncident ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AIIncident ; sh:message "pwm:anomalyIncident: minimum count 1, maximum count 1, class pwm:AIIncident." ] ;
    sh:property [ sh:path pwm:notifiedRole ; sh:minCount 1 ; sh:class pwm:AccountabilityRole ; sh:message "pwm:notifiedRole: minimum count 1, class pwm:AccountabilityRole." ] .

pwmsh:CapabilityGrantShape a sh:NodeShape ; rdfs:label "CapabilityGrantShape"@en ; sh:targetClass pwm:CapabilityGrant ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 10. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:grantee ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AIAgent ; sh:message "pwm:grantee: minimum count 1, maximum count 1, class pwm:AIAgent." ] ;
    sh:property [ sh:path pwm:grantedCapability ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:Tool ; sh:message "pwm:grantedCapability: minimum count 1, maximum count 1, class pwm:Tool." ] ;
    sh:property [ sh:path pwm:authorityScope ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AuthorityScope ; sh:message "pwm:authorityScope: minimum count 1, maximum count 1, class pwm:AuthorityScope." ] ;
    sh:property [ sh:path pwm:validFrom ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:validFrom: minimum count 1, maximum count 1, datatype xsd:dateTime." ] ;
    sh:property [ sh:path pwm:validUntil ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:validUntil: minimum count 1, maximum count 1, datatype xsd:dateTime." ] ;
    sh:property [ sh:path pwm:validFrom ; sh:lessThan pwm:validUntil ; sh:message "pwm:validFrom: must be earlier or lower than pwm:validUntil." ] .

pwmsh:LiveGrantShape a sh:NodeShape ; rdfs:label "LiveGrantShape"@en ; sh:targetSubjectsOf pwm:reliesOnGrant ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 10. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Used capability grants must match agent and tool and remain unexpired and unrevoked (Kognita 0.5 item 10)." ;
        sh:select """SELECT DISTINCT $this WHERE { $this pwm:reliesOnGrant ?g ; pwm:governedByDecision ?d . ?d pwm:decisionOutcome ?out . FILTER(?out != pwm:OutcomeDeny)
 FILTER NOT EXISTS { $this pwm:callAgent ?a ; pwm:invokedTool ?tool . ?g pwm:grantee ?a ; pwm:grantedCapability ?tool ; pwm:validFrom ?s ; pwm:validUntil ?e . ?d <http://www.w3.org/ns/prov#generatedAtTime> ?at . FILTER(?at >= ?s && ?at < ?e) FILTER NOT EXISTS { ?r pwm:revokedAuthority ?g ; pwm:revokedAt ?rt . FILTER(?rt <= ?at) } } }""" ] .

pwmsh:AgentFleetShape a sh:NodeShape ; rdfs:label "AgentFleetShape"@en ; sh:targetClass pwm:AgentFleet ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 11. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:fleetMember ; sh:minCount 1 ; sh:class pwm:AIAgent ; sh:message "pwm:fleetMember: minimum count 1, class pwm:AIAgent." ] ;
    sh:property [ sh:path pwm:fleetQuota ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:positiveInteger ; sh:message "pwm:fleetQuota: minimum count 1, maximum count 1, datatype xsd:positiveInteger." ] ;
    sh:property [ sh:path pwm:fleetIsolation ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:fleetIsolation: minimum count 1, maximum count 1, datatype xsd:string." ] .

pwmsh:FleetHaltShape a sh:NodeShape ; rdfs:label "FleetHaltShape"@en ; sh:targetClass pwm:FleetHalt ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 11. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:haltScope ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AgentFleet ; sh:message "pwm:haltScope: minimum count 1, maximum count 1, class pwm:AgentFleet." ] ;
    sh:property [ sh:path prov:generatedAtTime ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "prov:generatedAtTime: minimum count 1, maximum count 1, datatype xsd:dateTime." ] ;
    sh:property [ sh:path pwm:rationale ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:rationale: minimum count 1, maximum count 1, datatype xsd:string." ] .

pwmsh:SandboxConstraintsShape a sh:NodeShape ; rdfs:label "SandboxConstraintsShape"@en ; sh:targetClass pwm:SandboxConstraints ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 12. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:filesystemScope ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:filesystemScope: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:permitsExport ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:permitsExport: minimum count 1, maximum count 1, datatype xsd:boolean." ] ;
    sh:property [ sh:path pwm:permitsPersistence ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:permitsPersistence: minimum count 1, maximum count 1, datatype xsd:boolean." ] ;
    sh:property [ sh:path pwm:autoStopSeconds ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:autoStopSeconds: minimum count 1, maximum count 1, datatype xsd:decimal." ] ;
    sh:property [ sh:path pwm:cpuSeconds ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:cpuSeconds: minimum count 1, maximum count 1, datatype xsd:decimal." ] ;
    sh:property [ sh:path pwm:memoryBytes ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "pwm:memoryBytes: minimum count 1, maximum count 1, datatype xsd:nonNegativeInteger." ] ;
    sh:property [ sh:path pwm:diskBytes ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "pwm:diskBytes: minimum count 1, maximum count 1, datatype xsd:nonNegativeInteger." ] ;
    sh:property [ sh:path pwm:autoStopSeconds ; sh:minExclusive 0 ; sh:message "pwm:autoStopSeconds: minimum exclusive 0." ] ;
    sh:property [ sh:path pwm:cpuSeconds ; sh:minExclusive 0 ; sh:message "pwm:cpuSeconds: minimum exclusive 0." ] .

pwmsh:ReversibilityShape a sh:NodeShape ; rdfs:label "ReversibilityShape"@en ; sh:targetClass pwm:Tool ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 13. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:reversibilityClass ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:reversibilityClass: minimum count 1, maximum count 1." ] ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Reversible and compensatable tools register a compensating action (Kognita 0.5 item 13)." ;
        sh:select """SELECT DISTINCT $this WHERE { $this pwm:reversibilityClass ?r . FILTER(?r IN (pwm:Reversible,pwm:Compensatable)) FILTER NOT EXISTS { $this pwm:compensatingAction ?action . ?action a pwm:CompensatingAction } }""" ] .

pwmsh:IrreversibleApprovalShape a sh:NodeShape ; rdfs:label "IrreversibleApprovalShape"@en ; sh:targetClass pwm:ToolCall ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 13. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "High-autonomy irreversible action requires human approval resolving a held HUMAN_APPROVAL decision at a suspended checkpoint in the call's run, strictly before the call (Kognita 0.5 item 13)." ;
        sh:select """SELECT DISTINCT $this WHERE { $this pwm:invokedTool ?t ; pwm:callAgent ?a ; pwm:governedByDecision ?d . ?t pwm:reversibilityClass pwm:Irreversible . ?a pwm:maxAutonomyLevel ?max . OPTIONAL { ?a pwm:effectiveAutonomyLevel ?effective } BIND(COALESCE(?effective, ?max) AS ?l) FILTER(?l IN (pwm:L5BoundedAutonomy,pwm:L6BroadAutonomy)) ?d pwm:decisionOutcome pwm:OutcomeAllow . FILTER NOT EXISTS { ?d pwm:humanApproval ?approval . ?approval pwm:approvalResolution pwm:ApprovalApproved ; pwm:resolvesApproval ?request . ?request a pwm:ApprovalRequest ; pwm:requestsDecision ?held ; pwm:atCheckpoint ?checkpoint . ?held pwm:decisionOutcome pwm:OutcomeHumanApproval ; pwm:inRun ?run ; pwm:underUseCase ?approvalUseCase ; pwm:decidedByRule ?approvalRule . ?checkpoint pwm:inRun ?run ; pwm:runState pwm:RunSuspended . ?d pwm:inRun ?run ; pwm:underUseCase ?approvalUseCase ; pwm:decidedByRule ?approvalRule . $this pwm:inRun ?run . ?approval prov:generatedAtTime ?approvedAt . $this prov:generatedAtTime ?calledAt . FILTER(?approvedAt < ?calledAt) } }""" ] .

pwmsh:AdversarialTestShape a sh:NodeShape ; rdfs:label "AdversarialTestShape"@en ; sh:targetClass pwm:AdversarialTestCase ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 14. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:threatModel ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:ThreatModel ; sh:message "pwm:threatModel: minimum count 1, maximum count 1, class pwm:ThreatModel." ] ;
    sh:property [ sh:path pwm:attackKind ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:attackKind: minimum count 1, maximum count 1, datatype xsd:string." ] .

pwmsh:ThreatModelShape a sh:NodeShape ; rdfs:label "ThreatModelShape"@en ; sh:targetClass pwm:ThreatModel ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 14. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:versionId ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:versionId: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:threatModelReference ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:anyURI ; sh:message "pwm:threatModelReference: minimum count 1, maximum count 1, datatype xsd:anyURI." ] .

pwmsh:EnforcementAttestationShape a sh:NodeShape ; rdfs:label "EnforcementAttestationShape"@en ; sh:targetClass pwm:EnforcementAttestation ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 15. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:attestedUseCase ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AIUseCase ; sh:message "pwm:attestedUseCase: minimum count 1, maximum count 1, class pwm:AIUseCase." ] ;
    sh:property [ sh:path prov:generatedAtTime ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "prov:generatedAtTime: minimum count 1, maximum count 1, datatype xsd:dateTime." ] ;
    sh:property [ sh:path prov:wasAttributedTo ; sh:minCount 1 ; sh:maxCount 1 ; sh:class fibo-fnd-aap-ppl:Person ; sh:message "prov:wasAttributedTo: minimum count 1, maximum count 1, class fibo-fnd-aap-ppl:Person." ] ;
    sh:property [ sh:path pwm:gatewayOnlyCredentials ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:gatewayOnlyCredentials: minimum count 1, maximum count 1, datatype xsd:boolean." ] ;
    sh:property [ sh:path pwm:egressRestricted ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:egressRestricted: minimum count 1, maximum count 1, datatype xsd:boolean." ] ;
    sh:property [ sh:path pwm:evidenceStoreIsolated ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:evidenceStoreIsolated: minimum count 1, maximum count 1, datatype xsd:boolean." ] .

pwmsh:DeploymentEnforcementShape a sh:NodeShape ; rdfs:label "DeploymentEnforcementShape"@en ; sh:targetClass pwm:AIUseCase ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 15. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:deploymentMode ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:deploymentMode: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:deploymentMode ; sh:in ( "gateway" "library" ) ; sh:message "pwm:deploymentMode: allowed values ( 'gateway' 'library' )." ] ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Tier 2 or above requires gateway mode and attestation of isolated credentials, routing and evidence (Kognita 0.5 item 15)." ;
        sh:select """SELECT DISTINCT $this WHERE { $this pwm:riskTier ?tier . FILTER(?tier IN (pwm:Tier2,pwm:Tier3,pwm:Tier4)) FILTER NOT EXISTS { $this pwm:deploymentMode "gateway" ; pwm:enforcementAttestation ?a . ?a pwm:attestedUseCase $this ; pwm:gatewayOnlyCredentials true ; pwm:egressRestricted true ; pwm:evidenceStoreIsolated true } }""" ] .

pwmsh:BoundedToolShape a sh:NodeShape ; rdfs:label "BoundedToolShape"@en ; sh:targetClass pwm:Tool ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 16. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:maximumDurationSeconds ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:maximumDurationSeconds: minimum count 1, maximum count 1, datatype xsd:decimal." ] ;
    sh:property [ sh:path pwm:maximumDurationSeconds ; sh:minExclusive 0 ; sh:message "pwm:maximumDurationSeconds: minimum exclusive 0." ] ;
    sh:property [ sh:path pwm:supportsCancellation ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:supportsCancellation: minimum count 1, maximum count 1, datatype xsd:boolean." ] ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Uncancellable tools need compensation or steps with intervening decisions (Kognita 0.5 item 16)." ;
        sh:select """SELECT DISTINCT $this WHERE { $this pwm:supportsCancellation false . FILTER NOT EXISTS { $this pwm:compensatingAction ?a } FILTER NOT EXISTS { $this pwm:decisionSeparatedSteps true } }""" ] .

pwmsh:ActionStopShape a sh:NodeShape ; rdfs:label "ActionStopShape"@en ; sh:targetClass pwm:ActionStop ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 16. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:stoppedCall ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:ToolCall ; sh:message "pwm:stoppedCall: minimum count 1, maximum count 1, class pwm:ToolCall." ] ;
    sh:property [ sh:path pwm:stopOutcome ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:stopOutcome: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:stopOutcome ; sh:in ( "canceled" "completed" "timed-out" "unsupported" ) ; sh:message "pwm:stopOutcome: allowed values ( 'canceled' 'completed' 'timed-out' 'unsupported' )." ] ;
    sh:property [ sh:path pwm:stopReason ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:stopReason: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path prov:generatedAtTime ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "prov:generatedAtTime: minimum count 1, maximum count 1, datatype xsd:dateTime." ] .

pwmsh:AuthorityRequestScopeShape a sh:NodeShape ; rdfs:label "AuthorityRequestScopeShape"@en ; sh:targetClass pwm:ToolCall ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 2. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "A live delegation must authorize this tool, every declared tool verb, purpose, client, fields, exactly one jurisdictionCode and exactly one classification at or below the scope ceiling by rank (Kognita 0.5 item 2)." ;
        sh:select """SELECT DISTINCT $this WHERE { $this pwm:callAgent ?a ; pwm:invokedTool ?tool ; pwm:governedByDecision ?d . ?d pwm:decisionOutcome ?out . FILTER(?out != pwm:OutcomeDeny)
 FILTER NOT EXISTS { $this pwm:reliesOnDelegation/pwm:authorityScope ?s ; pwm:aboutClient ?client . ?tool pwm:actionVerb ?verb .
 ?s pwm:scopeTool ?tool ; pwm:aboutClient ?client .
 FILTER NOT EXISTS { ?tool pwm:actionVerb ?declaredVerb . FILTER NOT EXISTS { ?s pwm:actionVerb ?declaredVerb } } ?d pwm:hasPurpose ?purpose . ?s pwm:hasPurpose ?purpose .
 FILTER NOT EXISTS { $this pwm:requestedField ?field . FILTER NOT EXISTS { ?s pwm:scopeField ?field } }
 $this pwm:jurisdictionCode ?j ; pwm:classification ?c . ?s pwm:jurisdictionCode ?j ; pwm:classification ?ceiling .
 FILTER NOT EXISTS { $this pwm:jurisdictionCode ?otherJ . FILTER(!sameTerm(?otherJ, ?j)) }
 FILTER NOT EXISTS { $this pwm:classification ?otherC . FILTER(!sameTerm(?otherC, ?c)) }
 FILTER(?c IN (pwm:C0,pwm:C1,pwm:C2,pwm:C3) && ?ceiling IN (pwm:C0,pwm:C1,pwm:C2,pwm:C3))
 BIND(IF(?c = pwm:C0,0,IF(?c = pwm:C1,1,IF(?c = pwm:C2,2,3))) AS ?rank)
 BIND(IF(?ceiling = pwm:C0,0,IF(?ceiling = pwm:C1,1,IF(?ceiling = pwm:C2,2,3))) AS ?ceilingRank)
 FILTER(?rank <= ?ceilingRank)
 } }""" ] .

pwmsh:ScopeNarrowingLimitsShape a sh:NodeShape ; rdfs:label "ScopeNarrowingLimitsShape"@en ; sh:targetSubjectsOf pwm:parentDelegation ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 9. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Sub-delegation retains all parent numeric caps and may not increase autonomy (Kognita 0.5 item 9)." ;
        sh:select """SELECT DISTINCT $this WHERE { $this pwm:parentDelegation ?p ; pwm:authorityScope ?s . ?p pwm:authorityScope ?ps .
 { ?ps pwm:scopeLimit ?limit . ?limit pwm:limitDimension ?dim ; pwm:limitWindowBasis ?basis ; pwm:limitUnit ?unit ; pwm:limitMaximum ?max .
 FILTER NOT EXISTS { ?s pwm:scopeLimit ?cl . ?cl pwm:limitDimension ?dim ; pwm:limitWindowBasis ?basis ; pwm:limitUnit ?unit ; pwm:limitMaximum ?cm . FILTER(?cm <= ?max) } }
 UNION { ?ps pwm:scopeAutonomyLevel ?pl . FILTER NOT EXISTS { ?s pwm:scopeAutonomyLevel ?sl . FILTER(IF(?sl = pwm:L0Retrieve, 0, IF(?sl = pwm:L1Explain, 1, IF(?sl = pwm:L2Recommend, 2, IF(?sl = pwm:L3Draft, 3, IF(?sl = pwm:L4ActAfterApproval, 4, IF(?sl = pwm:L5BoundedAutonomy, 5, IF(?sl = pwm:L6BroadAutonomy, 6, 99))))))) <= IF(?pl = pwm:L0Retrieve, 0, IF(?pl = pwm:L1Explain, 1, IF(?pl = pwm:L2Recommend, 2, IF(?pl = pwm:L3Draft, 3, IF(?pl = pwm:L4ActAfterApproval, 4, IF(?pl = pwm:L5BoundedAutonomy, 5, IF(?pl = pwm:L6BroadAutonomy, 6, 99)))))))) } } }""" ] .

pwmsh:AutonomyCallShape a sh:NodeShape ; rdfs:label "AutonomyCallShape"@en ; sh:targetClass pwm:ToolCall ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 3. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Calls cannot exceed effective or maximum autonomy or the delegated scope ceiling; L4 routes to human approval (Kognita 0.5 item 3)." ;
        sh:select """SELECT DISTINCT $this WHERE { $this pwm:callAgent ?a ; pwm:invokedTool ?t ; pwm:governedByDecision ?d . ?d pwm:decisionOutcome ?out . FILTER(?out != pwm:OutcomeDeny)
 ?t pwm:requiredAutonomyLevel ?tl . ?a pwm:maxAutonomyLevel ?max . OPTIONAL { ?a pwm:effectiveAutonomyLevel ?effective } BIND(COALESCE(?effective,?max) AS ?al)
 OPTIONAL { $this pwm:reliesOnDelegation/pwm:authorityScope/pwm:scopeAutonomyLevel ?scopeLevel }
 FILTER((BOUND(?scopeLevel) && IF(?tl = pwm:L0Retrieve, 0, IF(?tl = pwm:L1Explain, 1, IF(?tl = pwm:L2Recommend, 2, IF(?tl = pwm:L3Draft, 3, IF(?tl = pwm:L4ActAfterApproval, 4, IF(?tl = pwm:L5BoundedAutonomy, 5, IF(?tl = pwm:L6BroadAutonomy, 6, 99))))))) > IF(?scopeLevel = pwm:L0Retrieve, 0, IF(?scopeLevel = pwm:L1Explain, 1, IF(?scopeLevel = pwm:L2Recommend, 2, IF(?scopeLevel = pwm:L3Draft, 3, IF(?scopeLevel = pwm:L4ActAfterApproval, 4, IF(?scopeLevel = pwm:L5BoundedAutonomy, 5, IF(?scopeLevel = pwm:L6BroadAutonomy, 6, 99)))))))) || IF(?tl = pwm:L0Retrieve, 0, IF(?tl = pwm:L1Explain, 1, IF(?tl = pwm:L2Recommend, 2, IF(?tl = pwm:L3Draft, 3, IF(?tl = pwm:L4ActAfterApproval, 4, IF(?tl = pwm:L5BoundedAutonomy, 5, IF(?tl = pwm:L6BroadAutonomy, 6, 99))))))) > IF(?al = pwm:L0Retrieve, 0, IF(?al = pwm:L1Explain, 1, IF(?al = pwm:L2Recommend, 2, IF(?al = pwm:L3Draft, 3, IF(?al = pwm:L4ActAfterApproval, 4, IF(?al = pwm:L5BoundedAutonomy, 5, IF(?al = pwm:L6BroadAutonomy, 6, 99))))))) || (?tl = pwm:L4ActAfterApproval && ?out NOT IN (pwm:OutcomeHumanApproval,pwm:OutcomeDeny)) || IF(?al = pwm:L0Retrieve, 0, IF(?al = pwm:L1Explain, 1, IF(?al = pwm:L2Recommend, 2, IF(?al = pwm:L3Draft, 3, IF(?al = pwm:L4ActAfterApproval, 4, IF(?al = pwm:L5BoundedAutonomy, 5, IF(?al = pwm:L6BroadAutonomy, 6, 99))))))) > IF(?max = pwm:L0Retrieve, 0, IF(?max = pwm:L1Explain, 1, IF(?max = pwm:L2Recommend, 2, IF(?max = pwm:L3Draft, 3, IF(?max = pwm:L4ActAfterApproval, 4, IF(?max = pwm:L5BoundedAutonomy, 5, IF(?max = pwm:L6BroadAutonomy, 6, 99)))))))) }""" ] .

pwmsh:FleetHaltDecisionShape a sh:NodeShape ; rdfs:label "FleetHaltDecisionShape"@en ; sh:targetClass pwm:GovernedCall ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 11. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "A halted fleet member must be denied on the next decision (Kognita 0.5 item 11)." ;
        sh:select """SELECT DISTINCT $this WHERE { $this pwm:callAgent ?a ; pwm:governedByDecision ?d . ?d pwm:decisionOutcome ?out ; <http://www.w3.org/ns/prov#generatedAtTime> ?at . FILTER(?out != pwm:OutcomeDeny)
 ?halt pwm:haltScope/pwm:fleetMember ?a ; <http://www.w3.org/ns/prov#generatedAtTime> ?ht . FILTER(?ht <= ?at) }""" ] .

pwmsh:ToolDurationShape a sh:NodeShape ; rdfs:label "ToolDurationShape"@en ; sh:targetSubjectsOf pwm:callDurationSeconds ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 16. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:callDurationSeconds ; sh:datatype xsd:decimal ; sh:minInclusive 0 ; sh:maxCount 1 ; sh:message "pwm:callDurationSeconds: maximum count 1, datatype xsd:decimal, minimum inclusive 0." ] ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "A call beyond maximum duration needs an evidenced timeout (Kognita 0.5 item 16)." ;
        sh:select """SELECT DISTINCT $this WHERE { $this pwm:callDurationSeconds ?n ; pwm:invokedTool/pwm:maximumDurationSeconds ?max . FILTER(?n > ?max) FILTER NOT EXISTS { ?stop pwm:stoppedCall $this ; pwm:stopOutcome "timed-out" } }""" ] .

pwmsh:ExclusiveWorkloadShape a sh:NodeShape ; rdfs:label "Exclusive workload identity"@en ; sh:targetClass pwm:AIAgent ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 1: credentials are never shared between agents."@en ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "Each registered agent has its own workload identity (Kognita 0.5 item 1)." ;
        sh:select """SELECT DISTINCT $this WHERE { $this pwm:workloadIdentity ?i . ?other a pwm:AIAgent ; pwm:workloadIdentity ?i . FILTER(?other != $this) }""" ] .

# Review additions, 4 Nov 2026.
pwmsh:DelegationCeilingShape a sh:NodeShape ; rdfs:label "DelegationCeilingShape"@en ; sh:targetClass pwm:DelegatedAuthority ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 2. The permitted data class is the delegation's ceiling. Classes C0 to C3 are compared by their IRIs, which sort in rank order. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "A delegation's permitted data class must cover the classification of its authority scope, and a child delegation cannot permit a higher class than its parent (Kognita 0.5 item 2)." ;
        sh:select """SELECT DISTINCT $this WHERE {
            { $this pwm:permitsDataClass ?c ; pwm:authorityScope ?s . ?s pwm:classification ?sc . FILTER(STR(?c) < STR(?sc)) }
            UNION { $this pwm:permitsDataClass ?c ; pwm:parentDelegation ?p . ?p pwm:permitsDataClass ?pc . FILTER(STR(?c) > STR(?pc)) } }""" ] .

pwmsh:AgentAutonomyShape a sh:NodeShape ; rdfs:label "AgentAutonomyShape"@en ; sh:targetClass pwm:AIAgent ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.5 item 3. Levels L0 to L6 are compared by their IRIs, which sort in rank order. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ; sh:message "An agent's effective autonomy level cannot exceed its maximum autonomy level (Kognita 0.5 item 3)." ;
        sh:select """SELECT DISTINCT $this WHERE { $this pwm:effectiveAutonomyLevel ?e ; pwm:maxAutonomyLevel ?m . FILTER(STR(?e) > STR(?m)) }""" ] .

pwmsh:RiskControlApprovalShape a sh:NodeShape ; rdfs:label "RiskControlApprovalShape"@en ;
    sh:targetClass pwm:BlastRadiusLimit, pwm:AutonomyPromotionGate ; dcterms:source pwmref:KOG-ROADMAP, pwmref:MAS-AIRG ;
    rdfs:comment "Firm-specific limits and gates must be set and approved by the risk committee, data governance committee or chief risk officer (Ahmed, 3 Nov 2026)."@en ;
    sh:property [ sh:path pwm:riskControlApproval ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:RiskControlApproval ; sh:message "pwm:riskControlApproval: minimum count 1, maximum count 1, class pwm:RiskControlApproval." ] .

pwmsh:RiskControlApprovalRecordShape a sh:NodeShape ; rdfs:label "RiskControlApprovalRecordShape"@en ;
    sh:targetClass pwm:RiskControlApproval ; dcterms:source pwmref:KOG-ROADMAP, pwmref:MAS-AIRG ;
    rdfs:comment "Approval records identify a permitted firm approving role and approval time (Ahmed, 3 Nov 2026)."@en ;
    sh:property [ sh:path pwm:approverRole ; sh:minCount 1 ; sh:maxCount 1 ; sh:or ( [ sh:class pwm:RiskCommittee ] [ sh:class pwm:DataGovernanceCommittee ] [ sh:class pwm:ChiefRiskOfficer ] ) ; sh:message "Record exactly one approverRole: RiskCommittee, DataGovernanceCommittee or ChiefRiskOfficer." ] ;
    sh:property [ sh:path pwm:approvedAt ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:approvedAt: minimum count 1, maximum count 1, datatype xsd:dateTime." ] .

# BEGIN GENERATED CODE-LIST SHAPES (tools/build.py writes this block from pwm:valuesFrom; do not edit)

pwmsh:CodeList_actionVerb a sh:NodeShape ;
    rdfs:label "Code list: action verb"@en ;
    sh:targetSubjectsOf pwm:actionVerb ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:actionVerb ; sh:in ( pwm:VerbAnalyze pwm:VerbDraft pwm:VerbExecute pwm:VerbQueue pwm:VerbRead pwm:VerbRecommend pwm:VerbSend ) ;
        sh:message "Use a code from action verbs (pwm:ActionVerbScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_actorType a sh:NodeShape ;
    rdfs:label "Code list: actor type"@en ;
    sh:targetSubjectsOf pwm:actorType ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:actorType ; sh:in ( pwm:ActorAgent pwm:ActorHuman pwm:ActorSystem ) ;
        sh:message "Use a code from actor types (pwm:ActorTypeScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_agentStatus a sh:NodeShape ;
    rdfs:label "Code list: agent status"@en ;
    sh:targetSubjectsOf pwm:agentStatus ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:agentStatus ; sh:in ( pwm:StatusLive pwm:StatusPilot pwm:StatusRetired pwm:StatusSuspended ) ;
        sh:message "Use a code from use-case lifecycle statuses (pwm:UseCaseStatusScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_amlRiskLevel a sh:NodeShape ;
    rdfs:label "Code list: AML risk level"@en ;
    sh:targetSubjectsOf pwm:amlRiskLevel ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:amlRiskLevel ; sh:in ( pwm:AMLHigh pwm:AMLLow pwm:AMLMedium pwm:AMLOutsideAppetite ) ;
        sh:message "Use a code from AML risk levels (pwm:AMLRiskLevelScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_appliesToActivity a sh:NodeShape ;
    rdfs:label "Code list: applies to activity"@en ;
    sh:targetSubjectsOf pwm:appliesToActivity ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:appliesToActivity ; sh:in ( pwm:ActivityAdvice pwm:ActivityExecution pwm:ActivityMarketing pwm:ActivityResearchDistribution pwm:ActivityReverseEnquiry pwm:ActivitySolicitation ) ;
        sh:message "Use a code from cross-border activities (pwm:CrossBorderActivityScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_appliesToInvestorCategory a sh:NodeShape ;
    rdfs:label "Code list: applies to investor category"@en ;
    sh:targetSubjectsOf pwm:appliesToInvestorCategory ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:appliesToInvestorCategory ; sh:in ( pwm:AccreditedInvestorSG pwm:AccreditedInvestorUS pwm:EligibleCounterpartyEU pwm:ExpertInvestorSG pwm:InstitutionalClientCH pwm:InstitutionalInvestorSG pwm:NonRetailCategory pwm:PrivateClientCH pwm:ProfessionalClientCH pwm:ProfessionalClientEU pwm:ProfessionalClientUK pwm:ProfessionalInvestorHK pwm:RetailCategory pwm:RetailClientEU pwm:RetailClientUK pwm:RetailInvestorSG ) ;
        sh:message "Use a code from investor categories (pwm:InvestorCategoryScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_approvalRequestStatus a sh:NodeShape ;
    rdfs:label "Code list: approval request status"@en ;
    sh:targetSubjectsOf pwm:approvalRequestStatus ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:approvalRequestStatus ; sh:in ( pwm:ApprovalExpired pwm:ApprovalMarked pwm:ApprovalPending pwm:ApprovalRejected pwm:ApprovalStatusApproved ) ;
        sh:message "Use a code from approval request statuses (pwm:ApprovalStatusScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_approvalResolution a sh:NodeShape ;
    rdfs:label "Code list: approval resolution"@en ;
    sh:targetSubjectsOf pwm:approvalResolution ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:approvalResolution ; sh:in ( pwm:ApprovalApproved pwm:ApprovalDenied ) ;
        sh:message "Use a code from approval resolutions (pwm:ApprovalResolutionScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_approvalStatus a sh:NodeShape ;
    rdfs:label "Code list: approval status"@en ;
    sh:targetSubjectsOf pwm:approvalStatus ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:approvalStatus ; sh:in ( pwm:AssetCurrent pwm:AssetDraft pwm:AssetSuperseded pwm:AssetWithdrawn ) ;
        sh:message "Use a code from information asset statuses (pwm:AssetStatusScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_attestationKind a sh:NodeShape ;
    rdfs:label "Code list: attestation kind"@en ;
    sh:targetSubjectsOf pwm:attestationKind ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:attestationKind ; sh:in ( pwm:AttestationEnvironment pwm:AttestationInstruction pwm:AttestationMonitoring pwm:AttestationPrivacy pwm:AttestationTransfer ) ;
        sh:message "Use a code from attestation kinds (pwm:AttestationKindScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_attributeSource a sh:NodeShape ;
    rdfs:label "Code list: attribute source"@en ;
    sh:targetSubjectsOf pwm:attributeSource ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:attributeSource ; sh:in ( pwm:AttributeClassifierDerived pwm:AttributeTyped ) ;
        sh:message "Use a code from attribute sources (pwm:AttributeSourceScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_autonomyAxis a sh:NodeShape ;
    rdfs:label "Code list: autonomy axis"@en ;
    sh:targetSubjectsOf pwm:autonomyAxis ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:autonomyAxis ; sh:in ( pwm:AutonomyAssisted pwm:AutonomyConditional pwm:AutonomyHigh pwm:AutonomyNone ) ;
        sh:message "Use a code from use-case autonomy axis (pwm:AutonomyAxisScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_boundaryTier a sh:NodeShape ;
    rdfs:label "Code list: boundary tier"@en ;
    sh:targetSubjectsOf pwm:boundaryTier ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:boundaryTier ; sh:in ( pwm:AlwaysDo pwm:AskFirst pwm:NeverDo ) ;
        sh:message "Use a code from boundary tiers (pwm:BoundaryTierScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_businessCriticality a sh:NodeShape ;
    rdfs:label "Code list: business criticality"@en ;
    sh:targetSubjectsOf pwm:businessCriticality ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:businessCriticality ; sh:in ( pwm:RatingCritical pwm:RatingHigh pwm:RatingLow pwm:RatingMedium ) ;
        sh:message "Use a code from rating levels (pwm:RatingLevelScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_capacityForLoss a sh:NodeShape ;
    rdfs:label "Code list: capacity for loss"@en ;
    sh:targetSubjectsOf pwm:capacityForLoss ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:capacityForLoss ; sh:in ( pwm:RatingCritical pwm:RatingHigh pwm:RatingLow pwm:RatingMedium ) ;
        sh:message "Use a code from rating levels (pwm:RatingLevelScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_checkResult a sh:NodeShape ;
    rdfs:label "Code list: check result"@en ;
    sh:targetSubjectsOf pwm:checkResult ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:checkResult ; sh:in ( pwm:CheckEscalate pwm:CheckFail pwm:CheckPass pwm:CheckRequiresHuman ) ;
        sh:message "Use a code from check results (pwm:CheckResultScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_claimType a sh:NodeShape ;
    rdfs:label "Code list: claim type"@en ;
    sh:targetSubjectsOf pwm:claimType ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:claimType ; sh:in ( pwm:ConversationHypothesis pwm:Inference pwm:PossibleBankCapability pwm:VerifiedFact ) ;
        sh:message "Use a code from claim types (pwm:ClaimTypeScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_classification a sh:NodeShape ;
    rdfs:label "Code list: classification"@en ;
    sh:targetSubjectsOf pwm:classification ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:classification ; sh:in ( pwm:C0 pwm:C1 pwm:C2 pwm:C3 ) ;
        sh:message "Use a code from data classifications (pwm:DataClassificationScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_classificationCeiling a sh:NodeShape ;
    rdfs:label "Code list: classification ceiling"@en ;
    sh:targetSubjectsOf pwm:classificationCeiling ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:classificationCeiling ; sh:in ( pwm:C0 pwm:C1 pwm:C2 pwm:C3 ) ;
        sh:message "Use a code from data classifications (pwm:DataClassificationScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_clientImpactClass a sh:NodeShape ;
    rdfs:label "Code list: client-impact class"@en ;
    sh:targetSubjectsOf pwm:clientImpactClass ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:clientImpactClass ; sh:in ( pwm:ImpactAdvice pwm:ImpactClientCommunication pwm:ImpactClientInfluence pwm:ImpactExecution pwm:ImpactInternalProductivity pwm:ImpactRMAssistance ) ;
        sh:message "Use a code from client-impact classes (pwm:ClientImpactClassScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_communicationLevel a sh:NodeShape ;
    rdfs:label "Code list: communication level"@en ;
    sh:targetSubjectsOf pwm:communicationLevel ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:communicationLevel ; sh:in ( pwm:CommContextualizedInsight pwm:CommGeneralInformation pwm:CommHouseView pwm:CommInvestmentDiscussion pwm:CommProductRecommendation pwm:CommTransaction ) ;
        sh:message "Use a code from communication levels (pwm:CommunicationLevelScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_complaintResolution a sh:NodeShape ;
    rdfs:label "Code list: complaint resolution"@en ;
    sh:targetSubjectsOf pwm:complaintResolution ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:complaintResolution ; sh:in ( pwm:ResolutionNotUpheld pwm:ResolutionPartlyUpheld pwm:ResolutionUpheld pwm:ResolutionWithdrawn ) ;
        sh:message "Use a code from complaint resolutions (pwm:ComplaintResolutionScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_complexity a sh:NodeShape ;
    rdfs:label "Code list: complexity"@en ;
    sh:targetSubjectsOf pwm:complexity ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:complexity ; sh:in ( pwm:RatingCritical pwm:RatingHigh pwm:RatingLow pwm:RatingMedium ) ;
        sh:message "Use a code from rating levels (pwm:RatingLevelScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_concentrationLayer a sh:NodeShape ;
    rdfs:label "Code list: concentration layer"@en ;
    sh:targetSubjectsOf pwm:concentrationLayer ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:concentrationLayer ; sh:in ( pwm:LayerCloud pwm:LayerDataSource pwm:LayerFramework pwm:LayerModelProvider pwm:LayerOrchestration pwm:LayerTool pwm:LayerVectorPlatform ) ;
        sh:message "Use a code from dependency layers (pwm:DependencyLayerScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_conformanceProfile a sh:NodeShape ;
    rdfs:label "Code list: conformance profile"@en ;
    sh:targetSubjectsOf pwm:conformanceProfile ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:conformanceProfile ; sh:in ( pwm:ProfileFCA pwm:ProfileFSB pwm:ProfileHKMAART pwm:ProfileMAS pwm:ProfileOCC pwm:ProfileSEC ) ;
        sh:message "Use a code from supervisory conformance profiles (pwm:ConformanceProfileScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_contentProvenance a sh:NodeShape ;
    rdfs:label "Code list: content provenance"@en ;
    sh:targetSubjectsOf pwm:contentProvenance ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:contentProvenance ; sh:in ( pwm:ProvenanceAI pwm:ProvenanceAIHumanEdited pwm:ProvenanceHuman pwm:ProvenanceHumanAIAssisted ) ;
        sh:message "Use a code from content provenance labels (pwm:ContentProvenanceScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_corporateActionKind a sh:NodeShape ;
    rdfs:label "Code list: corporate action kind"@en ;
    sh:targetSubjectsOf pwm:corporateActionKind ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:corporateActionKind ; sh:in ( pwm:ActionCoupon pwm:ActionDividend pwm:ActionMerger pwm:ActionRedemption pwm:ActionRightsIssue pwm:ActionSplit ) ;
        sh:message "Use a code from corporate action kinds (pwm:CorporateActionKindScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_costCategory a sh:NodeShape ;
    rdfs:label "Code list: cost category"@en ;
    sh:targetSubjectsOf pwm:costCategory ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:costCategory ; sh:in ( pwm:CostAncillary pwm:CostIncidental pwm:CostOneOff pwm:CostOngoing pwm:CostTransaction ) ;
        sh:message "Use a code from cost categories (pwm:CostCategoryScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_coverageRole a sh:NodeShape ;
    rdfs:label "Code list: coverage role"@en ;
    sh:targetSubjectsOf pwm:coverageRole ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:coverageRole ; sh:in ( pwm:CoveragePrimary pwm:CoverageSecondary pwm:CoverageSpecialist ) ;
        sh:message "Use a code from coverage roles (pwm:CoverageRoleScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_coverageStatus a sh:NodeShape ;
    rdfs:label "Code list: coverage status"@en ;
    sh:targetSubjectsOf pwm:coverageStatus ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:coverageStatus ; sh:in ( pwm:QuestionAnswered pwm:QuestionNotRecorded ) ;
        sh:message "Use a code from question coverage statuses (pwm:QuestionCoverageStatusScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_decisionConsequence a sh:NodeShape ;
    rdfs:label "Code list: decision consequence"@en ;
    sh:targetSubjectsOf pwm:decisionConsequence ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:decisionConsequence ; sh:in ( pwm:ConsequenceClientCommunication pwm:ConsequenceFinancialAction pwm:ConsequenceInformational pwm:ConsequenceOperational pwm:ConsequenceSuitability ) ;
        sh:message "Use a code from decision consequences (pwm:DecisionConsequenceScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_decisionOutcome a sh:NodeShape ;
    rdfs:label "Code list: decision outcome"@en ;
    sh:targetSubjectsOf pwm:decisionOutcome ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:decisionOutcome ; sh:in ( pwm:OutcomeAllow pwm:OutcomeDeny pwm:OutcomeEscalate pwm:OutcomeHumanApproval pwm:OutcomeObserve ) ;
        sh:message "Use a code from policy decision outcomes (pwm:DecisionOutcomeScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_decisionResult a sh:NodeShape ;
    rdfs:label "Code list: decision result"@en ;
    sh:targetSubjectsOf pwm:decisionResult ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:decisionResult ; sh:in ( pwm:DecisionApprove pwm:DecisionEscalate pwm:DecisionModify pwm:DecisionReject ) ;
        sh:message "Use a code from final decision results (pwm:DecisionResultScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_dependencyLayer a sh:NodeShape ;
    rdfs:label "Code list: dependency layer"@en ;
    sh:targetSubjectsOf pwm:dependencyLayer ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:dependencyLayer ; sh:in ( pwm:LayerCloud pwm:LayerDataSource pwm:LayerFramework pwm:LayerModelProvider pwm:LayerOrchestration pwm:LayerTool pwm:LayerVectorPlatform ) ;
        sh:message "Use a code from dependency layers (pwm:DependencyLayerScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_disclosureTiming a sh:NodeShape ;
    rdfs:label "Code list: disclosure timing"@en ;
    sh:targetSubjectsOf pwm:disclosureTiming ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:disclosureTiming ; sh:in ( pwm:TimingExAnte pwm:TimingExPost ) ;
        sh:message "Use a code from disclosure timings (pwm:DisclosureTimingScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_disclosureTrigger a sh:NodeShape ;
    rdfs:label "Code list: disclosure trigger"@en ;
    sh:targetSubjectsOf pwm:disclosureTrigger ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:disclosureTrigger ; sh:in ( pwm:TriggerAIGeneratedContent pwm:TriggerAssistedAnalysis pwm:TriggerMaterialContribution pwm:TriggerPowersChatbot ) ;
        sh:message "Use a code from AI disclosure triggers (pwm:DisclosureTriggerScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_divergenceKind a sh:NodeShape ;
    rdfs:label "Code list: divergence kind"@en ;
    sh:targetSubjectsOf pwm:divergenceKind ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:divergenceKind ; sh:in ( pwm:DivergenceUndeclared pwm:DivergenceUnused ) ;
        sh:message "Use a code from dependency divergences (pwm:DependencyDivergenceScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_doNotContactReason a sh:NodeShape ;
    rdfs:label "Code list: do-not-contact reason"@en ;
    sh:targetSubjectsOf pwm:doNotContactReason ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:doNotContactReason ; sh:in ( pwm:DNCExcessiveFrequency pwm:DNCLowRelevance pwm:DNCPoorTiming pwm:DNCRecentRejection pwm:DNCRelationshipCircumstance pwm:DNCVulnerability ) ;
        sh:message "Use a code from do-not-contact reasons (pwm:DoNotContactReasonScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_drillKind a sh:NodeShape ;
    rdfs:label "Code list: drill kind"@en ;
    sh:targetSubjectsOf pwm:drillKind ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:drillKind ; sh:in ( pwm:DrillApiOutage pwm:DrillCompromisedModel pwm:DrillCorruptedContext pwm:DrillIdentityServiceFailure pwm:DrillModelUnavailable pwm:DrillRetrievalFailure pwm:DrillToolFailure pwm:DrillVendorOutage ) ;
        sh:message "Use a code from drill kinds (pwm:DrillKindScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_drillScenario a sh:NodeShape ;
    rdfs:label "Code list: drill scenario"@en ;
    sh:targetSubjectsOf pwm:drillScenario ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:drillScenario ; sh:in ( pwm:ScenarioAgentPrivilegeEscalation pwm:ScenarioCompromisedProvider pwm:ScenarioContainmentRecovery pwm:ScenarioDiscoveredCredentials pwm:ScenarioMachineSpeedProbing pwm:ScenarioMaliciousRetrieval pwm:ScenarioPromptInjection pwm:ScenarioUnauthorizedNetwork ) ;
        sh:message "Use a code from hostile-agent drill scenarios (pwm:DrillScenarioScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_effectiveAutonomyLevel a sh:NodeShape ;
    rdfs:label "Code list: effective autonomy level"@en ;
    sh:targetSubjectsOf pwm:effectiveAutonomyLevel ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:effectiveAutonomyLevel ; sh:in ( pwm:L0Retrieve pwm:L1Explain pwm:L2Recommend pwm:L3Draft pwm:L4ActAfterApproval pwm:L5BoundedAutonomy pwm:L6BroadAutonomy ) ;
        sh:message "Use a code from agent autonomy levels (pwm:AutonomyLevelScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_egressDecision a sh:NodeShape ;
    rdfs:label "Code list: egress decision"@en ;
    sh:targetSubjectsOf pwm:egressDecision ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:egressDecision ; sh:in ( pwm:EgressAllow pwm:EgressDeny pwm:EgressRedact ) ;
        sh:message "Use a code from egress decisions (pwm:EgressDecisionScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_evaluationLevel a sh:NodeShape ;
    rdfs:label "Code list: evaluation level"@en ;
    sh:targetSubjectsOf pwm:evaluationLevel ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:evaluationLevel ; sh:in ( pwm:LevelAgent pwm:LevelModel pwm:LevelSystem ) ;
        sh:message "Use a code from evaluation levels (pwm:EvaluationLevelScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_eventType a sh:NodeShape ;
    rdfs:label "Code list: event type"@en ;
    sh:targetSubjectsOf pwm:eventType ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:eventType ; sh:in ( pwm:EventAnchorPublished pwm:EventApproval pwm:EventAssurance pwm:EventClaim pwm:EventClaimVerified pwm:EventClientCommunication pwm:EventEgress pwm:EventErasure pwm:EventEvaluationRecorded pwm:EventExternalReviewSubmitted pwm:EventFinalDecision pwm:EventIncidentClosed pwm:EventIncidentOpened pwm:EventIncidentUpdated pwm:EventInteraction pwm:EventIntervention pwm:EventKeyRevoked pwm:EventKeyRotated pwm:EventLearningExport pwm:EventMemoryWrite pwm:EventModelCall pwm:EventModelRefusal pwm:EventNearMiss pwm:EventOrigination pwm:EventOutcome pwm:EventPolicyChange pwm:EventPolicyDecision pwm:EventRetrieval pwm:EventRevalidationTriggered pwm:EventReview pwm:EventSourceSuperseded pwm:EventToolCall ) ;
        sh:message "Use a code from evidence event types (pwm:EvidenceEventTypeScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_executionFactor a sh:NodeShape ;
    rdfs:label "Code list: execution factor"@en ;
    sh:targetSubjectsOf pwm:executionFactor ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:executionFactor ; sh:in ( pwm:FactorCosts pwm:FactorLikelihood pwm:FactorNature pwm:FactorPrice pwm:FactorSize pwm:FactorSpeed ) ;
        sh:message "Use a code from best execution factors (pwm:ExecutionFactorScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_expectedOutcome a sh:NodeShape ;
    rdfs:label "Code list: expected outcome"@en ;
    sh:targetSubjectsOf pwm:expectedOutcome ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:expectedOutcome ; sh:in ( pwm:OutcomeAllow pwm:OutcomeDeny pwm:OutcomeEscalate pwm:OutcomeHumanApproval pwm:OutcomeObserve ) ;
        sh:message "Use a code from policy decision outcomes (pwm:DecisionOutcomeScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_facilityKind a sh:NodeShape ;
    rdfs:label "Code list: facility kind"@en ;
    sh:targetSubjectsOf pwm:facilityKind ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:facilityKind ; sh:in ( pwm:FacilityLombard pwm:FacilityMortgage pwm:FacilityOther pwm:FacilityStructured ) ;
        sh:message "Use a code from lending facility kinds (pwm:FacilityKindScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_failoverTrigger a sh:NodeShape ;
    rdfs:label "Code list: failover trigger"@en ;
    sh:targetSubjectsOf pwm:failoverTrigger ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:failoverTrigger ; sh:in ( pwm:TriggerConnectionFailure pwm:TriggerHttp5xx pwm:TriggerModelChanged ) ;
        sh:message "Use a code from failover triggers (pwm:FailoverTriggerScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_feeType a sh:NodeShape ;
    rdfs:label "Code list: fee type"@en ;
    sh:targetSubjectsOf pwm:feeType ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:feeType ; sh:in ( pwm:FeeAdvisory pwm:FeeCustody pwm:FeeManagement pwm:FeePerformance pwm:FeeTransaction ) ;
        sh:message "Use a code from fee types (pwm:FeeTypeScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_fromAutonomyLevel a sh:NodeShape ;
    rdfs:label "Code list: from autonomy level"@en ;
    sh:targetSubjectsOf pwm:fromAutonomyLevel ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:fromAutonomyLevel ; sh:in ( pwm:L0Retrieve pwm:L1Explain pwm:L2Recommend pwm:L3Draft pwm:L4ActAfterApproval pwm:L5BoundedAutonomy pwm:L6BroadAutonomy ) ;
        sh:message "Use a code from agent autonomy levels (pwm:AutonomyLevelScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_gatewayFailureMode a sh:NodeShape ;
    rdfs:label "Code list: gateway failure mode"@en ;
    sh:targetSubjectsOf pwm:gatewayFailureMode ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:gatewayFailureMode ; sh:in ( pwm:Degraded pwm:FailClosed ) ;
        sh:message "Use a code from gateway failure modes (pwm:GatewayFailureModeScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_impact a sh:NodeShape ;
    rdfs:label "Code list: impact"@en ;
    sh:targetSubjectsOf pwm:impact ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:impact ; sh:in ( pwm:RatingCritical pwm:RatingHigh pwm:RatingLow pwm:RatingMedium ) ;
        sh:message "Use a code from rating levels (pwm:RatingLevelScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_incidentKind a sh:NodeShape ;
    rdfs:label "Code list: incident kind"@en ;
    sh:targetSubjectsOf pwm:incidentKind ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:incidentKind ; sh:in ( pwm:IncidentChainBreak pwm:IncidentDegradedMode pwm:IncidentGatewayOutage pwm:IncidentProviderFailure ) ;
        sh:message "Use a code from operational incident kinds (pwm:IncidentKindScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_incomeKind a sh:NodeShape ;
    rdfs:label "Code list: income kind"@en ;
    sh:targetSubjectsOf pwm:incomeKind ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:incomeKind ; sh:in ( pwm:IncomeCoupon pwm:IncomeDividend pwm:IncomeInterest ) ;
        sh:message "Use a code from income kinds (pwm:IncomeKindScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_inherentMateriality a sh:NodeShape ;
    rdfs:label "Code list: inherent materiality"@en ;
    sh:targetSubjectsOf pwm:inherentMateriality ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:inherentMateriality ; sh:in ( pwm:RatingCritical pwm:RatingHigh pwm:RatingLow pwm:RatingMedium ) ;
        sh:message "Use a code from rating levels (pwm:RatingLevelScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_investorCategory a sh:NodeShape ;
    rdfs:label "Code list: investor category"@en ;
    sh:targetSubjectsOf pwm:investorCategory ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:investorCategory ; sh:in ( pwm:AccreditedInvestorSG pwm:AccreditedInvestorUS pwm:EligibleCounterpartyEU pwm:ExpertInvestorSG pwm:InstitutionalClientCH pwm:InstitutionalInvestorSG pwm:NonRetailCategory pwm:PrivateClientCH pwm:ProfessionalClientCH pwm:ProfessionalClientEU pwm:ProfessionalClientUK pwm:ProfessionalInvestorHK pwm:RetailCategory pwm:RetailClientEU pwm:RetailClientUK pwm:RetailInvestorSG ) ;
        sh:message "Use a code from investor categories (pwm:InvestorCategoryScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_lifecycleStatus a sh:NodeShape ;
    rdfs:label "Code list: lifecycle status"@en ;
    sh:targetSubjectsOf pwm:lifecycleStatus ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:lifecycleStatus ; sh:in ( pwm:StatusLive pwm:StatusPilot pwm:StatusRetired pwm:StatusSuspended ) ;
        sh:message "Use a code from use-case lifecycle statuses (pwm:UseCaseStatusScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_maxAutonomyLevel a sh:NodeShape ;
    rdfs:label "Code list: maximum autonomy level"@en ;
    sh:targetSubjectsOf pwm:maxAutonomyLevel ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:maxAutonomyLevel ; sh:in ( pwm:L0Retrieve pwm:L1Explain pwm:L2Recommend pwm:L3Draft pwm:L4ActAfterApproval pwm:L5BoundedAutonomy pwm:L6BroadAutonomy ) ;
        sh:message "Use a code from agent autonomy levels (pwm:AutonomyLevelScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_memoryScope a sh:NodeShape ;
    rdfs:label "Code list: memory scope"@en ;
    sh:targetSubjectsOf pwm:memoryScope ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:memoryScope ; sh:in ( pwm:MemoryInstitutional pwm:MemoryRelationship pwm:MemoryWorking ) ;
        sh:message "Use a code from memory scopes (pwm:MemoryScopeScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_nearMissKind a sh:NodeShape ;
    rdfs:label "Code list: near miss kind"@en ;
    sh:targetSubjectsOf pwm:nearMissKind ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:nearMissKind ; sh:in ( pwm:BlockedAction pwm:RMRejection pwm:UnsafeDraft pwm:UnusualAgentBehavior pwm:VerifierBlock ) ;
        sh:message "Use a code from near miss kind scheme (pwm:NearMissKindScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_negativeTargetMarketCategory a sh:NodeShape ;
    rdfs:label "Code list: negative target market category"@en ;
    sh:targetSubjectsOf pwm:negativeTargetMarketCategory ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:negativeTargetMarketCategory ; sh:in ( pwm:AccreditedInvestorSG pwm:AccreditedInvestorUS pwm:EligibleCounterpartyEU pwm:ExpertInvestorSG pwm:InstitutionalClientCH pwm:InstitutionalInvestorSG pwm:NonRetailCategory pwm:PrivateClientCH pwm:ProfessionalClientCH pwm:ProfessionalClientEU pwm:ProfessionalClientUK pwm:ProfessionalInvestorHK pwm:RetailCategory pwm:RetailClientEU pwm:RetailClientUK pwm:RetailInvestorSG ) ;
        sh:message "Use a code from investor categories (pwm:InvestorCategoryScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_optStatus a sh:NodeShape ;
    rdfs:label "Code list: opt status"@en ;
    sh:targetSubjectsOf pwm:optStatus ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:optStatus ; sh:in ( pwm:OptDefault pwm:OptedIn pwm:OptedOut ) ;
        sh:message "Use a code from opt statuses (pwm:OptStatusScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_orderSide a sh:NodeShape ;
    rdfs:label "Code list: order side"@en ;
    sh:targetSubjectsOf pwm:orderSide ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:orderSide ; sh:in ( pwm:SideBuy pwm:SideSell ) ;
        sh:message "Use a code from order sides (pwm:OrderSideScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_orderStatus a sh:NodeShape ;
    rdfs:label "Code list: order status"@en ;
    sh:targetSubjectsOf pwm:orderStatus ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:orderStatus ; sh:in ( pwm:OrderCanceled pwm:OrderFilled pwm:OrderPartlyFilled pwm:OrderPlaced pwm:OrderRejected ) ;
        sh:message "Use a code from order statuses (pwm:OrderStatusScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_orderType a sh:NodeShape ;
    rdfs:label "Code list: order type"@en ;
    sh:targetSubjectsOf pwm:orderType ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:orderType ; sh:in ( pwm:TypeLimit pwm:TypeMarket ) ;
        sh:message "Use a code from order types (pwm:OrderTypeScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_originationTrigger a sh:NodeShape ;
    rdfs:label "Code list: origination trigger"@en ;
    sh:targetSubjectsOf pwm:originationTrigger ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:originationTrigger ; sh:in ( pwm:OriginationEvent pwm:OriginationRMRequest pwm:OriginationSchedule ) ;
        sh:message "Use a code from origination triggers (pwm:OriginationTriggerScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_outcomeKind a sh:NodeShape ;
    rdfs:label "Code list: outcome kind"@en ;
    sh:targetSubjectsOf pwm:outcomeKind ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:outcomeKind ; sh:in ( pwm:ClientComplaint pwm:CommunicationError pwm:Correction pwm:OperationalIncident pwm:PolicyBreach pwm:UnsuitableSuggestion pwm:WrongClientTargeting ) ;
        sh:message "Use a code from interaction outcome kind scheme (pwm:InteractionOutcomeKindScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_pepCategory a sh:NodeShape ;
    rdfs:label "Code list: PEP category"@en ;
    sh:targetSubjectsOf pwm:pepCategory ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:pepCategory ; sh:in ( pwm:DomesticPEP pwm:ForeignPEP pwm:InternationalOrganizationPEP pwm:PEPCloseAssociate pwm:PEPFamilyMember ) ;
        sh:message "Use a code from politically exposed person categories (pwm:PEPCategoryScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_performanceMeasure a sh:NodeShape ;
    rdfs:label "Code list: performance measure"@en ;
    sh:targetSubjectsOf pwm:performanceMeasure ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:performanceMeasure ; sh:in ( pwm:MeasureAbsolute pwm:MeasureMWR pwm:MeasureTWR ) ;
        sh:message "Use a code from performance measures (pwm:PerformanceMeasureScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_permitsDataClass a sh:NodeShape ;
    rdfs:label "Code list: permits data class"@en ;
    sh:targetSubjectsOf pwm:permitsDataClass ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:permitsDataClass ; sh:in ( pwm:C0 pwm:C1 pwm:C2 pwm:C3 ) ;
        sh:message "Use a code from data classifications (pwm:DataClassificationScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_primaryMetric a sh:NodeShape ;
    rdfs:label "Code list: primary metric"@en ;
    sh:targetSubjectsOf pwm:primaryMetric ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:primaryMetric ; sh:in ( pwm:MetricCycleTime pwm:MetricDecisionQuality pwm:MetricKnowledgeRetention pwm:MetricReliability ) ;
        sh:message "Use a code from primary outcome metrics (pwm:PrimaryMetricScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_productComplexity a sh:NodeShape ;
    rdfs:label "Code list: product complexity"@en ;
    sh:targetSubjectsOf pwm:productComplexity ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:productComplexity ; sh:in ( pwm:ComplexProduct pwm:ExcludedInvestmentProductSG pwm:NonComplexProduct pwm:SpecifiedInvestmentProductSG ) ;
        sh:message "Use a code from product complexity classes (pwm:ProductComplexityScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_productRiskLevel a sh:NodeShape ;
    rdfs:label "Code list: product risk level"@en ;
    sh:targetSubjectsOf pwm:productRiskLevel ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:productRiskLevel ; sh:in ( pwm:RP1 pwm:RP2 pwm:RP3 pwm:RP4 pwm:RP5 ) ;
        sh:message "Use a code from illustrative risk scale (pwm:IllustrativeRiskScale). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_reconstructionQuestion a sh:NodeShape ;
    rdfs:label "Code list: reconstruction question"@en ;
    sh:targetSubjectsOf pwm:reconstructionQuestion ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:reconstructionQuestion ; sh:in ( pwm:QuestionAuthority pwm:QuestionCommunication pwm:QuestionControls pwm:QuestionFinalDecision pwm:QuestionInformation pwm:QuestionModelAgent pwm:QuestionRMChanges pwm:QuestionReproduction pwm:QuestionWhyClient pwm:QuestionWhyProduct ) ;
        sh:message "Use a code from supervisory reconstruction questions (pwm:ReconstructionQuestionScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_recordClass a sh:NodeShape ;
    rdfs:label "Code list: record class"@en ;
    sh:targetSubjectsOf pwm:recordClass ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:recordClass ; sh:in ( pwm:RecordAdvice pwm:RecordApprovals pwm:RecordClientCommunications pwm:RecordComplianceRecords pwm:RecordRecommendations pwm:RecordTransactions ) ;
        sh:message "Use a code from regulatory record classes (pwm:RecordClassScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_reliance a sh:NodeShape ;
    rdfs:label "Code list: reliance"@en ;
    sh:targetSubjectsOf pwm:reliance ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:reliance ; sh:in ( pwm:RatingCritical pwm:RatingHigh pwm:RatingLow pwm:RatingMedium ) ;
        sh:message "Use a code from rating levels (pwm:RatingLevelScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_reportingRegime a sh:NodeShape ;
    rdfs:label "Code list: reporting regime"@en ;
    sh:targetSubjectsOf pwm:reportingRegime ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:reportingRegime ; sh:in ( pwm:RegimeCRS pwm:RegimeFATCA ) ;
        sh:message "Use a code from tax reporting regimes (pwm:TaxReportingRegimeScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_requiredAutonomyLevel a sh:NodeShape ;
    rdfs:label "Code list: required autonomy level"@en ;
    sh:targetSubjectsOf pwm:requiredAutonomyLevel ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:requiredAutonomyLevel ; sh:in ( pwm:L0Retrieve pwm:L1Explain pwm:L2Recommend pwm:L3Draft pwm:L4ActAfterApproval pwm:L5BoundedAutonomy pwm:L6BroadAutonomy ) ;
        sh:message "Use a code from agent autonomy levels (pwm:AutonomyLevelScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_requiresDeploymentAttestation a sh:NodeShape ;
    rdfs:label "Code list: requires deployment attestation"@en ;
    sh:targetSubjectsOf pwm:requiresDeploymentAttestation ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:requiresDeploymentAttestation ; sh:in ( pwm:AttestationEnvironment pwm:AttestationInstruction pwm:AttestationMonitoring pwm:AttestationPrivacy pwm:AttestationTransfer ) ;
        sh:message "Use a code from attestation kinds (pwm:AttestationKindScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_residualMateriality a sh:NodeShape ;
    rdfs:label "Code list: residual materiality"@en ;
    sh:targetSubjectsOf pwm:residualMateriality ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:residualMateriality ; sh:in ( pwm:RatingCritical pwm:RatingHigh pwm:RatingLow pwm:RatingMedium ) ;
        sh:message "Use a code from rating levels (pwm:RatingLevelScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_reversibilityClass a sh:NodeShape ;
    rdfs:label "Code list: reversibility class"@en ;
    sh:targetSubjectsOf pwm:reversibilityClass ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:reversibilityClass ; sh:in ( pwm:Compensatable pwm:Irreversible pwm:Reversible ) ;
        sh:message "Use a code from Tool reversibility classes (pwm:ReversibilityScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_riskProfileLevel a sh:NodeShape ;
    rdfs:label "Code list: risk profile level"@en ;
    sh:targetSubjectsOf pwm:riskProfileLevel ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:riskProfileLevel ; sh:in ( pwm:RP1 pwm:RP2 pwm:RP3 pwm:RP4 pwm:RP5 ) ;
        sh:message "Use a code from illustrative risk scale (pwm:IllustrativeRiskScale). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_riskTier a sh:NodeShape ;
    rdfs:label "Code list: risk tier"@en ;
    sh:targetSubjectsOf pwm:riskTier ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:riskTier ; sh:in ( pwm:Tier1 pwm:Tier2 pwm:Tier3 pwm:Tier4 ) ;
        sh:message "Use a code from use-case risk tiers (pwm:RiskTierScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_runState a sh:NodeShape ;
    rdfs:label "Code list: run state"@en ;
    sh:targetSubjectsOf pwm:runState ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:runState ; sh:in ( pwm:RunCompleted pwm:RunDenied pwm:RunFailed pwm:RunReady pwm:RunResumed pwm:RunRunning pwm:RunSuspended ) ;
        sh:message "Use a code from run states (pwm:RunStateScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_scopeAutonomyLevel a sh:NodeShape ;
    rdfs:label "Code list: scope autonomy level"@en ;
    sh:targetSubjectsOf pwm:scopeAutonomyLevel ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:scopeAutonomyLevel ; sh:in ( pwm:L0Retrieve pwm:L1Explain pwm:L2Recommend pwm:L3Draft pwm:L4ActAfterApproval pwm:L5BoundedAutonomy pwm:L6BroadAutonomy ) ;
        sh:message "Use a code from agent autonomy levels (pwm:AutonomyLevelScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_screeningDisposition a sh:NodeShape ;
    rdfs:label "Code list: screening disposition"@en ;
    sh:targetSubjectsOf pwm:screeningDisposition ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:screeningDisposition ; sh:in ( pwm:ScreeningEscalated pwm:ScreeningFalsePositive pwm:ScreeningPending pwm:ScreeningTrueMatch ) ;
        sh:message "Use a code from screening dispositions (pwm:ScreeningDispositionScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_sensitiveKind a sh:NodeShape ;
    rdfs:label "Code list: sensitive kind"@en ;
    sh:targetSubjectsOf pwm:sensitiveKind ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:sensitiveKind ; sh:in ( pwm:SensitiveEthnicity pwm:SensitiveHealth pwm:SensitivePolitical pwm:SensitiveReligion pwm:SensitiveSexuality pwm:SensitiveVulnerability ) ;
        sh:message "Use a code from special categories (pwm:SensitiveKindScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_signingRule a sh:NodeShape ;
    rdfs:label "Code list: signing rule"@en ;
    sh:targetSubjectsOf pwm:signingRule ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:signingRule ; sh:in ( pwm:SignAllJointly pwm:SignAnyOne pwm:SignTwoJointly ) ;
        sh:message "Use a code from signing rules (pwm:SigningRuleScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_staleAction a sh:NodeShape ;
    rdfs:label "Code list: stale action"@en ;
    sh:targetSubjectsOf pwm:staleAction ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:staleAction ; sh:in ( pwm:StaleRefresh pwm:StaleSuppress pwm:StaleWarn ) ;
        sh:message "Use a code from stale-data actions (pwm:StaleActionScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_suitabilityOutcome a sh:NodeShape ;
    rdfs:label "Code list: suitability outcome"@en ;
    sh:targetSubjectsOf pwm:suitabilityOutcome ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:suitabilityOutcome ; sh:in ( pwm:InsufficientInformation pwm:NotSuitable pwm:Suitable pwm:SuitableWithConditions ) ;
        sh:message "Use a code from suitability outcomes (pwm:SuitabilityOutcomeScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_suitabilityReviewResult a sh:NodeShape ;
    rdfs:label "Code list: suitability review result"@en ;
    sh:targetSubjectsOf pwm:suitabilityReviewResult ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:suitabilityReviewResult ; sh:in ( pwm:SuitabilityNo pwm:SuitabilityStill pwm:SuitabilityUpdate ) ;
        sh:message "Use a code from suitability review results (pwm:SuitabilityReviewResultScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_sustainabilityPreferenceKind a sh:NodeShape ;
    rdfs:label "Code list: sustainability preference kind"@en ;
    sh:targetSubjectsOf pwm:sustainabilityPreferenceKind ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:sustainabilityPreferenceKind ; sh:in ( pwm:NoSustainabilityPreference pwm:PAIConsideration pwm:SFDRSustainableMinimum pwm:TaxonomyAlignedMinimum ) ;
        sh:message "Use a code from sustainability preference categories (pwm:SustainabilityPreferenceScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_targetMarketReviewOutcome a sh:NodeShape ;
    rdfs:label "Code list: target market review outcome"@en ;
    sh:targetSubjectsOf pwm:targetMarketReviewOutcome ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:targetMarketReviewOutcome ; sh:in ( pwm:ReviewAmended pwm:ReviewConfirmed pwm:ReviewWithdrawn ) ;
        sh:message "Use a code from target market review outcomes (pwm:TargetMarketReviewOutcomeScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_targetRiskProfile a sh:NodeShape ;
    rdfs:label "Code list: target risk profile"@en ;
    sh:targetSubjectsOf pwm:targetRiskProfile ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:targetRiskProfile ; sh:in ( pwm:RP1 pwm:RP2 pwm:RP3 pwm:RP4 pwm:RP5 ) ;
        sh:message "Use a code from illustrative risk scale (pwm:IllustrativeRiskScale). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_toAutonomyLevel a sh:NodeShape ;
    rdfs:label "Code list: to autonomy level"@en ;
    sh:targetSubjectsOf pwm:toAutonomyLevel ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:toAutonomyLevel ; sh:in ( pwm:L0Retrieve pwm:L1Explain pwm:L2Recommend pwm:L3Draft pwm:L4ActAfterApproval pwm:L5BoundedAutonomy pwm:L6BroadAutonomy ) ;
        sh:message "Use a code from agent autonomy levels (pwm:AutonomyLevelScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_transferType a sh:NodeShape ;
    rdfs:label "Code list: transfer type"@en ;
    sh:targetSubjectsOf pwm:transferType ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:transferType ; sh:in ( pwm:TransferApi pwm:TransferLicense pwm:TransferLocal pwm:TransferOwnership pwm:TransferWeights ) ;
        sh:message "Use a code from technology transfer types (pwm:TransferTypeScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_trustLabel a sh:NodeShape ;
    rdfs:label "Code list: trust label"@en ;
    sh:targetSubjectsOf pwm:trustLabel ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:trustLabel ; sh:in ( pwm:TrustClientData pwm:TrustExternal pwm:TrustInternal ) ;
        sh:message "Use a code from Content trust and taint labels (pwm:ContentTrustScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_usesDataClass a sh:NodeShape ;
    rdfs:label "Code list: uses data class"@en ;
    sh:targetSubjectsOf pwm:usesDataClass ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:usesDataClass ; sh:in ( pwm:C0 pwm:C1 pwm:C2 pwm:C3 ) ;
        sh:message "Use a code from data classifications (pwm:DataClassificationScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_validatorStatus a sh:NodeShape ;
    rdfs:label "Code list: validator status"@en ;
    sh:targetSubjectsOf pwm:validatorStatus ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:validatorStatus ; sh:in ( pwm:ValidatorBlocked pwm:ValidatorConflicting pwm:ValidatorInferred pwm:ValidatorStale pwm:ValidatorUnverified pwm:ValidatorVerified ) ;
        sh:message "Use a code from validator statuses (pwm:ValidatorStatusScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_verificationVerdict a sh:NodeShape ;
    rdfs:label "Code list: verification verdict"@en ;
    sh:targetSubjectsOf pwm:verificationVerdict ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:verificationVerdict ; sh:in ( pwm:ValidatorBlocked pwm:ValidatorConflicting pwm:ValidatorInferred pwm:ValidatorStale pwm:ValidatorUnverified pwm:ValidatorVerified ) ;
        sh:message "Use a code from validator statuses (pwm:ValidatorStatusScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .

pwmsh:CodeList_vulnerabilityDriver a sh:NodeShape ;
    rdfs:label "Code list: vulnerability driver"@en ;
    sh:targetSubjectsOf pwm:vulnerabilityDriver ;
    dcterms:source pwmref:W3C-SKOS ;
    sh:property [ sh:path pwm:vulnerabilityDriver ; sh:in ( pwm:DriverCapability pwm:DriverHealth pwm:DriverLifeEvent pwm:DriverResilience ) ;
        sh:message "Use a code from vulnerability drivers (pwm:VulnerabilityDriverScheme). See https://github.com/mze3e/kognita/blob/main/docs/ontology/pwm/README.md for replacement requirements." ] .
# END GENERATED CODE-LIST SHAPES
pwmsh:AuthorityLiveStatusShape a sh:NodeShape ;
    rdfs:label "Live authority status"@en ; sh:targetClass pwm:AuthorityLiveStatus ;
    dcterms:source pwmref:KOG-ROADMAP, pwmref:MAS-AIRG ;
    sh:property [ sh:path pwm:statusOf ; sh:minCount 1 ; sh:maxCount 1 ; sh:or ( [ sh:class pwm:DelegatedAuthority ] [ sh:class pwm:KillSwitch ] )  ; sh:message "statusOf: minimum count 1; maximum count 1; one of classes DelegatedAuthority, KillSwitch." ] ;
    sh:property [ sh:path pwm:asOf ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:pattern "(Z|[+-][0-9]{2}:[0-9]{2})$" ; sh:message "asOf must carry an explicit timezone (Z or an offset) so decision-time comparison cannot use an implicit timezone." ] ;
    sh:property [ sh:path pwm:observedBy ; sh:minCount 1 ; sh:class prov:Agent  ; sh:message "observedBy: minimum count 1; class Agent." ] ;
    sh:property [ sh:path pwm:revoked ; sh:maxCount 1 ; sh:datatype xsd:boolean  ; sh:message "revoked: maximum count 1; datatype boolean." ] ;
    sh:property [ sh:path pwm:engaged ; sh:maxCount 1 ; sh:datatype xsd:boolean  ; sh:message "engaged: maximum count 1; datatype boolean." ] ;
    sh:or (
      [ sh:property [ sh:path pwm:statusOf ; sh:class pwm:DelegatedAuthority  ; sh:message "statusOf: class DelegatedAuthority." ] ; sh:property [ sh:path pwm:revoked ; sh:minCount 1  ; sh:message "revoked: minimum count 1." ] ; sh:property [ sh:path pwm:engaged ; sh:maxCount 0  ; sh:message "engaged: maximum count 0." ] ]
      [ sh:property [ sh:path pwm:statusOf ; sh:class pwm:KillSwitch  ; sh:message "statusOf: class KillSwitch." ] ; sh:property [ sh:path pwm:engaged ; sh:minCount 1  ; sh:message "engaged: minimum count 1." ] ; sh:property [ sh:path pwm:revoked ; sh:maxCount 0  ; sh:message "revoked: maximum count 0." ] ]
    ) ;
    sh:message "Record the matching live boolean, subject, xsd:dateTime asOf and observer (KOG 0.4 item 14; 0.3 item 2; MAS AIRG 5.9)." .

pwmsh:LiveDelegationDecisionShape a sh:NodeShape ;
    rdfs:label "Live delegation at decision time"@en ; sh:targetClass pwm:PolicyDecision ;
    dcterms:source pwmref:KOG-ROADMAP, pwmref:MAS-AIRG ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
      sh:message "An ALLOW relying on delegated authority requires a live status and must not have a latest status showing it revoked as of decision time (KOG 0.4 item 14; 0.3 item 2; MAS AIRG 5.9)." ;
      sh:select """SELECT DISTINCT $this WHERE {
        $this pwm:decisionOutcome pwm:OutcomeAllow ; pwm:reliesOnDelegation ?authority ; prov:generatedAtTime ?time .
        FILTER (NOT EXISTS { ?s a pwm:AuthorityLiveStatus ; pwm:statusOf ?authority ; pwm:asOf ?at . FILTER (?at <= ?time) }
          || EXISTS {
            ?s a pwm:AuthorityLiveStatus ; pwm:statusOf ?authority ; pwm:revoked true ; pwm:asOf ?at . FILTER (?at <= ?time)
            FILTER NOT EXISTS { ?later a pwm:AuthorityLiveStatus ; pwm:statusOf ?authority ; pwm:asOf ?after . FILTER (?after > ?at && ?after <= ?time) }
          })
      }""" ] .

pwmsh:LiveKillSwitchDecisionShape a sh:NodeShape ;
    rdfs:label "Live kill switch at decision time"@en ; sh:targetClass pwm:PolicyDecision ;
    dcterms:source pwmref:KOG-ROADMAP, pwmref:MAS-AIRG ;
    rdfs:comment "A switch covers a decision if any declared scope dimension matches its use case, policy, model or prompt, including governed calls. Unscoped switches cover all decisions. Latest observations at or before the decision apply; tied engaged observations fail closed."@en ;
    sh:sparql [ sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
      sh:message "A decision made while a covering kill switch status is engaged must not be ALLOW (KOG 0.4 item 14: circuit breaker; MAS AIRG 5.9)." ;
      sh:select """SELECT DISTINCT $this WHERE {
        $this pwm:decisionOutcome pwm:OutcomeAllow ; prov:generatedAtTime ?time .
        ?s a pwm:AuthorityLiveStatus ; pwm:statusOf ?switch ; pwm:engaged true ; pwm:asOf ?at .
        ?switch a pwm:KillSwitch . FILTER (?at <= ?time)
        FILTER NOT EXISTS { ?later a pwm:AuthorityLiveStatus ; pwm:statusOf ?switch ; pwm:asOf ?after . FILTER (?after > ?at && ?after <= ?time) }
        FILTER (NOT EXISTS { ?switch (pwm:scopeUseCase|pwm:scopePolicy|pwm:scopeModel|pwm:scopePromptVersion) ?scope }
          || EXISTS { ?switch pwm:scopeUseCase ?uc . $this pwm:underUseCase ?uc }
          || EXISTS { ?switch pwm:scopePolicy ?rule . $this pwm:decidedByRule ?rule }
          || EXISTS { ?switch pwm:scopeModel ?model . $this (pwm:usesModel|^pwm:governedByDecision/pwm:usesModel) ?model }
          || EXISTS { ?switch pwm:scopePromptVersion ?prompt . $this (pwm:promptTemplateVersion|^pwm:governedByDecision/pwm:promptTemplateVersion) ?prompt })
      }""" ] .

# >>> module 12 BEGIN (generated by tools/gen_module12.py)
pwmsh:SigningKeyShape a sh:NodeShape ; rdfs:label "SigningKeyShape"@en ; sh:targetClass pwm:SigningKey ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:keyId ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:keyId: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:publicKeyReference ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:publicKeyReference: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:escrowReference ; sh:minCount 0 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:escrowReference: minimum count 0, maximum count 1, datatype xsd:string." ] .

pwmsh:SignedEvidenceShape a sh:NodeShape ; rdfs:label "SignedEvidenceShape"@en ; sh:targetClass pwm:EvidenceRecord ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.7 items T1 and R2. Checks recorded evidence; signature verification is external."@en ;
    sh:property [ sh:path pwm:signature ; sh:minCount 0 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:signature: minimum count 0, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:signedBy ; sh:minCount 0 ; sh:maxCount 1 ; sh:class pwm:SigningKey ; sh:message "pwm:signedBy: minimum count 0, maximum count 1, class pwm:SigningKey." ] ;
    sh:property [ sh:path pwm:evidenceSequence ; sh:minCount 0 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "pwm:evidenceSequence: minimum count 0, maximum count 1, datatype xsd:nonNegativeInteger." ] ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "A signed evidence record names its signing key and its sequence, so the signature can be checked against the key registry and any revocation cutoff (Kognita 0.7 items T1 and R2)." ;
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:select """
            SELECT $this WHERE {
                $this pwm:signature ?s .
                FILTER NOT EXISTS { $this pwm:signedBy ?k . $this pwm:evidenceSequence ?n }
            }
        """ ;
    ] ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "A record signed with a key at or after that key's revocation sequence is not valid (Kognita 0.7 item R2; revoked keys fail closed)." ;
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:select """
            SELECT $this ?value WHERE {
                $this pwm:signedBy ?value ; pwm:evidenceSequence ?seq .
                ?rev pwm:revokesKey ?value ; pwm:effectiveFromSequence ?cut .
                FILTER (?seq >= ?cut)
            }
        """ ;
    ] .

pwmsh:KeyRotationShape a sh:NodeShape ; rdfs:label "KeyRotationShape"@en ; sh:targetClass pwm:KeyRotation ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:rotatesFrom ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:SigningKey ; sh:message "pwm:rotatesFrom: minimum count 1, maximum count 1, class pwm:SigningKey." ] ;
    sh:property [ sh:path pwm:rotatesTo ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:SigningKey ; sh:message "pwm:rotatesTo: minimum count 1, maximum count 1, class pwm:SigningKey." ] ;
    sh:property [ sh:path pwm:rotatesFrom ; sh:disjoint pwm:rotatesTo ; sh:message "pwm:rotatesFrom: must differ from rotatesTo." ] .

pwmsh:KeyRevocationShape a sh:NodeShape ; rdfs:label "KeyRevocationShape"@en ; sh:targetClass pwm:KeyRevocation ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:revokesKey ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:SigningKey ; sh:message "pwm:revokesKey: minimum count 1, maximum count 1, class pwm:SigningKey." ] ;
    sh:property [ sh:path pwm:effectiveFromSequence ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "pwm:effectiveFromSequence: minimum count 1, maximum count 1, datatype xsd:nonNegativeInteger." ] .

pwmsh:EvidenceAnchorShape a sh:NodeShape ; rdfs:label "EvidenceAnchorShape"@en ; sh:targetClass pwm:EvidenceAnchor ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:anchoredRecordHash ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:anchoredRecordHash: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:anchoredSequence ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "pwm:anchoredSequence: minimum count 1, maximum count 1, datatype xsd:nonNegativeInteger." ] ;
    sh:property [ sh:path pwm:anchorLocation ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:anchorLocation: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path prov:generatedAtTime ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "prov:generatedAtTime: minimum count 1, maximum count 1, datatype xsd:dateTime." ] .

pwmsh:RecoveryBundleShape a sh:NodeShape ; rdfs:label "RecoveryBundleShape"@en ; sh:targetClass pwm:RecoveryBundle ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:bundleHash ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:bundleHash: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:recoveryCutoffSequence ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "pwm:recoveryCutoffSequence: minimum count 1, maximum count 1, datatype xsd:nonNegativeInteger." ] ;
    sh:property [ sh:path pwm:restoreVerified ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:restoreVerified: minimum count 1, maximum count 1, datatype xsd:boolean." ] ;
    sh:property [ sh:path pwm:includesRetentionState ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:includesRetentionState: minimum count 1, maximum count 1, datatype xsd:boolean." ] .

pwmsh:ExternalReviewSubmissionShape a sh:NodeShape ; rdfs:label "ExternalReviewSubmissionShape"@en ; sh:targetClass pwm:ExternalReviewSubmission ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:reviewedFromSequence ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:lessThanOrEquals pwm:reviewedToSequence ; sh:message "pwm:reviewedFromSequence: minimum count 1, maximum count 1, datatype xsd:nonNegativeInteger, not after reviewedToSequence." ] ;
    sh:property [ sh:path pwm:reviewedToSequence ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "pwm:reviewedToSequence: minimum count 1, maximum count 1, datatype xsd:nonNegativeInteger." ] ;
    sh:property [ sh:path pwm:signedBy ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:SigningKey ; sh:message "pwm:signedBy: minimum count 1, maximum count 1, class pwm:SigningKey." ] .

pwmsh:ModelProviderRegistrationShape a sh:NodeShape ; rdfs:label "ModelProviderRegistrationShape"@en ; sh:targetClass pwm:ModelProviderRegistration ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:registeredProvider ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:ModelProvider ; sh:message "pwm:registeredProvider: minimum count 1, maximum count 1, class pwm:ModelProvider." ] ;
    sh:property [ sh:path pwm:dependentUseCase ; sh:minCount 1 ; sh:class pwm:AIUseCase ; sh:message "pwm:dependentUseCase: minimum count 1, class pwm:AIUseCase." ] ;
    sh:property [ sh:path pwm:dataResidency ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:dataResidency: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:dataRetentionTerms ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:dataRetentionTerms: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:encryptionDescription ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:encryptionDescription: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:incidentNotificationTerms ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:incidentNotificationTerms: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:availabilityCommitment ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:availabilityCommitment: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:modelChangeNotice ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:modelChangeNotice: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:exitPlanReference ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:exitPlanReference: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:regulatoryCooperation ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:regulatoryCooperation: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:trainingUse ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:trainingUse: minimum count 1, maximum count 1, datatype xsd:boolean." ] ;
    sh:property [ sh:path pwm:auditRights ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:auditRights: minimum count 1, maximum count 1, datatype xsd:boolean." ] ;
    sh:property [ sh:path pwm:subProcessor ; sh:minCount 1 ; sh:datatype xsd:string ; sh:message "pwm:subProcessor: minimum count 1, datatype xsd:string." ] .

pwmsh:RegisteredProviderCallShape a sh:NodeShape ; rdfs:label "RegisteredProviderCallShape"@en ; sh:targetClass pwm:ModelCall ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.7 item R3. Routing to an unregistered provider is a denial (R3-UNREGISTERED); this checks the recorded call."@en ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "A model call names a provider that has no model provider registration (Kognita 0.7 item R3, R3-UNREGISTERED)." ;
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:select """
            SELECT $this ?value WHERE {
                $this pwm:providedBy ?value .
                FILTER NOT EXISTS { ?r a pwm:ModelProviderRegistration ; pwm:registeredProvider ?value }
            }
        """ ;
    ] .

pwmsh:ProviderFailoverShape a sh:NodeShape ; rdfs:label "ProviderFailoverShape"@en ; sh:targetClass pwm:ProviderFailover ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:failoverFrom ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:ModelCard ; sh:message "pwm:failoverFrom: minimum count 1, maximum count 1, class pwm:ModelCard." ] ;
    sh:property [ sh:path pwm:failoverTo ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:ModelCard ; sh:message "pwm:failoverTo: minimum count 1, maximum count 1, class pwm:ModelCard." ] ;
    sh:property [ sh:path pwm:failoverUseCase ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AIUseCase ; sh:message "pwm:failoverUseCase: minimum count 1, maximum count 1, class pwm:AIUseCase." ] ;
    sh:property [ sh:path pwm:failoverTrigger ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:failoverTrigger: minimum count 1, maximum count 1." ] ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "A failover target must be a model card approved as a fallback for the use case (Kognita 0.7 item R5, R5-UNAPPROVED-FALLBACK)." ;
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:select """
            SELECT $this ?value WHERE {
                $this pwm:failoverTo ?value ; pwm:failoverUseCase ?uc .
                FILTER NOT EXISTS { ?uc pwm:approvedFallbackModel ?value }
            }
        """ ;
    ] .

pwmsh:ModelChangeDetectionShape a sh:NodeShape ; rdfs:label "ModelChangeDetectionShape"@en ; sh:targetClass pwm:ModelChangeDetection ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:approvedModelVersion ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:approvedModelVersion: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:servedModelVersion ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:servedModelVersion: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:triggersRevalidation ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:triggersRevalidation: minimum count 1, maximum count 1, datatype xsd:boolean." ] ;
    sh:property [ sh:path pwm:detectedOnCall ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:ModelCall ; sh:message "pwm:detectedOnCall: minimum count 1, maximum count 1, class pwm:ModelCall." ] ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "A served model version that differs from the approved version must trigger revalidation (Kognita 0.7 item R7, R7-MODEL-CHANGED)." ;
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:select """
            SELECT $this WHERE {
                $this pwm:approvedModelVersion ?a ; pwm:servedModelVersion ?s ; pwm:triggersRevalidation ?t .
                FILTER (?a != ?s && ?t = false)
            }
        """ ;
    ] .

pwmsh:AIDependencyShape a sh:NodeShape ; rdfs:label "AIDependencyShape"@en ; sh:targetClass pwm:AIDependency ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:dependencyLayer ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:dependencyLayer: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:dependencyOf ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AIUseCase ; sh:message "pwm:dependencyOf: minimum count 1, maximum count 1, class pwm:AIUseCase." ] ;
    sh:property [ sh:path pwm:dependencyTarget ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:dependencyTarget: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:dependencyDeclared ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:dependencyDeclared: minimum count 1, maximum count 1, datatype xsd:boolean." ] ;
    sh:property [ sh:path pwm:dependencyObserved ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:dependencyObserved: minimum count 1, maximum count 1, datatype xsd:boolean." ] .

pwmsh:DependencyDivergenceShape a sh:NodeShape ; rdfs:label "DependencyDivergenceShape"@en ; sh:targetClass pwm:DependencyDivergence ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:divergenceKind ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:divergenceKind: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:divergenceDependency ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AIDependency ; sh:message "pwm:divergenceDependency: minimum count 1, maximum count 1, class pwm:AIDependency." ] ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "An undeclared divergence needs a dependency that is observed and not declared; an unused one needs a dependency that is declared and not observed (Kognita 0.7 item R8)." ;
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:select """
            SELECT $this ?value WHERE {
                $this pwm:divergenceDependency ?value .
                { $this pwm:divergenceKind pwm:DivergenceUndeclared . ?value pwm:dependencyDeclared true }
                UNION
                { $this pwm:divergenceKind pwm:DivergenceUnused . ?value pwm:dependencyObserved true }
            }
        """ ;
    ] .

pwmsh:ConcentrationMeasureShape a sh:NodeShape ; rdfs:label "ConcentrationMeasureShape"@en ; sh:targetClass pwm:ConcentrationMeasure ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:concentrationLayer ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:concentrationLayer: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:concentrationTarget ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:concentrationTarget: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:criticalUseCaseCount ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:lessThanOrEquals pwm:criticalUseCaseTotal ; sh:message "pwm:criticalUseCaseCount: minimum count 1, maximum count 1, datatype xsd:nonNegativeInteger, not above criticalUseCaseTotal." ] ;
    sh:property [ sh:path pwm:criticalUseCaseTotal ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:message "pwm:criticalUseCaseTotal: minimum count 1, maximum count 1, datatype xsd:nonNegativeInteger." ] ;
    sh:property [ sh:path pwm:criticalUseCaseShare ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:minInclusive 0 ; sh:maxInclusive 1 ; sh:message "pwm:criticalUseCaseShare: minimum count 1, maximum count 1, datatype xsd:decimal, between 0 and 1." ] .

pwmsh:FailureDrillShape a sh:NodeShape ; rdfs:label "FailureDrillShape"@en ; sh:targetClass pwm:FailureDrill ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:drillKind ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:drillKind: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:drillUseCase ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AIUseCase ; sh:message "pwm:drillUseCase: minimum count 1, maximum count 1, class pwm:AIUseCase." ] ;
    sh:property [ sh:path pwm:evidenceCompleteAfterDrill ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:evidenceCompleteAfterDrill: minimum count 1, maximum count 1, datatype xsd:boolean." ] ;
    sh:property [ sh:path pwm:gatewayFailureMode ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:gatewayFailureMode: minimum count 1, maximum count 1." ] .

pwmsh:RecordClassRetentionShape a sh:NodeShape ; rdfs:label "RecordClassRetentionShape"@en ; sh:targetClass pwm:RecordClassRetention ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.7 item R11. Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:recordClass ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:recordClass: minimum count 1, maximum count 1." ] ;
    sh:xone (
        [ sh:property [ sh:path pwm:classRetentionDays ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "classRetentionDays: one value." ] ]
        [ sh:property [ sh:path pwm:retainIndefinitely ; sh:hasValue true ; sh:message "retainIndefinitely: true." ] ]
    ) ;
    sh:message "A record class has a retention period in days or is held indefinitely, not both and not neither (Kognita 0.7 item R11)." .

pwmsh:IncidentReportShape a sh:NodeShape ; rdfs:label "IncidentReportShape"@en ; sh:targetClass pwm:IncidentReport ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:reportsIncident ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AIIncident ; sh:message "pwm:reportsIncident: minimum count 1, maximum count 1, class pwm:AIIncident." ] ;
    sh:property [ sh:path pwm:redactedReport ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:redactedReport: minimum count 1, maximum count 1, datatype xsd:boolean." ] ;
    sh:property [ sh:path pwm:controlRan ; sh:minCount 1 ; sh:datatype xsd:string ; sh:message "pwm:controlRan: minimum count 1, datatype xsd:string." ] .

pwmsh:AssurancePolicyShape a sh:NodeShape ; rdfs:label "AssurancePolicyShape"@en ; sh:targetClass pwm:AssurancePolicy ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:assuranceUseCase ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AIUseCase ; sh:message "pwm:assuranceUseCase: minimum count 1, maximum count 1, class pwm:AIUseCase." ] ;
    sh:property [ sh:path pwm:assuranceAudience ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:assuranceAudience: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:maxAdverseOutcomes ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:positiveInteger ; sh:message "pwm:maxAdverseOutcomes: minimum count 1, maximum count 1, datatype xsd:positiveInteger." ] ;
    sh:property [ sh:path pwm:outcomeWindowDays ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:positiveInteger ; sh:minInclusive 1 ; sh:maxInclusive 3650 ; sh:message "pwm:outcomeWindowDays: minimum count 1, maximum count 1, datatype xsd:positiveInteger, between 1 and 3650." ] .

pwmsh:AgentManifestShape a sh:NodeShape ; rdfs:label "AgentManifestShape"@en ; sh:targetClass pwm:AgentManifest ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:manifestSchemaVersion ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:manifestSchemaVersion: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:manifestOfAgent ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AIAgent ; sh:message "pwm:manifestOfAgent: minimum count 1, maximum count 1, class pwm:AIAgent." ] ;
    sh:property [ sh:path pwm:manifestDigest ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:manifestDigest: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:signedBy ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:SigningKey ; sh:message "pwm:signedBy: minimum count 1, maximum count 1, class pwm:SigningKey." ] .

pwmsh:ExternalAgentAssertionShape a sh:NodeShape ; rdfs:label "ExternalAgentAssertionShape"@en ; sh:targetClass pwm:ExternalAgentAssertion ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:assertionIssuer ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:assertionIssuer: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:assertionSubject ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:assertionSubject: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:assertionPrincipal ; sh:minCount 1 ; sh:maxCount 1 ; sh:class fibo-fnd-aap-ppl:Person ; sh:message "pwm:assertionPrincipal: minimum count 1, maximum count 1, class fibo-fnd-aap-ppl:Person." ] ;
    sh:property [ sh:path pwm:assertionPurpose ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:assertionPurpose: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:assertionAudience ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:assertionAudience: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:assertionScope ; sh:minCount 1 ; sh:datatype xsd:string ; sh:message "pwm:assertionScope: minimum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:assertionDepth ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:nonNegativeInteger ; sh:maxInclusive 16 ; sh:message "pwm:assertionDepth: minimum count 1, maximum count 1, at most 16." ] ;
    sh:property [ sh:path pwm:issuedAt ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:lessThan pwm:expiresAt ; sh:message "pwm:issuedAt: minimum count 1, maximum count 1, datatype xsd:dateTime, before expiresAt." ] ;
    sh:property [ sh:path pwm:expiresAt ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:expiresAt: minimum count 1, maximum count 1, datatype xsd:dateTime." ] ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "An assertion has a parent exactly when its delegation depth is above zero (Kognita 0.8 item A2)." ;
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:select """
            SELECT $this WHERE {
                { $this pwm:assertionDepth ?d . FILTER (?d > 0) FILTER NOT EXISTS { $this pwm:parentAssertion ?p } }
                UNION
                { $this pwm:parentAssertion ?p ; pwm:assertionDepth ?d . FILTER (?d = 0) }
            }
        """ ;
    ] .

pwmsh:DeploymentAttestationShape a sh:NodeShape ; rdfs:label "DeploymentAttestationShape"@en ; sh:targetClass pwm:DeploymentAttestation ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:attestationKind ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:attestationKind: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:attestationIssuer ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:attestationIssuer: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:attestationSubject ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:attestationSubject: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:attestsDeployment ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:attestsDeployment: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:attestsPolicy ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:attestsPolicy: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:attestationReference ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:attestationReference: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:issuedAt ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:lessThan pwm:expiresAt ; sh:message "pwm:issuedAt: minimum count 1, maximum count 1, datatype xsd:dateTime, before expiresAt." ] ;
    sh:property [ sh:path pwm:expiresAt ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:expiresAt: minimum count 1, maximum count 1, datatype xsd:dateTime." ] .

pwmsh:ThirdPartyUpdateApprovalShape a sh:NodeShape ; rdfs:label "ThirdPartyUpdateApprovalShape"@en ; sh:targetClass pwm:ThirdPartyUpdateApproval ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:candidateDigest ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:candidateDigest: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:regressionReference ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:regressionReference: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:rollbackReference ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:rollbackReference: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:approvedBy ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:approvedBy: minimum count 1, maximum count 1." ] .

pwmsh:ApprovedComponentShape a sh:NodeShape ; rdfs:label "ApprovedComponentShape"@en ; sh:targetClass pwm:ApprovedComponent ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:componentName ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:componentName: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:componentVersion ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:componentVersion: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:provenanceReference ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:provenanceReference: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:sbomDigest ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:pattern "^[a-f0-9]{64}$" ; sh:message "pwm:sbomDigest: 64 lowercase hexadecimal characters." ] ;
    sh:property [ sh:path pwm:imageDigest ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:pattern "^sha256:[a-f0-9]{64}$" ; sh:message "pwm:imageDigest: sha256: followed by 64 lowercase hexadecimal characters." ] .

pwmsh:ComponentAdvisoryShape a sh:NodeShape ; rdfs:label "ComponentAdvisoryShape"@en ; sh:targetClass pwm:ComponentAdvisory ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:advisoryReference ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:advisoryReference: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:affectsComponent ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:ApprovedComponent ; sh:message "pwm:affectsComponent: minimum count 1, maximum count 1, class pwm:ApprovedComponent." ] ;
    sh:property [ sh:path pwm:quarantined ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:quarantined: minimum count 1, maximum count 1, datatype xsd:boolean." ] .

pwmsh:TechnologyTransferClassificationShape a sh:NodeShape ; rdfs:label "TechnologyTransferClassificationShape"@en ; sh:targetClass pwm:TechnologyTransferClassification ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:transferType ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:transferType: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:technologyOrigin ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:technologyOrigin: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:deploymentJurisdiction ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:deploymentJurisdiction: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:transferPolicyReference ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:transferPolicyReference: minimum count 1, maximum count 1, datatype xsd:string." ] .

pwmsh:ProductionOutcomeShape a sh:NodeShape ; rdfs:label "ProductionOutcomeShape"@en ; sh:targetClass pwm:ProductionOutcome ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:outcomeId ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:outcomeId: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:outcomeSourceReference ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:outcomeSourceReference: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:intendedResult ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:intendedResult: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:actualResult ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:actualResult: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:adverse ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:adverse: minimum count 1, maximum count 1, datatype xsd:boolean." ] .

pwmsh:SupervisoryConformanceReportShape a sh:NodeShape ; rdfs:label "SupervisoryConformanceReportShape"@en ; sh:targetClass pwm:SupervisoryConformanceReport ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:conformanceProfile ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:conformanceProfile: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:reportAsOf ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:reportAsOf: minimum count 1, maximum count 1, datatype xsd:dateTime." ] ;
    sh:property [ sh:path pwm:coversControl ; sh:minCount 1 ; sh:datatype xsd:string ; sh:message "pwm:coversControl: minimum count 1, datatype xsd:string." ] .

pwmsh:VerifierShape a sh:NodeShape ; rdfs:label "VerifierShape"@en ; sh:targetClass pwm:Verifier ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:verifierAgent ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AIAgent ; sh:message "pwm:verifierAgent: minimum count 1, maximum count 1, class pwm:AIAgent." ] ;
    sh:property [ sh:path pwm:verifierModelCard ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:ModelCard ; sh:message "pwm:verifierModelCard: minimum count 1, maximum count 1, class pwm:ModelCard." ] .

pwmsh:ClaimVerificationShape a sh:NodeShape ; rdfs:label "ClaimVerificationShape"@en ; sh:targetClass pwm:ClaimVerification ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:verifiedClaim ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:Claim ; sh:message "pwm:verifiedClaim: minimum count 1, maximum count 1, class pwm:Claim." ] ;
    sh:property [ sh:path pwm:verifiedBy ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:Verifier ; sh:message "pwm:verifiedBy: minimum count 1, maximum count 1, class pwm:Verifier." ] ;
    sh:property [ sh:path pwm:producerModelCard ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:ModelCard ; sh:message "pwm:producerModelCard: minimum count 1, maximum count 1, class pwm:ModelCard." ] ;
    sh:property [ sh:path pwm:verificationVerdict ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:verificationVerdict: minimum count 1, maximum count 1." ] ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "A verifier must differ from the producer in model, model version and provider unless the use case explicitly permits self verification (Kognita 0.6 item 7, C7)." ;
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:select """
            SELECT $this WHERE {
                $this pwm:verifiedBy/pwm:verifierModelCard ?vc ; pwm:producerModelCard ?pc .
                FILTER ( ?vc = ?pc || EXISTS { ?vc pwm:providedBy ?p . ?pc pwm:providedBy ?p } || EXISTS { ?vc pwm:modelVersion ?v . ?pc pwm:modelVersion ?v } )
                FILTER NOT EXISTS { $this pwm:underUseCase/pwm:permitsSelfVerification true }
            }
        """ ;
    ] .

pwmsh:EvaluationResultShape a sh:NodeShape ; rdfs:label "EvaluationResultShape"@en ; sh:targetClass pwm:EvaluationResult ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:evaluatesAgent ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AIAgent ; sh:message "pwm:evaluatesAgent: minimum count 1, maximum count 1, class pwm:AIAgent." ] ;
    sh:property [ sh:path pwm:evaluatedVersion ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:evaluatedVersion: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:evaluatedModelVersion ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:evaluatedModelVersion: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:evaluationLevel ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:evaluationLevel: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:hasMetricValue ; sh:minCount 1 ; sh:class pwm:EvaluationMetricValue ; sh:message "pwm:hasMetricValue: minimum count 1, class pwm:EvaluationMetricValue." ] ;
    sh:property [ sh:path pwm:evaluationDeploymentHash ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:pattern "^[a-f0-9]{64}$" ; sh:message "pwm:evaluationDeploymentHash: 64 lowercase hexadecimal characters." ] .

pwmsh:EvaluationMetricValueShape a sh:NodeShape ; rdfs:label "EvaluationMetricValueShape"@en ; sh:targetClass pwm:EvaluationMetricValue ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:metricName ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:metricName: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:metricScore ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:minInclusive 0 ; sh:maxInclusive 1 ; sh:message "pwm:metricScore: minimum count 1, maximum count 1, between 0 and 1." ] .

pwmsh:FairnessReportShape a sh:NodeShape ; rdfs:label "FairnessReportShape"@en ; sh:targetClass pwm:FairnessReport ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:fairnessThreshold ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:fairnessThreshold: minimum count 1, maximum count 1, datatype xsd:decimal." ] ;
    sh:property [ sh:path pwm:fairnessFlagged ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:fairnessFlagged: minimum count 1, maximum count 1, datatype xsd:boolean." ] ;
    sh:property [ sh:path pwm:proxyAttribute ; sh:minCount 0 ; sh:datatype xsd:string ; sh:message "pwm:proxyAttribute: minimum count 0, datatype xsd:string." ] .

pwmsh:EvaluationGateShape a sh:NodeShape ; rdfs:label "EvaluationGateShape"@en ; sh:targetClass pwm:EvaluationGate ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:gateUseCase ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:AIUseCase ; sh:message "pwm:gateUseCase: minimum count 1, maximum count 1, class pwm:AIUseCase." ] ;
    sh:property [ sh:path pwm:gateMetricName ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:gateMetricName: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:gateMinimumScore ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:minInclusive 0 ; sh:maxInclusive 1 ; sh:message "pwm:gateMinimumScore: between 0 and 1." ] ;
    sh:property [ sh:path pwm:gateMaximumScore ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:minInclusive 0 ; sh:maxInclusive 1 ; sh:message "pwm:gateMaximumScore: between 0 and 1." ] ;
    sh:xone ( [ sh:property [ sh:path pwm:gateMinimumScore ; sh:minCount 1 ] ] [ sh:property [ sh:path pwm:gateMaximumScore ; sh:minCount 1 ] ] ) ;
    sh:message "A gate states a minimum or a maximum score, not both and not neither (Kognita 0.6 item 11)." .

pwmsh:ActivationGateShape a sh:NodeShape ; rdfs:label "ActivationGateShape"@en ; sh:targetClass pwm:AIAgent ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "An agent activated on an evaluation result that misses a minimum gate for its use case (Kognita 0.6 item 11)." ;
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:select """
            SELECT $this ?value WHERE {
                $this pwm:activatedOnEvaluation ?value ; pwm:registeredForUseCase ?uc .
                ?gate a pwm:EvaluationGate ; pwm:gateUseCase ?uc ; pwm:gateMetricName ?m ; pwm:gateMinimumScore ?min .
                ?value pwm:hasMetricValue ?mv . ?mv pwm:metricName ?m ; pwm:metricScore ?s .
                FILTER (?s < ?min)
            }
        """ ;
    ] ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "An agent activated on an evaluation result that exceeds a maximum gate for its use case (Kognita 0.6 item 11)." ;
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:select """
            SELECT $this ?value WHERE {
                $this pwm:activatedOnEvaluation ?value ; pwm:registeredForUseCase ?uc .
                ?gate a pwm:EvaluationGate ; pwm:gateUseCase ?uc ; pwm:gateMetricName ?m ; pwm:gateMaximumScore ?max .
                ?value pwm:hasMetricValue ?mv . ?mv pwm:metricName ?m ; pwm:metricScore ?s .
                FILTER (?s > ?max)
            }
        """ ;
    ] .

pwmsh:ReasoningTraceShape a sh:NodeShape ; rdfs:label "ReasoningTraceShape"@en ; sh:targetClass pwm:ReasoningTrace ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:traceOfCall ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:ModelCall ; sh:message "pwm:traceOfCall: minimum count 1, maximum count 1, class pwm:ModelCall." ] ;
    sh:property [ sh:path pwm:traceHash ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:traceHash: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:retainedIn ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:retainedIn: minimum count 1, maximum count 1." ] .

pwmsh:ClaimEnvelopeShape a sh:NodeShape ; rdfs:label "ClaimEnvelopeShape"@en ; sh:targetClass pwm:Claim ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Roadmap milestone 0.6 item 1. A verified claim carries its source and retrieval record."@en ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "A verified claim names its source system and record and the source and retrieval times, so an RM can see why they are seeing it (Kognita 0.6 item 1)." ;
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:select """
            SELECT $this WHERE {
                $this pwm:validatorStatus pwm:ValidatorVerified .
                FILTER NOT EXISTS { $this pwm:claimSourceSystem ?a . $this pwm:claimSourceRecord ?b . $this pwm:claimSourceTimestamp ?c . $this pwm:claimRetrievalTimestamp ?d }
            }
        """ ;
    ] .

pwmsh:MemoryRecordShape a sh:NodeShape ; rdfs:label "MemoryRecordShape"@en ; sh:targetClass pwm:MemoryRecord ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:memoryScope ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:memoryScope: minimum count 1, maximum count 1." ] ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "Relationship memory names its client, an expiry and a correction path (Kognita 0.6 item 8)." ;
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:select """
            SELECT $this WHERE {
                $this pwm:memoryScope pwm:MemoryRelationship .
                FILTER NOT EXISTS { $this pwm:memorySubjectClient ?c . $this pwm:memoryExpiresAt ?e . $this pwm:memoryCorrectionPath ?p }
            }
        """ ;
    ] ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "Institutional memory carries no client; client data never crosses into it (Kognita 0.6 item 8)." ;
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:select """
            SELECT $this ?value WHERE {
                $this pwm:memoryScope pwm:MemoryInstitutional ; pwm:memorySubjectClient ?value .
            }
        """ ;
    ] .

pwmsh:LearningExportShape a sh:NodeShape ; rdfs:label "LearningExportShape"@en ; sh:targetClass pwm:LearningExport ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:exportPurpose ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:exportPurpose: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:anonymizationReference ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:anonymizationReference: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:validationReference ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:validationReference: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:approvedBy ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:approvedBy: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:exportRequester ; sh:minCount 1 ; sh:maxCount 1 ; sh:class fibo-fnd-aap-ppl:Person ; sh:message "pwm:exportRequester: minimum count 1, maximum count 1, class fibo-fnd-aap-ppl:Person." ] ;
    sh:property [ sh:path pwm:exportedRecordId ; sh:minCount 1 ; sh:datatype xsd:string ; sh:message "pwm:exportedRecordId: minimum count 1, datatype xsd:string." ] .

pwmsh:LearningExclusionShape a sh:NodeShape ; rdfs:label "LearningExclusionShape"@en ; sh:targetClass pwm:LearningExclusion ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:exclusionReason ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:exclusionReason: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:or ( [ sh:path pwm:excludesClient ; sh:minCount 1 ] [ sh:path pwm:excludesRecordId ; sh:minCount 1 ] ) ;
    sh:message "An exclusion names a client or a record (Kognita 0.6 item 9)." .

pwmsh:SensitiveAttributeInferenceShape a sh:NodeShape ; rdfs:label "SensitiveAttributeInferenceShape"@en ; sh:targetClass pwm:SensitiveAttributeInference ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:sensitiveKind ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:sensitiveKind: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:permittedByUseCase ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:permittedByUseCase: minimum count 1, maximum count 1, datatype xsd:boolean." ] ;
    sh:property [ sh:path pwm:blockedByPolicy ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:blockedByPolicy: minimum count 1, maximum count 1, datatype xsd:boolean." ] ;
    sh:property [ sh:path pwm:changesClientTreatment ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:changesClientTreatment: minimum count 1, maximum count 1, datatype xsd:boolean." ] ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "A special-category inference the use case does not permit must be blocked by policy (Kognita 0.6 item 10)." ;
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:select """
            SELECT $this WHERE {
                $this pwm:permittedByUseCase false ; pwm:blockedByPolicy false .
            }
        """ ;
    ] ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "An inference that changes how a client is treated needs a person's review and determination; an AI may flag, never determine (Kognita 0.6 item 10)." ;
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:select """
            SELECT $this WHERE {
                $this pwm:changesClientTreatment true .
                FILTER NOT EXISTS { $this pwm:reviewedByRM ?p }
            }
        """ ;
    ] .
# <<< module 12 END

# >>> module 13 BEGIN (generated by tools/gen_module13.py)
pwmsh:CostDisclosureShape a sh:NodeShape ; rdfs:label "CostDisclosureShape"@en ; sh:targetClass pwm:CostDisclosure ;
    dcterms:source pwmref:EU-MIFID2, pwmref:PWM-PRACTICE ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:disclosureTiming ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:disclosureTiming: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:disclosedToClient ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:Client ; sh:message "pwm:disclosedToClient: minimum count 1, maximum count 1, class pwm:Client." ] ;
    sh:property [ sh:path pwm:disclosedAt ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:disclosedAt: minimum count 1, maximum count 1, datatype xsd:dateTime." ] ;
    sh:property [ sh:path pwm:coversMandate ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:Mandate ; sh:message "pwm:coversMandate: minimum count 1, maximum count 1, class pwm:Mandate." ] ;
    sh:property [ sh:path pwm:totalCostAmount ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:totalCostAmount: minimum count 1, maximum count 1, datatype xsd:decimal." ] ;
    sh:property [ sh:path pwm:currency ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:currency: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:hasCostItem ; sh:minCount 1 ; sh:class pwm:CostItem ; sh:message "pwm:hasCostItem: minimum count 1, class pwm:CostItem." ] ;
    sh:property [ sh:path pwm:includesInducements ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:includesInducements: minimum count 1, maximum count 1, datatype xsd:boolean." ] ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "An ex post disclosure states the period it covers (MiFID II Art. 24(4); Delegated Regulation 2017/565 Art. 50)." ;
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:select """
            SELECT $this WHERE {
                $this pwm:disclosureTiming pwm:TimingExPost .
                FILTER NOT EXISTS { $this pwm:periodStart ?s . $this pwm:periodEnd ?e }
            }
        """ ;
    ] .

pwmsh:CostItemShape a sh:NodeShape ; rdfs:label "CostItemShape"@en ; sh:targetClass pwm:CostItem ;
    dcterms:source pwmref:EU-MIFID2, pwmref:PWM-PRACTICE ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:costCategory ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:costCategory: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:amount ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:amount: minimum count 1, maximum count 1, datatype xsd:decimal." ] ;
    sh:property [ sh:path pwm:currency ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:currency: minimum count 1, maximum count 1." ] .

pwmsh:InducementDisclosureShape a sh:NodeShape ; rdfs:label "InducementDisclosureShape"@en ; sh:targetClass pwm:InducementDisclosure ;
    dcterms:source pwmref:EU-MIFID2, pwmref:PWM-PRACTICE ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:disclosesPayment ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:ThirdPartyPayment ; sh:message "pwm:disclosesPayment: minimum count 1, maximum count 1, class pwm:ThirdPartyPayment." ] ;
    sh:property [ sh:path pwm:disclosedToClient ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:Client ; sh:message "pwm:disclosedToClient: minimum count 1, maximum count 1, class pwm:Client." ] ;
    sh:property [ sh:path pwm:disclosedAt ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:disclosedAt: minimum count 1, maximum count 1, datatype xsd:dateTime." ] ;
    sh:property [ sh:path pwm:enhancesServiceQuality ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:boolean ; sh:message "pwm:enhancesServiceQuality: minimum count 1, maximum count 1, datatype xsd:boolean." ] .

pwmsh:ProductApprovalShape a sh:NodeShape ; rdfs:label "ProductApprovalShape"@en ; sh:targetClass pwm:ProductApproval ;
    dcterms:source pwmref:EU-MIFID2, pwmref:PWM-PRACTICE ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:approvesProduct ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:Product ; sh:message "pwm:approvesProduct: minimum count 1, maximum count 1, class pwm:Product." ] ;
    sh:property [ sh:path pwm:approvedForTargetMarket ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:TargetMarket ; sh:message "pwm:approvedForTargetMarket: minimum count 1, maximum count 1, class pwm:TargetMarket." ] ;
    sh:property [ sh:path pwm:distributionStrategyReference ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:distributionStrategyReference: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:approvedBy ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:approvedBy: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path prov:generatedAtTime ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "prov:generatedAtTime: minimum count 1, maximum count 1, datatype xsd:dateTime." ] .

pwmsh:TargetMarketReviewShape a sh:NodeShape ; rdfs:label "TargetMarketReviewShape"@en ; sh:targetClass pwm:TargetMarketReview ;
    dcterms:source pwmref:EU-MIFID2, pwmref:PWM-PRACTICE ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:reviewsTargetMarket ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:TargetMarket ; sh:message "pwm:reviewsTargetMarket: minimum count 1, maximum count 1, class pwm:TargetMarket." ] ;
    sh:property [ sh:path pwm:targetMarketReviewOutcome ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:targetMarketReviewOutcome: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:reviewedAt ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:lessThan pwm:nextReviewDueAt ; sh:message "pwm:reviewedAt: minimum count 1, maximum count 1, datatype xsd:dateTime, before the next review date." ] ;
    sh:property [ sh:path pwm:nextReviewDueAt ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:nextReviewDueAt: minimum count 1, maximum count 1, datatype xsd:dateTime." ] .

pwmsh:ComplaintOutcomeShape a sh:NodeShape ; rdfs:label "ComplaintOutcomeShape"@en ; sh:targetClass pwm:ComplaintOutcome ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:complaintOf ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:Complaint ; sh:message "pwm:complaintOf: minimum count 1, maximum count 1, class pwm:Complaint." ] ;
    sh:property [ sh:path pwm:complaintResolution ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:complaintResolution: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:reviewedAt ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:reviewedAt: minimum count 1, maximum count 1, datatype xsd:dateTime." ] ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "Redress needs a currency (Kognita record of the outcome)." ;
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:select """
            SELECT $this WHERE {
                $this pwm:redressAmount ?r .
                FILTER NOT EXISTS { $this pwm:currency ?c }
            }
        """ ;
    ] .

pwmsh:SuitabilityReviewShape a sh:NodeShape ; rdfs:label "SuitabilityReviewShape"@en ; sh:targetClass pwm:SuitabilityReview ;
    dcterms:source pwmref:EU-MIFID2, pwmref:PWM-PRACTICE ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:reviewsSuitability ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:SuitabilityAssessment ; sh:message "pwm:reviewsSuitability: minimum count 1, maximum count 1, class pwm:SuitabilityAssessment." ] ;
    sh:property [ sh:path pwm:suitabilityReviewResult ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:suitabilityReviewResult: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:reviewFrequencyMonths ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:positiveInteger ; sh:message "pwm:reviewFrequencyMonths: minimum count 1, maximum count 1, datatype xsd:positiveInteger." ] ;
    sh:property [ sh:path pwm:performedAt ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:lessThan pwm:nextReviewDueAt ; sh:message "pwm:performedAt: minimum count 1, maximum count 1, datatype xsd:dateTime, before the next review date." ] ;
    sh:property [ sh:path pwm:nextReviewDueAt ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:nextReviewDueAt: minimum count 1, maximum count 1, datatype xsd:dateTime." ] .

pwmsh:OrderShape a sh:NodeShape ; rdfs:label "OrderShape"@en ; sh:targetClass pwm:Order ;
    dcterms:source pwmref:EU-MIFID2, pwmref:PWM-PRACTICE ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:orderSide ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:orderSide: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:orderType ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:orderType: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:orderStatus ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:orderStatus: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:orderQuantity ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:orderQuantity: minimum count 1, maximum count 1, datatype xsd:decimal." ] ;
    sh:property [ sh:path pwm:inInstrument ; sh:minCount 1 ; sh:maxCount 1 ; sh:class fibo-fbc-fi-fi:FinancialInstrument ; sh:message "pwm:inInstrument: minimum count 1, maximum count 1, class fibo-fbc-fi-fi:FinancialInstrument." ] ;
    sh:property [ sh:path pwm:orderAccount ; sh:minCount 1 ; sh:maxCount 1 ; sh:class fibo-fbc-pas-caa:Account ; sh:message "pwm:orderAccount: minimum count 1, maximum count 1, class fibo-fbc-pas-caa:Account." ] ;
    sh:property [ sh:path pwm:orderPlacedAt ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:orderPlacedAt: minimum count 1, maximum count 1, datatype xsd:dateTime." ] ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "A limit order states its limit price." ;
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:select """
            SELECT $this WHERE {
                $this pwm:orderType pwm:TypeLimit .
                FILTER NOT EXISTS { $this pwm:limitPrice ?p }
            }
        """ ;
    ] .

pwmsh:ExecutionShape a sh:NodeShape ; rdfs:label "ExecutionShape"@en ; sh:targetClass pwm:Execution ;
    dcterms:source pwmref:EU-MIFID2, pwmref:PWM-PRACTICE ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:executesOrder ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:Order ; sh:message "pwm:executesOrder: minimum count 1, maximum count 1, class pwm:Order." ] ;
    sh:property [ sh:path pwm:executedQuantity ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:executedQuantity: minimum count 1, maximum count 1, datatype xsd:decimal." ] ;
    sh:property [ sh:path pwm:executionPrice ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:executionPrice: minimum count 1, maximum count 1, datatype xsd:decimal." ] ;
    sh:property [ sh:path pwm:executedAt ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:executedAt: minimum count 1, maximum count 1, datatype xsd:dateTime." ] ;
    sh:property [ sh:path pwm:executionVenue ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:executionVenue: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "A fill cannot exceed the order quantity." ;
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:select """
            SELECT $this WHERE {
                $this pwm:executesOrder ?o ; pwm:executedQuantity ?q .
                ?o pwm:orderQuantity ?max .
                FILTER (?q > ?max)
            }
        """ ;
    ] ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "Allocations of one execution cannot add up to more than was executed." ;
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:select """
            SELECT $this WHERE {
                $this pwm:executedQuantity ?q .
                { SELECT $this (SUM(?a) AS ?total) WHERE { ?x pwm:allocatesExecution $this ; pwm:allocatedQuantity ?a } GROUP BY $this }
                FILTER (?total > ?q)
            }
        """ ;
    ] ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "A fill cannot happen before the order was placed." ;
        sh:prefixes <https://ahmedmuzammil.com/ontology/pwm/shapes> ;
        sh:select """
            SELECT $this WHERE {
                $this pwm:executesOrder ?o ; pwm:executedAt ?t .
                ?o pwm:orderPlacedAt ?p .
                FILTER (?t < ?p)
            }
        """ ;
    ] .

pwmsh:AllocationShape a sh:NodeShape ; rdfs:label "AllocationShape"@en ; sh:targetClass pwm:Allocation ;
    dcterms:source pwmref:EU-MIFID2, pwmref:PWM-PRACTICE ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:allocatesExecution ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:Execution ; sh:message "pwm:allocatesExecution: minimum count 1, maximum count 1, class pwm:Execution." ] ;
    sh:property [ sh:path pwm:allocatedToAccount ; sh:minCount 1 ; sh:maxCount 1 ; sh:class fibo-fbc-pas-caa:Account ; sh:message "pwm:allocatedToAccount: minimum count 1, maximum count 1, class fibo-fbc-pas-caa:Account." ] ;
    sh:property [ sh:path pwm:allocatedQuantity ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:allocatedQuantity: minimum count 1, maximum count 1, datatype xsd:decimal." ] .

pwmsh:BestExecutionRecordShape a sh:NodeShape ; rdfs:label "BestExecutionRecordShape"@en ; sh:targetClass pwm:BestExecutionRecord ;
    dcterms:source pwmref:EU-MIFID2, pwmref:PWM-PRACTICE ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:bestExecutionOf ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:Execution ; sh:message "pwm:bestExecutionOf: minimum count 1, maximum count 1, class pwm:Execution." ] ;
    sh:property [ sh:path pwm:executionFactor ; sh:minCount 1 ; sh:message "pwm:executionFactor: minimum count 1." ] ;
    sh:property [ sh:path pwm:venueRationale ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:venueRationale: minimum count 1, maximum count 1, datatype xsd:string." ] ;
    sh:property [ sh:path pwm:executionPolicyReference ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:message "pwm:executionPolicyReference: minimum count 1, maximum count 1, datatype xsd:string." ] .

pwmsh:CorporateActionShape a sh:NodeShape ; rdfs:label "CorporateActionShape"@en ; sh:targetClass pwm:CorporateAction ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:corporateActionKind ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:corporateActionKind: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:affectsInstrument ; sh:minCount 1 ; sh:maxCount 1 ; sh:class fibo-fbc-fi-fi:FinancialInstrument ; sh:message "pwm:affectsInstrument: minimum count 1, maximum count 1, class fibo-fbc-fi-fi:FinancialInstrument." ] ;
    sh:property [ sh:path pwm:effectiveAt ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:effectiveAt: minimum count 1, maximum count 1, datatype xsd:dateTime." ] .

pwmsh:IncomeReceiptShape a sh:NodeShape ; rdfs:label "IncomeReceiptShape"@en ; sh:targetClass pwm:IncomeReceipt ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:incomeKind ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:incomeKind: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:incomeToAccount ; sh:minCount 1 ; sh:maxCount 1 ; sh:class fibo-fbc-pas-caa:Account ; sh:message "pwm:incomeToAccount: minimum count 1, maximum count 1, class fibo-fbc-pas-caa:Account." ] ;
    sh:property [ sh:path pwm:amount ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:amount: minimum count 1, maximum count 1, datatype xsd:decimal." ] ;
    sh:property [ sh:path pwm:currency ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:currency: minimum count 1, maximum count 1." ] .

pwmsh:TaxReportingRecordShape a sh:NodeShape ; rdfs:label "TaxReportingRecordShape"@en ; sh:targetClass pwm:TaxReportingRecord ;
    dcterms:source pwmref:OECD-CRS, pwmref:PWM-PRACTICE ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:reportingRegime ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:reportingRegime: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:reportingYear ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:integer ; sh:message "pwm:reportingYear: minimum count 1, maximum count 1, datatype xsd:integer." ] ;
    sh:property [ sh:path pwm:reportedAccount ; sh:minCount 1 ; sh:maxCount 1 ; sh:class fibo-fbc-pas-caa:Account ; sh:message "pwm:reportedAccount: minimum count 1, maximum count 1, class fibo-fbc-pas-caa:Account." ] ;
    sh:property [ sh:path pwm:reportedToJurisdiction ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ; sh:pattern "^[A-Z]{2}$" ; sh:message "pwm:reportedToJurisdiction: an ISO 3166-1 alpha-2 code." ] ;
    sh:property [ sh:path pwm:amount ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:amount: minimum count 1, maximum count 1, datatype xsd:decimal." ] ;
    sh:property [ sh:path pwm:currency ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:currency: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:reportSubmittedAt ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:reportSubmittedAt: minimum count 1, maximum count 1, datatype xsd:dateTime." ] .

pwmsh:LendingFacilityShape a sh:NodeShape ; rdfs:label "LendingFacilityShape"@en ; sh:targetClass pwm:LendingFacility ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:facilityKind ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:facilityKind: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:facilityClient ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:Client ; sh:message "pwm:facilityClient: minimum count 1, maximum count 1, class pwm:Client." ] ;
    sh:property [ sh:path pwm:facilityLimit ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:facilityLimit: minimum count 1, maximum count 1, datatype xsd:decimal." ] ;
    sh:property [ sh:path pwm:currency ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:currency: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:maxLoanToValue ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:minInclusive 0 ; sh:maxInclusive 1 ; sh:message "pwm:maxLoanToValue: between 0 and 1." ] .

pwmsh:PerformanceFigureShape a sh:NodeShape ; rdfs:label "PerformanceFigureShape"@en ; sh:targetClass pwm:PerformanceFigure ;
    dcterms:source pwmref:KOG-ROADMAP ; rdfs:comment "Checks recorded evidence; runtime enforcement remains external."@en ;
    sh:property [ sh:path pwm:performanceOf ; sh:minCount 1 ; sh:maxCount 1 ; sh:class pwm:Portfolio ; sh:message "pwm:performanceOf: minimum count 1, maximum count 1, class pwm:Portfolio." ] ;
    sh:property [ sh:path pwm:performanceMeasure ; sh:minCount 1 ; sh:maxCount 1 ; sh:message "pwm:performanceMeasure: minimum count 1, maximum count 1." ] ;
    sh:property [ sh:path pwm:performanceValue ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:decimal ; sh:message "pwm:performanceValue: minimum count 1, maximum count 1, datatype xsd:decimal." ] ;
    sh:property [ sh:path pwm:periodStart ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:lessThan pwm:periodEnd ; sh:message "pwm:periodStart: minimum count 1, maximum count 1, datatype xsd:dateTime, before periodEnd." ] ;
    sh:property [ sh:path pwm:periodEnd ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:dateTime ; sh:message "pwm:periodEnd: minimum count 1, maximum count 1, datatype xsd:dateTime." ] ;
    sh:property [ sh:path pwm:calculatedBy ; sh:minCount 1 ; sh:class pwm:CalculationService ; sh:message "A performance figure cites a registered calculation service; PWM never computes it (Kognita 0.6 item 6)." ] .
# <<< module 13 END
