@prefix sh:     <http://www.w3.org/ns/shacl#> .
@prefix xsd:    <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs:   <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl:    <http://www.w3.org/2002/07/owl#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix dpp:    <https://www.dpp-interoperability.wiki/vocab/v1/dpp#> .
@prefix qudt:   <http://qudt.org/schema/qudt/> .
@prefix prov:   <http://www.w3.org/ns/prov#> .

# =============================================================================
# SHACL Shapes for DPP Core Vocabulary v0.2
# Companion to: https://www.dpp-interoperability.wiki/vocab/v1/dpp#
# =============================================================================

<https://www.dpp-interoperability.wiki/vocab/v1/dpp.shacl>
    a owl:Ontology ;
    rdfs:label "DPP Core SHACL Shapes" ;
    rdfs:comment "SHACL validation shapes for the DPP Interoperability Core vocabulary v0.2. Validates class instances against property constraints derived from the OWL ontology." ;
    dcterms:created "2026-03-05"^^xsd:date ;
    rdfs:seeAlso <https://www.dpp-interoperability.wiki/vocab/v1/dpp#> .

# -----------------------------------------------------------------------------
# Abstract base classes (Agent, PhysicalEntity, InformationObject, SoftwareEntity)
# No shapes needed -- these are not directly instantiated.
# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------
# DigitalProductPassport
# -----------------------------------------------------------------------------
dpp:DigitalProductPassportShape
    a sh:NodeShape ;
    sh:targetClass dpp:DigitalProductPassport ;
    rdfs:label "Digital Product Passport shape" ;
    sh:property [
        sh:path dpp:passportId ;
        sh:datatype xsd:anyURI ;
        sh:maxCount 1 ;
        sh:name "passportId" ;
    ] ;
    sh:property [
        sh:path dpp:version ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "version" ;
    ] ;
    sh:property [
        sh:path dpp:lastUpdated ;
        sh:datatype xsd:dateTime ;
        sh:maxCount 1 ;
        sh:name "lastUpdated" ;
    ] ;
    sh:property [
        sh:path dpp:placingOnMarket ;
        sh:datatype xsd:date ;
        sh:maxCount 1 ;
        sh:name "placingOnMarket" ;
    ] ;
    sh:property [
        sh:path dpp:passportStatus ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "passportStatus" ;
    ] ;
    sh:property [
        sh:path dpp:dataCarrier ;
        sh:datatype xsd:anyURI ;
        sh:maxCount 1 ;
        sh:name "dataCarrier" ;
    ] ;
    sh:property [
        sh:path dpp:product ;
        sh:class dpp:Product ;
        sh:maxCount 1 ;
        sh:name "product" ;
    ] ;
    sh:property [
        sh:path dpp:manufacturer ;
        sh:class dpp:Manufacturer ;
        sh:maxCount 1 ;
        sh:name "manufacturer" ;
    ] ;
    sh:property [
        sh:path dpp:identifiers ;
        sh:class dpp:Identifier ;
        sh:name "identifiers" ;
    ] ;
    sh:property [
        sh:path dpp:evidence ;
        sh:class dpp:Evidence ;
        sh:name "evidence" ;
    ] ;
    sh:property [
        sh:path dpp:extensions ;
        sh:class dpp:Extension ;
        sh:name "extensions" ;
    ] ;
    sh:property [
        sh:path dpp:provenanceFields ;
        sh:class dpp:FieldProvenance ;
        sh:name "provenanceFields" ;
    ] ;
    sh:property [
        sh:path dpp:coreData ;
        sh:class dpp:CoreData ;
        sh:maxCount 1 ;
        sh:name "coreData" ;
    ] ;
    sh:property [
        sh:path dpp:provenance ;
        sh:class dpp:ProvenanceRecord ;
        sh:maxCount 1 ;
        sh:name "provenance" ;
    ] ;
    sh:property [
        sh:path dpp:dataCoverage ;
        sh:class dpp:DataCoverage ;
        sh:maxCount 1 ;
        sh:name "dataCoverage" ;
    ] ;
    sh:property [
        sh:path dpp:gaps ;
        sh:class dpp:MappingGap ;
        sh:name "gaps" ;
    ] ;
    sh:property [
        sh:path dpp:adapter ;
        sh:class dpp:Adapter ;
        sh:maxCount 1 ;
        sh:name "adapter" ;
    ] ;
    sh:property [
        sh:path dpp:dataCarrierObj ;
        sh:class dpp:DataCarrier ;
        sh:maxCount 1 ;
        sh:name "dataCarrierObj" ;
    ] ;
    sh:property [
        sh:path dpp:hasPassportStatus ;
        sh:class dpp:PassportStatus ;
        sh:maxCount 1 ;
        sh:name "hasPassportStatus" ;
    ] ;
    sh:property [
        sh:path dpp:provenanceLinkedData ;
        sh:class prov:Activity ;
        sh:maxCount 1 ;
        sh:name "provenanceLinkedData" ;
    ] .

