@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 skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<https://opda.org.uk/pdtf/shape/RiskAssessmentShape> a sh:NodeShape ;
    sh:targetClass <https://opda.org.uk/pdtf/RiskAssessment> ;
    sh:property [ sh:path <https://opda.org.uk/pdtf/actionAlertRating> ; sh:maxCount 1 ; sh:severity sh:Violation ; sh:message "RiskAssessment opda:actionAlertRating MUST be one of the opda:ActionAlertRatingScheme levels (integer 1–5, 1 Green … 5 Red; ODR-0008d Rule 1c / Rule 4)." ] ;
    sh:property [ sh:path <https://opda.org.uk/pdtf/disclosureDetail> ; sh:datatype xsd:string ; sh:severity sh:Info ; sh:message "RiskAssessment result / summary / recommendations are opda:disclosureDetail-grade strings (ODR-0008d Rule 1c); the specific field is carried by the instance-level dct:source, never a per-field property (ODR-0022 §Rules.6)." ] ;
    sh:property [ sh:path <https://opda.org.uk/pdtf/hasSubAssessment> ; sh:severity sh:Violation ; sh:message "Each opda:hasSubAssessment (a riskSubcategories[] entry) MUST itself satisfy the RiskAssessment shape — the self-referential result recursion via sh:node (ODR-0008d Rule 1c / Rule 4). ACYCLICITY (ODR-0024 R11) is enforced separately by opda:shape:RiskAssessmentAcyclicityConstraint, a SPARQL property-path constraint (core SHACL sh:node recursion cannot itself test transitive closure)." ] ;
    sh:property [ sh:path <https://opda.org.uk/pdtf/peril> ; sh:maxCount 1 ; sh:severity sh:Violation ; sh:message "RiskAssessment opda:peril MUST be one of the 12 opda:PerilScheme concepts (a dereferenceable peril, never an opaque string; ODR-0008d Rule 1c / Rule 2)." ] ;
    sh:property [ sh:path <https://opda.org.uk/pdtf/riskIndicator> ; sh:maxCount 1 ; sh:severity sh:Violation ; sh:message "RiskAssessment opda:riskIndicator MUST be one of the opda:YesNoNotKnownScheme values (No / Not known / Yes; ODR-0008d Rule 1c / Rule 4)." ] ;
    sh:property [ sh:path <http://www.w3.org/ns/prov#wasAttributedTo> ; sh:severity sh:Info ; sh:message "RiskAssessment datasetAttribution REUSES prov:wasAttributedTo (ODR-0008d Rule 5 — the dataset's licensing/copyright Agent; opda:datasetAttribution is NEVER minted)." ] .
