@prefix map: <https://ontology.inferal.com/mappings/p-plan-data-usage-processing-lineage/> .
@prefix p-plan: <http://purl.org/net/p-plan#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .

map:ProjectionConfigurationShape
    a sh:NodeShape ;
    rdfs:label "P-Plan projection configuration shape" ;
    rdfs:comment "Requires one selected step, processing category, and provenance activity before the executable mapping can run." ;
    sh:targetClass map:ProjectionConfiguration ;
    sh:nodeKind sh:IRI ;
    sh:property [
        sh:path map:mapsStep ;
        sh:class p-plan:Step ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
    ] ;
    sh:property [
        sh:path map:processingCategory ;
        sh:nodeKind sh:IRI ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
    ] ;
    sh:property [
        sh:path map:projectionActivity ;
        sh:class prov:Activity ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
    ] .

map:DataVariableShape
    a sh:NodeShape ;
    rdfs:label "data-bearing variable shape" ;
    rdfs:comment "Requires every variable marked as data-bearing to remain a P-Plan variable." ;
    sh:targetClass map:DataVariable ;
    sh:class p-plan:Variable ;
    sh:nodeKind sh:IRI .

map:AuxiliaryVariableShape
    a sh:NodeShape ;
    rdfs:label "auxiliary variable shape" ;
    rdfs:comment "Requires every variable marked as auxiliary to remain a P-Plan variable." ;
    sh:targetClass map:AuxiliaryVariable ;
    sh:class p-plan:Variable ;
    sh:nodeKind sh:IRI .

map:FixedDataEntityShape
    a sh:NodeShape ;
    rdfs:label "fixed data entity shape" ;
    rdfs:comment "Requires every entity eligible for DataSnapshot projection to be a P-Plan execution entity with exactly one corresponding variable." ;
    sh:targetClass map:FixedDataEntity ;
    sh:class p-plan:Entity ;
    sh:nodeKind sh:IRI ;
    sh:property [
        sh:path p-plan:correspondsToVariable ;
        sh:class map:DataVariable ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
    ] .
