@prefix gedra: <https://specs.kivanura.org/gedra#> .
@prefix gedrm: <https://specs.kivanura.org/gedrm#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@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 dcterms: <http://purl.org/dc/terms/> .

<https://specs.kivanura.org/gedra/0.1/shacl> a owl:Ontology ;
  dcterms:title "GEDRA 0.1 — SHACL Core Conformance Shapes" ;
  dcterms:identifier "GEDRA 0.1 SHACL" ;
  dcterms:hasVersion "0.1" ;
  dcterms:description "Objective machine-checkable GEDRA 0.1 semantic and conformance constraints. Passing SHACL does not by itself establish architectural conformance." .

gedra:relationship a rdf:Property ; rdfs:label "relationship" .

gedra:CanonicalGEDRAConstructShape a sh:NodeShape ;
  sh:targetClass gedra:ArchitecturalConstruct ;
  rdfs:label "Canonical GEDRA Construct Integrity" ;
  dcterms:identifier "GEDRA-C-004" ;
  sh:severity sh:Violation ;
  sh:property [
    sh:path dcterms:identifier ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:message "GEDRA-C-004: canonical GEDRA construct requires exactly one identifier." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path rdfs:label ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:message "Canonical GEDRA construct requires exactly one label." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:status ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:message "Canonical GEDRA construct requires exactly one status." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:introducedIn ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:message "Canonical GEDRA construct requires exactly one introducedIn value." ;
    sh:severity sh:Violation
  ] .

gedra:ArchitectureInstanceShape a sh:NodeShape ;
  sh:targetClass gedra:ArchitectureInstance ;
  rdfs:label "Architecture Instance Shape" ;
  dcterms:identifier "GEDRA-C-003" ;
  dcterms:identifier "GEDRA-C-001" ;
  sh:severity sh:Violation ;
  sh:property [
    sh:path rdfs:label ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:message "GEDRA-C-001: ArchitectureInstance requires exactly one name." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:architectureType ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:message "GEDRA-C-001: ArchitectureInstance requires exactly one architectureType." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:architectureType ;
    sh:in ( "enterprise" "domain" "programme" "solution" "implementation" "other" ) ;
    sh:message "GEDRA-C-003: architectureType must use the controlled vocabulary." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:scope ;
    sh:minCount 1 ;
    sh:message "GEDRA-C-001: ArchitectureInstance requires at least one scope." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:gedraVersion ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:message "GEDRA-C-001: ArchitectureInstance requires exactly one GEDRA version." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:status ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:message "GEDRA-C-001: ArchitectureInstance requires exactly one status." ;
    sh:severity sh:Violation
  ] .

gedra:ArchitectureElementShape a sh:NodeShape ;
  sh:targetClass gedra:ArchitectureElement ;
  rdfs:label "Architecture Element Shape" ;
  sh:severity sh:Violation ;
  sh:property [
    sh:path rdfs:label ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:message "ArchitectureElement requires exactly one name." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:elementType ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:message "ArchitectureElement requires exactly one elementType." ;
    sh:severity sh:Violation
  ] .

gedra:ArchitectureMappingShape a sh:NodeShape ;
  sh:targetClass gedra:ArchitectureMapping ;
  rdfs:label "Architecture Mapping Shape" ;
  dcterms:identifier "GEDRA-C-020" ;
  dcterms:identifier "GEDRA-C-021" ;
  dcterms:identifier "GEDRA-C-022" ;
  sh:severity sh:Violation ;
  sh:property [
    sh:path gedra:subject ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:nodeKind sh:IRI ;
    sh:message "GEDRA-C-020: ArchitectureMapping requires exactly one source." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:relationship ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:nodeKind sh:IRI ;
    sh:message "GEDRA-C-021: ArchitectureMapping requires exactly one relationship IRI." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:mapsTo ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:nodeKind sh:IRI ;
    sh:message "GEDRA-C-022: ArchitectureMapping requires exactly one target." ;
    sh:severity sh:Violation
  ] .

