@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 skos:    <http://www.w3.org/2004/02/skos/core#> .
@prefix prov:    <http://www.w3.org/ns/prov#> .
@prefix values:  <https://ns.webcivics.net/values/> .
@prefix cml:     <https://ns.webcivics.net/cml/> .
@prefix cap:     <https://ns.webcivics.net/capability/> .

# ===========================================================================
# Capability credentials — Recognition of Prior Learning (RPL) + gap analysis.
# Companion to PLAN.md §10.2h. A SIBLING domain of the values-credential
# machinery (one engine): values-credentials encode RIGHTS, capability-
# credentials encode LEARNING. Anti-deficit: recognise what IS present first.
# Reuses cml:recognitionBasis / cml:curationStatus (cml.n3).
# ===========================================================================

# --- Capability (a concept; capabilities form a SKOS hierarchy) ---
cap:Capability a rdfs:Class ; rdfs:subClassOf skos:Concept ;
    rdfs:label "Capability" ;
    rdfs:comment "A skill/competence concept. skos:broader/narrower → a capability hierarchy; a held capability satisfies a requirement if it is the same or NARROWER (more specific)." .

# --- LearningClaim (a verifiable claim that an agent holds a capability) ---
cap:LearningClaim a rdfs:Class ; rdfs:label "Learning claim" ;
    rdfs:comment "A verifiable claim (Open Badges v3 / VCDM) that an agent holds a capability." .
cap:heldBy a rdf:Property ; rdfs:domain cap:LearningClaim ; rdfs:range values:Agent .
cap:capability a rdf:Property ; rdfs:domain cap:LearningClaim ; rdfs:range cap:Capability .
cap:evidence a rdf:Property ; rdfs:domain cap:LearningClaim ; rdfs:range prov:Entity ;
    rdfs:comment "What backs the claim (a built thing, demonstration, testimonial) — PROV-O." .
# recognitionBasis (Formal | PriorLearning | Experiential | PeerAttested) + curationStatus
# (Proposed | Attested) are reused from cml.n3 — RPL claims are FIRST-CLASS.

# --- Requirements + gap analysis ---
cap:CapabilityRequirement a rdfs:Class ; rdfs:label "Capability requirement" ;
    rdfs:comment "A capability a project/deployment needs (e.g. to construct Peace Infrastructure)." .
cap:requiredCapability a rdf:Property ; rdfs:domain cap:CapabilityRequirement ; rdfs:range cap:Capability .
cap:requiredBy a rdf:Property ; rdfs:domain cap:CapabilityRequirement ;
    rdfs:comment "The project/deployment that needs it." .
cap:dependsOn a rdf:Property ; rdfs:domain cap:Capability ; rdfs:range cap:Capability ;
    rdfs:comment "Capability dependency graph (to build X you need A+B+C) — TimBL's 'if removed, what's blocked?' → the dependency/dialectical modality." .

# Gap analysis = a QUERY (the make-the-absence-legible pattern §10.2a applied to skills):
#   Gap = { required capability C : no attested LearningClaim holds C or a narrower capability }
#   Output: present capabilities · genuine gaps · CLARIFICATIONS (ambiguous closeMatch → assess, never auto-deny).
cap:Gap a rdfs:Class ; rdfs:comment "A required capability with no resourced/attested bearer present (a named, queryable deficiency — not a deficit framing of the people)." .

# ===========================================================================
# SHACL — a usable LearningClaim must declare its basis + evidence
# ===========================================================================
cap:LearningClaimShape a sh:NodeShape ;
    sh:targetClass cap:LearningClaim ;
    sh:property [ sh:path cml:recognitionBasis ; sh:minCount 1 ;
        sh:message "A learning claim must state HOW it was recognised (Formal/PriorLearning/Experiential/PeerAttested) — RPL is first-class, not second-class." ] ;
    sh:property [ sh:path cap:capability ; sh:minCount 1 ] ;
    sh:property [ sh:path cap:heldBy ; sh:minCount 1 ] .