# -----------------------------------------------------------------------------
# Product
# -----------------------------------------------------------------------------
dpp:ProductShape
    a sh:NodeShape ;
    sh:targetClass dpp:Product ;
    rdfs:label "Product shape" ;
    sh:property [
        sh:path rdfs:label ;
        sh:datatype xsd:string ;
        sh:name "label" ;
    ] ;
    sh:property [
        sh:path dpp:productType ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "productType" ;
    ] ;
    sh:property [
        sh:path dpp:productCategory ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "productCategory" ;
    ] ;
    sh:property [
        sh:path dpp:productModel ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "productModel" ;
    ] ;
    sh:property [
        sh:path dpp:manufacturingDate ;
        sh:datatype xsd:date ;
        sh:maxCount 1 ;
        sh:name "manufacturingDate" ;
    ] ;
    sh:property [
        sh:path dpp:dateIntoService ;
        sh:datatype xsd:date ;
        sh:maxCount 1 ;
        sh:name "dateIntoService" ;
    ] ;
    sh:property [
        sh:path dpp:expiryDate ;
        sh:datatype xsd:date ;
        sh:maxCount 1 ;
        sh:name "expiryDate" ;
    ] ;
    sh:property [
        sh:path dpp:image ;
        sh:datatype xsd:anyURI ;
        sh:maxCount 1 ;
        sh:name "image" ;
    ] .

# -----------------------------------------------------------------------------
# Manufacturer
# -----------------------------------------------------------------------------
dpp:ManufacturerShape
    a sh:NodeShape ;
    sh:targetClass dpp:Manufacturer ;
    rdfs:label "Manufacturer shape" ;
    sh:property [
        sh:path dpp:manufacturerName ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "manufacturerName" ;
    ] ;
    sh:property [
        sh:path dpp:manufacturerId ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "manufacturerId" ;
    ] ;
    sh:property [
        sh:path dpp:address ;
        sh:class dpp:Address ;
        sh:maxCount 1 ;
        sh:name "address" ;
    ] ;
    sh:property [
        sh:path dpp:facility ;
        sh:class dpp:Facility ;
        sh:maxCount 1 ;
        sh:name "facility" ;
    ] .

# -----------------------------------------------------------------------------
# Identifier
# -----------------------------------------------------------------------------
dpp:IdentifierShape
    a sh:NodeShape ;
    sh:targetClass dpp:Identifier ;
    rdfs:label "Identifier shape" ;
    sh:property [
        sh:path dpp:identifierType ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "identifierType" ;
    ] ;
    sh:property [
        sh:path dpp:identifierValue ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "identifierValue" ;
    ] ;
    sh:property [
        sh:path dpp:identifierGranularity ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "identifierGranularity" ;
    ] ;
    sh:property [
        sh:path dpp:identifierIssuedBy ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "identifierIssuedBy" ;
    ] .

# -----------------------------------------------------------------------------
# Evidence
# -----------------------------------------------------------------------------
dpp:EvidenceShape
    a sh:NodeShape ;
    sh:targetClass dpp:Evidence ;
    rdfs:label "Evidence shape" ;
    sh:property [
        sh:path dpp:evidenceSource ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "evidenceSource" ;
    ] ;
    sh:property [
        sh:path dpp:evidenceMatchType ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "evidenceMatchType" ;
    ] ;
    sh:property [
        sh:path dpp:evidenceConfidence ;
        sh:datatype xsd:double ;
        sh:minInclusive 0.0 ;
        sh:maxInclusive 1.0 ;
        sh:maxCount 1 ;
        sh:name "evidenceConfidence" ;
    ] ;
    sh:property [
        sh:path dpp:evidenceMatchedValue ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "evidenceMatchedValue" ;
    ] ;
    sh:property [
        sh:path dpp:evidenceTimestamp ;
        sh:datatype xsd:dateTime ;
        sh:maxCount 1 ;
        sh:name "evidenceTimestamp" ;
    ] .

