@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix gs1: <https://ref.gs1.org/voc/> .
@prefix oec: <https://ref.openepcis.org/extensions/common/core/> .
@prefix eucpr: <https://ref.openepcis.org/extensions/eu/cpr/> .
@prefix oea: <https://ref.openepcis.org/extensions/common/assessment/> .
@prefix cpr-sh: <https://ref.openepcis.org/extensions/eu/cpr/shapes/> .
@prefix dcterms: <http://purl.org/dc/terms/> .

<https://ref.openepcis.org/extensions/eu/cpr/shapes/>
    a sh:ShapesGraph ;
    dcterms:title "OpenEPCIS CPR SHACL Shapes"@en ;
    dcterms:description "SHACL validation shapes for the CPR vocabulary (EU Regulation 2024/3110)."@en ;
    dcterms:created "2026-05-01"^^xsd:date ;
    dcterms:modified "2026-06-18"^^xsd:date .

cpr-sh:ConstructionProductShape
    a sh:NodeShape ;
    sh:targetClass eucpr:ConstructionProduct ;
    rdfs:label "CPR Construction Product Shape"@en ;
    sh:property [
        sh:path eucpr:hasConstructionProductType ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "eucpr:ConstructionProduct must declare exactly one constructionProductType (Annex III family)"@en
    ] ;
    sh:property [
        sh:path eucpr:declarationOfPerformanceUrl ;
        sh:datatype xsd:anyURI ;
        sh:minCount 1 ;
        sh:message "eucpr:ConstructionProduct must reference a Declaration of Performance per CPR Article 12"@en
    ] ;
    sh:property [
        sh:path eucpr:hasEssentialCharacteristic ;
        sh:minCount 1 ;
        sh:node cpr-sh:EssentialCharacteristicShape ;
        sh:message "A CPR Declaration of Performance must declare at least one essential characteristic, each conforming to EssentialCharacteristicShape (CPR Article 12 / Annex III)"@en
    ] .

cpr-sh:EssentialCharacteristicShape
    a sh:NodeShape ;
    sh:targetClass eucpr:EssentialCharacteristic ;
    rdfs:label "CPR Essential Characteristic Shape"@en ;
    sh:property [
        sh:path oea:hasObservedParameter ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "Each essential characteristic names its eucpr: performance parameter (oea:hasObservedParameter)"@en
    ] ;
    sh:property [
        sh:path oea:hasMeasuredValue ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "Each essential characteristic carries its declared performance as oea:hasMeasuredValue (gs1:QuantitativeValue: value + unitCode)"@en
    ] ;
    sh:property [
        sh:path eucpr:harmonisedStandard ;
        sh:datatype xsd:anyURI ;
        sh:maxCount 1
    ] .