gedra:TerminologyMappingShape a sh:NodeShape ;
  sh:targetClass gedra:TerminologyMapping ;
  rdfs:label "Terminology Mapping Shape" ;
  dcterms:identifier "GEDRA-C-003" ;
  dcterms:identifier "GEDRA-C-040" ;
  dcterms:identifier "GEDRA-C-041" ;
  dcterms:identifier "GEDRA-C-042" ;
  sh:severity sh:Violation ;
  sh:property [
    sh:path gedra:localTerm ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:message "GEDRA-C-040: TerminologyMapping requires exactly one localTerm." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:targetConcept ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:nodeKind sh:IRI ;
    sh:message "GEDRA-C-041: TerminologyMapping requires exactly one targetConcept." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:mappingType ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:message "GEDRA-C-042: TerminologyMapping requires exactly one mappingType." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:mappingType ;
    sh:in ( "equivalent" "specializes" "broader" "narrower" "related" "not-equivalent" ) ;
    sh:message "GEDRA-C-003: mappingType must use the controlled vocabulary." ;
    sh:severity sh:Violation
  ] .

gedra:ApplicabilityStatementShape a sh:NodeShape ;
  sh:targetClass gedra:ApplicabilityStatement ;
  rdfs:label "Applicability Statement Shape" ;
  dcterms:identifier "GEDRA-C-003" ;
  dcterms:identifier "GEDRA-C-030" ;
  dcterms:identifier "GEDRA-C-031" ;
  dcterms:identifier "GEDRA-C-032" ;
  sh:severity sh:Violation ;
  sh:property [
    sh:path gedra:subject ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:nodeKind sh:IRI ;
    sh:message "ApplicabilityStatement requires exactly one subject." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:targetResponsibility ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:nodeKind sh:IRI ;
    sh:message "ApplicabilityStatement requires exactly one targetResponsibility." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:status ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:message "ApplicabilityStatement requires exactly one status." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:status ;
    sh:in ( "applicable" "not-applicable" "inherited" "delegated" ) ;
    sh:message "GEDRA-C-003: applicability status must use the controlled vocabulary." ;
    sh:severity sh:Violation
  ] ;
  sh:sparql [
    a sh:SPARQLConstraint ;
    sh:message "GEDRA-C-030: not-applicable requires a rationale." ;
    sh:select """
      PREFIX gedra: <https://specs.kivanura.org/gedra#>
      SELECT $this WHERE {
        $this gedra:status "not-applicable" .
        FILTER NOT EXISTS { $this gedra:rationale ?r . FILTER(STRLEN(STR(?r)) > 0) }
      }
    """
  ] ;
  sh:sparql [
    a sh:SPARQLConstraint ;
    sh:message "GEDRA-C-031: inherited requires inheritedFrom." ;
    sh:select """
      PREFIX gedra: <https://specs.kivanura.org/gedra#>
      SELECT $this WHERE {
        $this gedra:status "inherited" .
        FILTER NOT EXISTS { $this gedra:inheritedFrom ?source . }
      }
    """
  ] ;
  sh:sparql [
    a sh:SPARQLConstraint ;
    sh:message "GEDRA-C-032: delegated requires delegatedTo." ;
    sh:select """
      PREFIX gedra: <https://specs.kivanura.org/gedra#>
      SELECT $this WHERE {
        $this gedra:status "delegated" .
        FILTER NOT EXISTS { $this gedra:delegatedTo ?target . }
      }
    """
  ] .

gedra:ApplicableResponsibilityEvidenceShape a sh:NodeShape ;
  sh:targetClass gedra:ApplicabilityStatement ;
  rdfs:label "Applicable Responsibility Evidence Warning" ;
  dcterms:identifier "GEDRA-C-033" ;
  sh:severity sh:Warning ;
  sh:sparql [
    a sh:SPARQLConstraint ;
    sh:message "GEDRA-C-033: applicable responsibility should link to realization, mapping, or assessment evidence." ;
    sh:select """
      PREFIX gedra: <https://specs.kivanura.org/gedra#>
      SELECT $this WHERE {
        $this gedra:status "applicable" .
        FILTER NOT EXISTS { $this gedra:supportedBy ?e . }
        FILTER NOT EXISTS { $this gedra:realizes ?r . }
        FILTER NOT EXISTS { $this gedra:mapsTo ?m . }
      }
    """
  ] .

