@prefix wai:   <https://wai.transaction.science/vocab/v1#> .
@prefix sh:    <http://www.w3.org/ns/shacl#> .
@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .

# WAI v1 SHACL shapes — validates Manifest and the NeuralPrior
# reference. Enforces the modality + path enums and the
# codec-against-registered-menu constraint.

wai:ManifestShape a sh:NodeShape ;
    sh:targetClass wai:Manifest ;
    sh:property [ sh:path wai:modality   ; sh:nodeKind sh:IRI ; sh:minCount 1 ; sh:maxCount 1 ;
                  sh:in ( wai:Image wai:Audio wai:Video wai:Volume wai:Mesh wai:Compressed ) ] ;
    sh:property [ sh:path wai:path       ; sh:nodeKind sh:IRI ; sh:minCount 1 ; sh:maxCount 1 ;
                  sh:in ( wai:NeuralPath wai:ZerothPath ) ] ;
    sh:property [ sh:path wai:codec      ; sh:nodeKind sh:IRI ; sh:minCount 1 ; sh:maxCount 1 ;
                  sh:in ( wai:PNG wai:JPEG wai:AVIF wai:JPEGXL wai:FLAC wai:Opus wai:AV1 wai:zstd wai:XZ ) ] ;
    sh:property [ sh:path wai:contentHash ; sh:datatype xsd:string             ; sh:minCount 1 ; sh:maxCount 1 ;
                  sh:pattern "^[a-f0-9]{64}$" ] ;
    sh:property [ sh:path wai:size        ; sh:datatype xsd:nonNegativeInteger ; sh:minCount 1 ; sh:maxCount 1 ] ;
    sh:property [ sh:path wai:mediaType   ; sh:datatype xsd:string             ; sh:maxCount 1 ;
                  sh:pattern "^[a-z]+/[A-Za-z0-9+._-]+$" ] ;
    sh:property [ sh:path wai:encodedAt   ; sh:datatype xsd:dateTime           ; sh:maxCount 1 ] .

wai:NeuralPriorShape a sh:NodeShape ;
    sh:targetClass wai:NeuralPrior ;
    sh:property [ sh:path wai:sharedPriorUri  ; sh:nodeKind sh:IRI       ; sh:minCount 1 ; sh:maxCount 1 ] ;
    sh:property [ sh:path wai:sharedPriorHash ; sh:datatype xsd:string   ; sh:minCount 1 ; sh:maxCount 1 ;
                  sh:pattern "^[a-f0-9]{64}$" ] .