# -----------------------------------------------------------------------------
# FieldProvenance
# -----------------------------------------------------------------------------
dpp:FieldProvenanceShape
    a sh:NodeShape ;
    sh:targetClass dpp:FieldProvenance ;
    rdfs:label "Field Provenance shape" ;
    sh:property [
        sh:path dpp:sourceField ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "sourceField" ;
    ] ;
    sh:property [
        sh:path dpp:provenanceSource ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "provenanceSource" ;
    ] ;
    sh:property [
        sh:path dpp:provenanceMethod ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "provenanceMethod" ;
    ] ;
    sh:property [
        sh:path dpp:provenanceConfidence ;
        sh:datatype xsd:double ;
        sh:minInclusive 0.0 ;
        sh:maxInclusive 1.0 ;
        sh:maxCount 1 ;
        sh:name "provenanceConfidence" ;
    ] ;
    sh:property [
        sh:path dpp:provenanceTimestamp ;
        sh:datatype xsd:dateTime ;
        sh:maxCount 1 ;
        sh:name "provenanceTimestamp" ;
    ] ;
    sh:property [
        sh:path dpp:provenanceTransformation ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "provenanceTransformation" ;
    ] .

# -----------------------------------------------------------------------------
# Address
# -----------------------------------------------------------------------------
dpp:AddressShape
    a sh:NodeShape ;
    sh:targetClass dpp:Address ;
    rdfs:label "Address shape" ;
    sh:property [
        sh:path dpp:street ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "street" ;
    ] ;
    sh:property [
        sh:path dpp:city ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "city" ;
    ] ;
    sh:property [
        sh:path dpp:postalCode ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "postalCode" ;
    ] ;
    sh:property [
        sh:path dpp:country ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "country" ;
    ] .

# -----------------------------------------------------------------------------
# Facility
# -----------------------------------------------------------------------------
dpp:FacilityShape
    a sh:NodeShape ;
    sh:targetClass dpp:Facility ;
    rdfs:label "Facility shape" ;
    sh:property [
        sh:path rdfs:label ;
        sh:datatype xsd:string ;
        sh:name "label" ;
    ] .

# -----------------------------------------------------------------------------
# MaterialEntry
# -----------------------------------------------------------------------------
dpp:MaterialEntryShape
    a sh:NodeShape ;
    sh:targetClass dpp:MaterialEntry ;
    rdfs:label "Material Entry shape" ;
    sh:property [
        sh:path dpp:materialName ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "materialName" ;
    ] ;
    sh:property [
        sh:path dpp:percentage ;
        sh:datatype xsd:double ;
        sh:minInclusive 0.0 ;
        sh:maxInclusive 100.0 ;
        sh:maxCount 1 ;
        sh:name "percentage" ;
    ] ;
    sh:property [
        sh:path dpp:materialRecycledContent ;
        sh:datatype xsd:double ;
        sh:minInclusive 0.0 ;
        sh:maxInclusive 100.0 ;
        sh:maxCount 1 ;
        sh:name "materialRecycledContent" ;
    ] ;
    sh:property [
        sh:path dpp:materialMass ;
        sh:class qudt:QuantityValue ;
        sh:maxCount 1 ;
        sh:name "materialMass" ;
    ] .

# -----------------------------------------------------------------------------
# DataCarrier
# -----------------------------------------------------------------------------
dpp:DataCarrierShape
    a sh:NodeShape ;
    sh:targetClass dpp:DataCarrier ;
    rdfs:label "Data Carrier shape" ;
    sh:property [
        sh:path dpp:dataCarrierUrl ;
        sh:datatype xsd:anyURI ;
        sh:maxCount 1 ;
        sh:name "dataCarrierUrl" ;
    ] ;
    sh:property [
        sh:path dpp:dataCarrierType ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "dataCarrierType" ;
    ] .

