@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 compliance: <https://www.dpp-interoperability.wiki/vocab/v1/compliance#> .

# =============================================================================
# SHACL Shapes for Compliance Extension Vocabulary v0.1
# Companion to: https://www.dpp-interoperability.wiki/vocab/v1/compliance#
# =============================================================================

<https://www.dpp-interoperability.wiki/vocab/v1/compliance.shacl>
    a owl:Ontology ;
    rdfs:label "Compliance Extension SHACL Shapes" ;
    rdfs:comment "SHACL validation shapes for the DPP Compliance Extension vocabulary v0.1. Covers standards, declarations, regulatory references, audit records, and certifications." ;
    dcterms:created "2026-03-05"^^xsd:date ;
    rdfs:seeAlso <https://www.dpp-interoperability.wiki/vocab/v1/compliance#> .

# -----------------------------------------------------------------------------
# ComplianceExtension
# -----------------------------------------------------------------------------
compliance:ComplianceExtensionShape
    a sh:NodeShape ;
    sh:targetClass compliance:ComplianceExtension ;
    rdfs:label "Compliance Extension shape" ;
    sh:property [
        sh:path compliance:standards ;
        sh:class compliance:Standard ;
        sh:minCount 1 ;
        sh:name "standards" ;
    ] ;
    sh:property [
        sh:path compliance:declarations ;
        sh:class compliance:Declaration ;
        sh:name "declarations" ;
    ] ;
    sh:property [
        sh:path compliance:regulatoryReferences ;
        sh:class compliance:RegulatoryReference ;
        sh:name "regulatoryReferences" ;
    ] ;
    sh:property [
        sh:path compliance:auditHistory ;
        sh:class compliance:AuditRecord ;
        sh:name "auditHistory" ;
    ] ;
    sh:property [
        sh:path compliance:certifications ;
        sh:class compliance:Certification ;
        sh:name "certifications" ;
    ] .

# -----------------------------------------------------------------------------
# Standard
# -----------------------------------------------------------------------------
compliance:StandardShape
    a sh:NodeShape ;
    sh:targetClass compliance:Standard ;
    rdfs:label "Standard shape" ;
    sh:property [
        sh:path compliance:standardName ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "standardName" ;
    ] ;
    sh:property [
        sh:path compliance:complianceStatus ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "complianceStatus" ;
    ] ;
    sh:property [
        sh:path compliance:standardVersion ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "standardVersion" ;
    ] ;
    sh:property [
        sh:path compliance:assessmentDate ;
        sh:datatype xsd:date ;
        sh:maxCount 1 ;
        sh:name "assessmentDate" ;
    ] ;
    sh:property [
        sh:path compliance:expiryDate ;
        sh:datatype xsd:date ;
        sh:maxCount 1 ;
        sh:name "expiryDate" ;
    ] ;
    sh:property [
        sh:path compliance:notes ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "notes" ;
    ] .

# -----------------------------------------------------------------------------
# Declaration
# -----------------------------------------------------------------------------
compliance:DeclarationShape
    a sh:NodeShape ;
    sh:targetClass compliance:Declaration ;
    rdfs:label "Declaration shape" ;
    sh:property [
        sh:path compliance:declarationType ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "declarationType" ;
    ] ;
    sh:property [
        sh:path compliance:documentUrl ;
        sh:datatype xsd:anyURI ;
        sh:maxCount 1 ;
        sh:name "documentUrl" ;
    ] ;
    sh:property [
        sh:path compliance:issuer ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "issuer" ;
    ] ;
    sh:property [
        sh:path compliance:issueDate ;
        sh:datatype xsd:date ;
        sh:maxCount 1 ;
        sh:name "issueDate" ;
    ] .

# -----------------------------------------------------------------------------
# RegulatoryReference
# -----------------------------------------------------------------------------
compliance:RegulatoryReferenceShape
    a sh:NodeShape ;
    sh:targetClass compliance:RegulatoryReference ;
    rdfs:label "Regulatory Reference shape" ;
    sh:property [
        sh:path compliance:regulationName ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "regulationName" ;
    ] ;
    sh:property [
        sh:path compliance:applicableArticles ;
        sh:datatype xsd:string ;
        sh:name "applicableArticles" ;
    ] ;
    sh:property [
        sh:path compliance:regulationUrl ;
        sh:datatype xsd:anyURI ;
        sh:maxCount 1 ;
        sh:name "regulationUrl" ;
    ] .

# -----------------------------------------------------------------------------
# AuditRecord
# -----------------------------------------------------------------------------
compliance:AuditRecordShape
    a sh:NodeShape ;
    sh:targetClass compliance:AuditRecord ;
    rdfs:label "Audit Record shape" ;
    sh:property [
        sh:path compliance:auditor ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "auditor" ;
    ] ;
    sh:property [
        sh:path compliance:auditScope ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "auditScope" ;
    ] ;
    sh:property [
        sh:path compliance:auditDate ;
        sh:datatype xsd:date ;
        sh:maxCount 1 ;
        sh:name "auditDate" ;
    ] ;
    sh:property [
        sh:path compliance:auditResult ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "auditResult" ;
    ] ;
    sh:property [
        sh:path compliance:reportUrl ;
        sh:datatype xsd:anyURI ;
        sh:maxCount 1 ;
        sh:name "reportUrl" ;
    ] .

# -----------------------------------------------------------------------------
# Certification
# -----------------------------------------------------------------------------
compliance:CertificationShape
    a sh:NodeShape ;
    sh:targetClass compliance:Certification ;
    rdfs:label "Certification shape" ;
    sh:property [
        sh:path compliance:certificationName ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "certificationName" ;
    ] ;
    sh:property [
        sh:path compliance:certificationBody ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "certificationBody" ;
    ] ;
    sh:property [
        sh:path compliance:certificationNumber ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:name "certificationNumber" ;
    ] ;
    sh:property [
        sh:path compliance:certificationIssueDate ;
        sh:datatype xsd:date ;
        sh:maxCount 1 ;
        sh:name "certificationIssueDate" ;
    ] ;
    sh:property [
        sh:path compliance:certificationExpiryDate ;
        sh:datatype xsd:date ;
        sh:maxCount 1 ;
        sh:name "certificationExpiryDate" ;
    ] ;
    sh:property [
        sh:path compliance:certificationDocumentUrl ;
        sh:datatype xsd:anyURI ;
        sh:maxCount 1 ;
        sh:name "certificationDocumentUrl" ;
    ] .