gedra:ExtensionShape a sh:NodeShape ;
  sh:targetClass gedra:Extension ;
  rdfs:label "Extension Shape" ;
  sh:severity sh:Violation ;
  sh:property [
    sh:path rdfs:label ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:message "Extension requires exactly one name." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path rdfs:comment ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:message "Extension requires exactly one description." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:scope ;
    sh:minCount 1 ;
    sh:message "Extension requires at least one scope." ;
    sh:severity sh:Violation
  ] .

gedra:DeviationShape a sh:NodeShape ;
  sh:targetClass gedra:Deviation ;
  rdfs:label "Deviation Shape" ;
  dcterms:identifier "GEDRA-C-050" ;
  sh:severity sh:Violation ;
  sh:property [
    sh:path gedra:subject ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:nodeKind sh:IRI ;
    sh:message "GEDRA-C-050: Deviation requires exactly one subject." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:deviatesFrom ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:nodeKind sh:IRI ;
    sh:message "GEDRA-C-050: Deviation requires exactly one deviatesFrom target." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:reason ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:message "GEDRA-C-050: Deviation requires exactly one reason." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:status ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:message "GEDRA-C-050: Deviation requires exactly one status." ;
    sh:severity sh:Violation
  ] .

gedra:AssessmentEvidenceReferenceShape a sh:NodeShape ;
  sh:targetClass gedra:AssessmentEvidenceReference ;
  rdfs:label "Assessment Evidence Reference Shape" ;
  sh:severity sh:Violation ;
  sh:property [
    sh:path gedra:evidenceType ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:message "AssessmentEvidenceReference requires exactly one evidenceType." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:reference ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:message "AssessmentEvidenceReference requires exactly one reference." ;
    sh:severity sh:Violation
  ] .

gedra:ConformanceClaimShape a sh:NodeShape ;
  sh:targetClass gedra:ConformanceClaim ;
  rdfs:label "Conformance Claim Shape" ;
  dcterms:identifier "GEDRA-C-003" ;
  dcterms:identifier "GEDRA-C-002" ;
  sh:severity sh:Violation ;
  sh:property [
    sh:path gedra:assesses ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:nodeKind sh:IRI ;
    sh:message "GEDRA-C-002: ConformanceClaim requires exactly one assesses target." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:gedraVersion ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:message "GEDRA-C-002: ConformanceClaim requires exactly one GEDRA version." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:scope ;
    sh:minCount 1 ;
    sh:message "GEDRA-C-002: ConformanceClaim requires at least one scope." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:claimsConformanceLevel ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:nodeKind sh:IRI ;
    sh:message "GEDRA-C-002: ConformanceClaim requires exactly one conformance level." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:assessmentDate ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:date ;
    sh:message "GEDRA-C-002: ConformanceClaim requires exactly one assessmentDate." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:assessmentResult ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:message "GEDRA-C-002: ConformanceClaim requires exactly one assessmentResult." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:assessmentResult ;
    sh:in ( "conformant" "conformant-with-approved-deviations" "not-conformant" "assessment-incomplete" ) ;
    sh:message "GEDRA-C-003: assessmentResult must use the controlled vocabulary." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:status ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:datatype xsd:string ;
    sh:message "GEDRA-C-002: ConformanceClaim requires exactly one status." ;
    sh:severity sh:Violation
  ] ;
  sh:property [
    sh:path gedra:status ;
    sh:in ( "draft" "self-assessed" "reviewed" "approved" "approved-with-deviation" "not-conformant" "expired" "superseded" ) ;
    sh:message "GEDRA-C-003: claim status must use the controlled vocabulary." ;
    sh:severity sh:Violation
  ] .

