@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix lfal: <https://www.mpeters.dev/ns/lfal#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix elm: <http://data.europa.eu/snb/model/elm/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# SHACL companion to shapes/requirements.shex — see SOLID_DATA_MODEL.md §4
# (requirements/global.ttl and requirements/<domainId>/(general|<subdomainId>).ttl).
# Main subject is always <#it>; a single-level undo snapshot (if any) lives at <#prev>.

lfal:RequirementsProfileShape
  a sh:NodeShape ;
  sh:targetClass lfal:RequirementsProfile ;
  sh:name "Requirements profile" ;
  sh:description "The set of requirements expected for a domain/subdomain (or globally), plus at most one previous-version undo snapshot." ;
  sh:property
    [ sh:path dcterms:modified ; sh:datatype xsd:dateTime ; sh:minCount 1 ; sh:maxCount 1 ] ,
    [ sh:path elm:educationSubject ; sh:nodeKind sh:IRI ; sh:maxCount 1 ] ,
    [ sh:path lfal:hasFinding ; sh:node lfal:RequirementItemShape ] ,
    [ sh:path lfal:previousVersion ; sh:node lfal:RequirementsProfileShape ; sh:maxCount 1 ] .

lfal:RequirementItemShape
  a sh:NodeShape ;
  sh:targetClass elm:LearningOutcome ;
  sh:name "Requirement item" ;
  sh:description "A single required skill or outcome within a requirements profile, ordered by lfal:order." ;
  sh:property
    [ sh:path dcterms:identifier ; sh:datatype xsd:string ; sh:minCount 1 ; sh:maxCount 1 ] ,
    [ sh:path dcterms:type ; sh:nodeKind sh:IRI ; sh:minCount 1 ; sh:maxCount 1 ] ,
    [ sh:path dcterms:title ; sh:datatype xsd:string ; sh:minCount 1 ; sh:maxCount 1 ] ,
    [ sh:path lfal:order ; sh:datatype xsd:integer ; sh:minCount 1 ; sh:maxCount 1 ] ,
    [ sh:path lfal:verb ; sh:datatype xsd:string ; sh:maxCount 1 ] ,
    [ sh:path lfal:skill ; sh:datatype xsd:string ; sh:maxCount 1 ] .