# -----------------------------------------------------------------------------
# MappingGap
# -----------------------------------------------------------------------------
dpp:MappingGapShape
    a sh:NodeShape ;
    sh:targetClass dpp:MappingGap ;
    rdfs:label "Mapping Gap shape" ;
    sh:property [
        sh:path dpp:gapField ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "gapField" ;
    ] ;
    sh:property [
        sh:path dpp:gapReason ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "gapReason" ;
    ] ;
    sh:property [
        sh:path dpp:gapSeverity ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "gapSeverity" ;
    ] ;
    sh:property [
        sh:path dpp:gapExplanation ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "gapExplanation" ;
    ] ;
    sh:property [
        sh:path dpp:gapCategory ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "gapCategory" ;
    ] .

# -----------------------------------------------------------------------------
# Adapter
# -----------------------------------------------------------------------------
dpp:AdapterShape
    a sh:NodeShape ;
    sh:targetClass dpp:Adapter ;
    rdfs:label "Adapter shape" ;
    sh:property [
        sh:path dpp:adapterVersion ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "adapterVersion" ;
    ] ;
    sh:property [
        sh:path dpp:targetSchema ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "targetSchema" ;
    ] .

# -----------------------------------------------------------------------------
# DataCoverage
# -----------------------------------------------------------------------------
dpp:DataCoverageShape
    a sh:NodeShape ;
    sh:targetClass dpp:DataCoverage ;
    rdfs:label "Data Coverage shape" ;
    sh:property [
        sh:path dpp:coverageScore ;
        sh:datatype xsd:double ;
        sh:minInclusive 0.0 ;
        sh:maxInclusive 1.0 ;
        sh:maxCount 1 ;
        sh:name "coverageScore" ;
    ] ;
    sh:property [
        sh:path dpp:populatedFields ;
        sh:datatype xsd:integer ;
        sh:minInclusive 0 ;
        sh:maxCount 1 ;
        sh:name "populatedFields" ;
    ] ;
    sh:property [
        sh:path dpp:expectedFields ;
        sh:datatype xsd:integer ;
        sh:minInclusive 0 ;
        sh:maxCount 1 ;
        sh:name "expectedFields" ;
    ] .

# -----------------------------------------------------------------------------
# CoreData
# -----------------------------------------------------------------------------
dpp:CoreDataShape
    a sh:NodeShape ;
    sh:targetClass dpp:CoreData ;
    rdfs:label "Core Data shape" .

# -----------------------------------------------------------------------------
# ProvenanceRecord
# -----------------------------------------------------------------------------
dpp:ProvenanceRecordShape
    a sh:NodeShape ;
    sh:targetClass dpp:ProvenanceRecord ;
    rdfs:label "Provenance Record shape" .

# -----------------------------------------------------------------------------
# Extension (abstract base for all extension modules)
# -----------------------------------------------------------------------------
dpp:ExtensionShape
    a sh:NodeShape ;
    sh:targetClass dpp:Extension ;
    rdfs:label "Extension shape" .

# -----------------------------------------------------------------------------
# PassportStatus (enumerated class)
# -----------------------------------------------------------------------------
dpp:PassportStatusShape
    a sh:NodeShape ;
    sh:targetClass dpp:PassportStatus ;
    rdfs:label "Passport Status shape" .

# -----------------------------------------------------------------------------
# LegalEntity
# -----------------------------------------------------------------------------
dpp:LegalEntityShape
    a sh:NodeShape ;
    sh:targetClass dpp:LegalEntity ;
    rdfs:label "Legal Entity shape" .

# -----------------------------------------------------------------------------
# EconomicOperator (DEPRECATED but included for backward compatibility)
# -----------------------------------------------------------------------------
dpp:EconomicOperatorShape
    a sh:NodeShape ;
    sh:targetClass dpp:EconomicOperator ;
    rdfs:label "Economic Operator shape (deprecated)" ;
    sh:property [
        sh:path dpp:economicOperatorName ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "economicOperatorName" ;
    ] ;
    sh:property [
        sh:path dpp:economicOperatorId ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "economicOperatorId" ;
    ] .

# -----------------------------------------------------------------------------
# Composition (DEPRECATED but included for backward compatibility)
# -----------------------------------------------------------------------------
dpp:CompositionShape
    a sh:NodeShape ;
    sh:targetClass dpp:Composition ;
    rdfs:label "Composition shape (deprecated)" ;
    sh:property [
        sh:path dpp:componentMaterials ;
        sh:class dpp:MaterialEntry ;
        sh:name "componentMaterials" ;
    ] ;
    sh:property [
        sh:path dpp:recycledContent ;
        sh:class dpp:MaterialEntry ;
        sh:name "recycledContent" ;
    ] .