gedra:C1ProhibitedSemanticEquivalenceShape a sh:NodeShape ;
  sh:targetClass gedra:TerminologyMapping ;
  rdfs:label "C1 Prohibited Semantic Equivalence Shape" ;
  dcterms:identifier "GEDRA-C-074" ;
  dcterms:identifier "GEDRA-C-075" ;
  dcterms:identifier "GEDRA-C-076" ;
  dcterms:identifier "GEDRA-C-077" ;
  dcterms:identifier "GEDRA-C-061" ;
  sh:severity sh:Violation ;
  sh:sparql [
    a sh:SPARQLConstraint ;
    sh:message "GEDRA-C-061: explicit terminology equivalence violates a locked GEDRA/GEDRM semantic distinction." ;
    sh:select """
      PREFIX gedra: <https://specs.kivanura.org/gedra#>
      PREFIX gedrm: <https://specs.kivanura.org/gedrm#>
      SELECT $this WHERE {
        $this gedra:mappingType "equivalent" ;
              gedra:targetConcept ?target ;
              gedra:localTerm ?local .
        BIND(LCASE(STR(?local)) AS ?l)
        FILTER (
          (?target = gedrm:AuthoritativeSource && CONTAINS(?l, "system of record")) ||
          (?target = gedrm:DataProcessor && CONTAINS(?l, "data transformer")) ||
          (?target = gedrm:DataProduct && CONTAINS(?l, "data asset")) ||
          (?target = gedrm:DataControl && (CONTAINS(?l, "policy") || CONTAINS(?l, "data quality rule") || CONTAINS(?l, "dashboard") || CONTAINS(?l, "metric"))) ||
          (?target = gedrm:DataConsumer && CONTAINS(?l, "data recipient"))
        )
      }
    """
  ] .

gedra:C2C3EvidenceShape a sh:NodeShape ;
  sh:targetClass gedra:ConformanceClaim ;
  rdfs:label "C2/C3 Supporting Evidence Shape" ;
  dcterms:identifier "GEDRA-C-060" ;
  sh:severity sh:Violation ;
  sh:sparql [
    a sh:SPARQLConstraint ;
    sh:message "GEDRA-C-060: C2/C3 claims require at least one supporting evidence reference." ;
    sh:select """
      PREFIX gedra: <https://specs.kivanura.org/gedra#>
      SELECT $this WHERE {
        $this gedra:claimsConformanceLevel ?level .
        FILTER(?level IN (gedra:ArchitecturalAlignment, gedra:ProfiledConformance))
        FILTER NOT EXISTS { $this gedra:supportedBy ?e . }
      }
    """
  ] .

gedra:C3RequiresProfileShape a sh:NodeShape ;
  sh:targetClass gedra:ConformanceClaim ;
  rdfs:label "C3 Requires Profile Shape" ;
  dcterms:identifier "GEDRA-C-010" ;
  sh:severity sh:Violation ;
  sh:sparql [
    a sh:SPARQLConstraint ;
    sh:message "GEDRA-C-010: C3 Profiled Conformance requires at least one applied profile." ;
    sh:select """
      PREFIX gedra: <https://specs.kivanura.org/gedra#>
      SELECT $this WHERE {
        $this gedra:claimsConformanceLevel gedra:ProfiledConformance .
        FILTER NOT EXISTS { $this gedra:appliesProfile ?p . }
      }
    """
  ] .

gedra:AssessesCompatibilityShape a sh:NodeShape ;
  sh:targetClass gedra:ConformanceClaim ;
  rdfs:label "assesses Relationship Compatibility" ;
  dcterms:identifier "GEDRA-C-023" ;
  sh:severity sh:Violation ;
  sh:property [
    sh:path gedra:assesses ;
    sh:class gedra:ArchitectureInstance ;
    sh:message "GEDRA-C-023: assesses target must be compatible with ArchitectureInstance." ;
    sh:severity sh:Violation
  ] .

gedra:ClaimsConformanceLevelCompatibilityShape a sh:NodeShape ;
  sh:targetClass gedra:ConformanceClaim ;
  rdfs:label "claimsConformanceLevel Relationship Compatibility" ;
  dcterms:identifier "GEDRA-C-023" ;
  sh:severity sh:Violation ;
  sh:property [
    sh:path gedra:claimsConformanceLevel ;
    sh:class gedra:ConformanceLevel ;
    sh:message "GEDRA-C-023: claimsConformanceLevel target must be compatible with ConformanceLevel." ;
    sh:severity sh:Violation
  ] .

gedra:HasDeviationCompatibilityShape a sh:NodeShape ;
  sh:targetClass gedra:ConformanceClaim ;
  rdfs:label "hasDeviation Relationship Compatibility" ;
  dcterms:identifier "GEDRA-C-023" ;
  sh:severity sh:Violation ;
  sh:property [
    sh:path gedra:hasDeviation ;
    sh:class gedra:Deviation ;
    sh:message "GEDRA-C-023: hasDeviation target must be compatible with Deviation." ;
    sh:severity sh:Violation
  ] .

gedra:HasExtensionCompatibilityShape a sh:NodeShape ;
  sh:targetClass gedra:ConformanceClaim ;
  rdfs:label "hasExtension Relationship Compatibility" ;
  dcterms:identifier "GEDRA-C-023" ;
  sh:severity sh:Violation ;
  sh:property [
    sh:path gedra:hasExtension ;
    sh:class gedra:Extension ;
    sh:message "GEDRA-C-023: hasExtension target must be compatible with Extension." ;
    sh:severity sh:Violation
  ] .

gedra:HasTerminologyMappingCompatibilityShape a sh:NodeShape ;
  sh:targetClass gedra:ConformanceClaim ;
  rdfs:label "hasTerminologyMapping Relationship Compatibility" ;
  dcterms:identifier "GEDRA-C-023" ;
  sh:severity sh:Violation ;
  sh:property [
    sh:path gedra:hasTerminologyMapping ;
    sh:class gedra:TerminologyMapping ;
    sh:message "GEDRA-C-023: hasTerminologyMapping target must be compatible with TerminologyMapping." ;
    sh:severity sh:Violation
  ] .

gedra:SupportedByCompatibilityShape a sh:NodeShape ;
  sh:targetClass gedra:ConformanceClaim ;
  rdfs:label "supportedBy Relationship Compatibility" ;
  dcterms:identifier "GEDRA-C-023" ;
  sh:severity sh:Violation ;
  sh:property [
    sh:path gedra:supportedBy ;
    sh:class gedra:AssessmentEvidenceReference ;
    sh:message "GEDRA-C-023: supportedBy target must be compatible with AssessmentEvidenceReference." ;
    sh:severity sh:Violation
  ] .

gedra:UsesPatternCompatibilityShape a sh:NodeShape ;
  sh:targetClass gedra:ArchitectureInstance ;
  rdfs:label "usesPattern Relationship Compatibility" ;
  dcterms:identifier "GEDRA-C-023" ;
  sh:severity sh:Violation ;
  sh:property [
    sh:path gedra:usesPattern ;
    sh:class gedra:ArchitecturePattern ;
    sh:message "GEDRA-C-023: usesPattern target must be compatible with ArchitecturePattern." ;
    sh:severity sh:Violation
  ] .

gedra:NoCoreAIProductScopeGuardShape a sh:NodeShape ;
  sh:targetNode <https://specs.kivanura.org/gedra/0.1> ;
  dcterms:identifier "GEDRA-C-090" ;
  sh:sparql [
    a sh:SPARQLConstraint ;
    sh:message "GEDRA-C-090: AI Product / Intelligence-specific constructs must not be introduced as GEDRA 0.1 core constructs." ;
    sh:select """
      PREFIX gedra: <https://specs.kivanura.org/gedra#>
      SELECT $this WHERE {
        VALUES ?forbidden { gedra:AIProduct gedra:FoundationModel gedra:InferenceActivity gedra:TrainingActivity gedra:Agent }
        ?forbidden ?p ?o .
      }
    """
  ] .


gedra:ArchitectureMappingRegisteredCompatibilityShape a sh:NodeShape ;
  sh:targetClass gedra:ArchitectureMapping ;
  dcterms:identifier "GEDRA-C-023" ;
  sh:sparql [
    a sh:SPARQLConstraint ;
    sh:message "GEDRA-C-023: ArchitectureMapping relationship/target combination is incompatible." ;
    sh:select """
      PREFIX gedra: <https://specs.kivanura.org/gedra#>
      SELECT $this WHERE {
        $this gedra:relationship ?relationship ;
              gedra:mapsTo ?target .
        FILTER (
          (?relationship = gedra:claimsConformanceLevel &&
           ?target NOT IN (gedra:SemanticAlignment, gedra:ArchitecturalAlignment, gedra:ProfiledConformance))
        )
      }
    """
  ] .

gedra:ConstraintMeta_GEDRA_C_001 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-001" ;
  rdfs:label "Architecture Instance Required Identity" ;
  sh:severity sh:Violation ;
  sh:message "An ArchitectureInstance must identify itself, its name, architecture type, scope, GEDRA version, and status." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_002 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-002" ;
  rdfs:label "Conformance Claim Required Identity" ;
  sh:severity sh:Violation ;
  sh:message "A ConformanceClaim must identify the assessed ArchitectureInstance, GEDRA version, scope, conformance level, assessment date, assessment result, and status." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_003 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-003" ;
  rdfs:label "Controlled Vocabulary Values" ;
  sh:severity sh:Violation ;
  sh:message "Values governed by GEDRA controlled vocabularies must use a registered value." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_004 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-004" ;
  rdfs:label "Canonical Reference Resolution" ;
  sh:severity sh:Violation ;
  sh:message "References to canonical GEDRA constructs, relationships, conformance levels, and profiles must resolve to known identifiers or explicitly declared external references." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_005 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-005" ;
  rdfs:label "Exact GEDRA Version Binding" ;
  sh:severity sh:Violation ;
  sh:message "A machine-readable architecture, claim, or profile must identify the exact GEDRA version against which it is described or assessed." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_010 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-010" ;
  rdfs:label "C3 Requires Profile" ;
  sh:severity sh:Violation ;
  sh:message "A C3 Profiled Conformance claim must identify at least one applied profile." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_011 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-011" ;
  rdfs:label "Profile Exact Parent Version" ;
  sh:severity sh:Violation ;
  sh:message "A GEDRA profile must identify the exact parent GEDRA version it specializes." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_012 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-012" ;
  rdfs:label "Conformance Levels Are Cumulative" ;
  sh:severity sh:Violation ;
  sh:message "C2 includes C1, and C3 includes C1 plus C2 plus applicable profile requirements; a higher-level conformant claim cannot bypass a failed prerequisite level." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_020 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-020" ;
  rdfs:label "Architecture Mapping Source Required" ;
  sh:severity sh:Violation ;
  sh:message "Every ArchitectureMapping must identify exactly one source." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_021 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-021" ;
  rdfs:label "Architecture Mapping Relationship Required" ;
  sh:severity sh:Violation ;
  sh:message "Every ArchitectureMapping must identify exactly one registered relationship." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_022 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-022" ;
  rdfs:label "Architecture Mapping Target Required" ;
  sh:severity sh:Violation ;
  sh:message "Every ArchitectureMapping must identify exactly one target." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_023 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-023" ;
  rdfs:label "Relationship Source Target Compatibility" ;
  sh:severity sh:Violation ;
  sh:message "The source and target categories of a mapping must be compatible with the registered GEDRA relationship definition." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_024 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-024" ;
  rdfs:label "Mapping Does Not Imply Equivalence" ;
  sh:severity sh:Violation ;
  sh:message "A generic mapping must not be interpreted as semantic equivalence unless equivalence is explicitly declared through the controlled mapping semantics." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_030 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-030" ;
  rdfs:label "Not Applicable Requires Rationale" ;
  sh:severity sh:Violation ;
  sh:message "A not-applicable statement must include an explicit rationale demonstrating why the responsibility does not apply to the declared scope." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_031 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-031" ;
  rdfs:label "Inherited Responsibility Requires Source" ;
  sh:severity sh:Violation ;
  sh:message "An inherited applicability statement must identify the architecture or governed source from which the responsibility is inherited." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_032 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-032" ;
  rdfs:label "Delegated Responsibility Requires Target" ;
  sh:severity sh:Violation ;
  sh:message "A delegated applicability statement must identify the governed architecture, capability, or external reference to which the responsibility is delegated." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_033 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-033" ;
  rdfs:label "Applicable Responsibility Should Have Realization Evidence" ;
  sh:severity sh:Warning ;
  sh:message "An applicable responsibility used in C2/C3 assessment should be linked to an architecture mapping, realization, or other assessment evidence." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_034 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-034" ;
  rdfs:label "Omission Is Not Non Applicability" ;
  sh:severity sh:Violation ;
  sh:message "A material GEDRA responsibility cannot be treated as not applicable merely because it is absent from an architecture description; applicability must be explicit for C2/C3 assessment." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_040 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-040" ;
  rdfs:label "Terminology Mapping Local Term Required" ;
  sh:severity sh:Violation ;
  sh:message "Every TerminologyMapping must identify exactly one local term." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_041 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-041" ;
  rdfs:label "Terminology Mapping Target Required" ;
  sh:severity sh:Violation ;
  sh:message "Every TerminologyMapping must identify exactly one canonical or governed target concept." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_042 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-042" ;
  rdfs:label "Terminology Mapping Type Required" ;
  sh:severity sh:Violation ;
  sh:message "Every TerminologyMapping must declare exactly one controlled mapping type." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_043 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-043" ;
  rdfs:label "Local Terminology Must Be Explicitly Mapped" ;
  sh:severity sh:Warning ;
  sh:message "Where local terminology differs materially from GEDRA/GEDRM terminology, an explicit semantically compatible terminology mapping should be supplied." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_050 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-050" ;
  rdfs:label "Deviation Required Core Fields" ;
  sh:severity sh:Violation ;
  sh:message "A deviation must identify its subject, affected GEDRA expectation, reason, and status." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_051 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-051" ;
  rdfs:label "Deviation Should Carry Governance Context" ;
  sh:severity sh:Warning ;
  sh:message "A material deviation should record scope, risk, approver, duration or review date, and remediation/review plan where applicable." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_052 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-052" ;
  rdfs:label "Semantic Incompatibility Cannot Be Waived Into Conformance" ;
  sh:severity sh:Violation ;
  sh:message "A deviation that fundamentally redefines a locked GEDRM/GEDRA semantic distinction cannot support a conformant or conformant-with-approved-deviations result." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_053 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-053" ;
  rdfs:label "Extension Must Not Redefine Core Semantics" ;
  sh:severity sh:Violation ;
  sh:message "An extension may add local constructs but must not incompatibly redefine GEDRM/GEDRA core meaning." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_060 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-060" ;
  rdfs:label "C2 and C3 Require Supporting Evidence" ;
  sh:severity sh:Violation ;
  sh:message "A C2 or C3 conformance claim must reference at least one item of assessment evidence." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_061 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-061" ;
  rdfs:label "C1 Preserves Semantic Distinctions" ;
  sh:severity sh:Violation ;
  sh:message "C1 requires preservation of applicable GEDRM semantic distinctions and forbids incompatible semantic redefinition." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_062 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-062" ;
  rdfs:label "C2 Accounts For Applicable Responsibilities" ;
  sh:severity sh:Violation ;
  sh:message "C2 requires applicable GEDRA responsibilities to be demonstrably accounted for through realization, inheritance, delegation, legitimate non-applicability, or explicitly governed deviation." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_063 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-063" ;
  rdfs:label "C3 Satisfies Applicable Profile Requirements" ;
  sh:severity sh:Violation ;
  sh:message "C3 requires satisfaction of the applicable requirements of every profile included in the conformance claim in addition to C1 and C2." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_070 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-070" ;
  rdfs:label "Planes Are Not Physical Tiers" ;
  sh:severity sh:Violation ;
  sh:message "A GEDRA Architectural Plane must not be interpreted as requiring a separate system, application, deployment tier, or physical topology." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_071 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-071" ;
  rdfs:label "Views Do Not Create Semantics" ;
  sh:severity sh:Violation ;
  sh:message "An Architecture View may project existing GEDRA/GEDRM constructs but must not create or redefine semantic concepts." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_072 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-072" ;
  rdfs:label "Technology Does Not Establish Semantic Authority" ;
  sh:severity sh:Violation ;
  sh:message "Technology, storage, platform, API, IAM, messaging, or observability tooling must not by itself be treated as establishing semantic meaning, authoritative status, ownership, entitlement semantics, product status, or Data Control status." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_073 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-073" ;
  rdfs:label "Data Product Status Is Intentional" ;
  sh:severity sh:Violation ;
  sh:message "A Data Asset, API, output port, catalog entry, marketplace listing, platform capability, or widely used dataset must not automatically be treated as a Data Product; productization is intentional and obligation-bearing." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_074 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-074" ;
  rdfs:label "Authority Distinctions Must Be Preserved" ;
  sh:severity sh:Violation ;
  sh:message "System of Record, Authoritative Source, and Source of Authority must remain distinct, and authorized status must not be treated as authoritative status." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_075 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-075" ;
  rdfs:label "Processing Privacy Distinction Must Be Preserved" ;
  sh:severity sh:Violation ;
  sh:message "Data Transformer must remain distinct from privacy-law Data Processor." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_076 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-076" ;
  rdfs:label "Governance Construct Distinctions Must Be Preserved" ;
  sh:severity sh:Violation ;
  sh:message "Data Policy, Policy as Code, Data Contract, Data Quality Rule, Data Control, Control Execution, Control Evidence, metrics, dashboards, and observability signals must not be collapsed into one another." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_077 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-077" ;
  rdfs:label "Consumption Distinctions Must Be Preserved" ;
  sh:severity sh:Violation ;
  sh:message "Data Recipient must remain distinct from Data Consumer, and discovery, authentication, authorization, entitlement, access, understanding, and usage must not be treated as interchangeable." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_078 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-078" ;
  rdfs:label "Observability Does Not Equal Control Or Value" ;
  sh:severity sh:Violation ;
  sh:message "Observability capability and health assessment are distinct responsibilities; an observability signal or metric is not automatically Control Evidence or a Data Control, and usage or cost is not automatically value." ;
  sh:deactivated true .

gedra:ConstraintMeta_GEDRA_C_090 a sh:NodeShape ;
  dcterms:identifier "GEDRA-C-090" ;
  rdfs:label "AI Product Is Outside GEDRA 0.1 Core" ;
  sh:severity sh:Violation ;
  sh:message "AI Product and Intelligence-specific semantics must not be introduced as GEDRA 0.1 core constructs; they may only be externally referenced or handled by a future/profile-owned integration." ;
  sh:deactivated true .

gedra:ArchitectureProfileExactParentShape a sh:NodeShape ;
  sh:targetClass gedra:ArchitectureProfile ;
  dcterms:identifier "GEDRA-C-011" ;
  sh:property [
    sh:path gedra:profileOf ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    sh:hasValue <https://specs.kivanura.org/gedra/0.1> ;
    sh:message "GEDRA-C-011: a GEDRA 0.1 ArchitectureProfile must bind exactly to GEDRA 0.1." ;
    sh:severity sh:Violation
  ] .

gedra:ConformanceLevelHierarchyIntegrityShape a sh:NodeShape ;
  sh:targetNode gedra:ArchitecturalAlignment ;
  sh:targetNode gedra:ProfiledConformance ;
  dcterms:identifier "GEDRA-C-012" ;
  sh:sparql [
    a sh:SPARQLConstraint ;
    sh:message "GEDRA-C-012: conformance levels must preserve the cumulative C1 -> C2 -> C3 dependency hierarchy." ;
    sh:select """
      PREFIX gedra: <https://specs.kivanura.org/gedra#>
      SELECT $this WHERE {
        FILTER (
          ($this = gedra:ArchitecturalAlignment &&
           NOT EXISTS { $this gedra:requires gedra:SemanticAlignment }) ||
          ($this = gedra:ProfiledConformance &&
           (NOT EXISTS { $this gedra:requires gedra:SemanticAlignment } ||
            NOT EXISTS { $this gedra:requires gedra:ArchitecturalAlignment }))
        )
      }
    """
  ] .
