# SHACL (Turtle) shape for component-interop manifests — the same shape as
# manifest.shaclc (the canonical SHACL-C serialization); keep the two in
# lockstep. This file is what rdf-validate-shacl and other tooling consume.

@base   <https://jeff-zucker.github.io/component-interop/shapes/manifest> .
@prefix sh:     <http://www.w3.org/ns/shacl#> .
@prefix xsd:    <http://www.w3.org/2001/XMLSchema#> .
@prefix ci:     <https://jeff-zucker.github.io/component-interop/ns#> .
@prefix schema: <http://schema.org/> .
@prefix rdfs:   <http://www.w3.org/2000/01/rdf-schema#> .

<#ManifestShape> a sh:NodeShape ;
  sh:targetClass ci:Manifest ;
  sh:property [ sh:path schema:name ; sh:datatype xsd:string ; sh:minCount 1 ; sh:maxCount 1 ] ;
  sh:property [ sh:path rdfs:seeAlso ; sh:nodeKind sh:IRI ] ;
  sh:property [ sh:path ci:component ;    sh:node <#ManifestEntryShape> ] ;
  sh:property [ sh:path ci:sharedModule ; sh:node <#SharedModuleShape> ] ;
  sh:property [ sh:path ci:attribute ;    sh:node <#AttributeShape> ] ;
  sh:property [ sh:path ci:stage ;        sh:node <#StageShape> ] ;
  sh:property [ sh:path ci:provides ;     sh:node <#ProvidesShape> ] ;
  sh:property [ sh:path ci:consumes ;     sh:node <#ConsumesShape> ] ;
  sh:property [ sh:path ci:accepts ;      sh:node <#AcceptsShape> ] .

# The manifest-side HALF of an entry's shape: only the loader plumbing
# (ci:module). Everything generic about an entry — schema:url (the single
# payload: the element's module for a ui:Component, the target URL for a
# ui:Link; retired ui:name/ui:href/ui:module 2026-07-19), ui:label, ui:icon,
# schema:additionalProperty, descriptive metadata — lives in the SHARED item shapes in
# sol-components' shapes/menu.shacl (ui:Component / ui:Link, bound via
# sh:targetClass). Validators load both files into one shapes graph; an
# entry opts into the shared validation by carrying an explicit type
# ("@type": "ui:Component" or "ui:Link" — compact IRIs the published context
# already resolves). Deliberately NO sh:targetClass here, so ci:module never
# constrains components outside a manifest, and deliberately no cross-file
# IRI references.
<#ManifestEntryShape> a sh:NodeShape ;
  sh:property [ sh:path ci:module ; sh:nodeKind sh:IRI ; sh:maxCount 1 ] .

<#SharedModuleShape> a sh:NodeShape ;
  sh:property [ sh:path schema:name ; sh:datatype xsd:string ; sh:minCount 1 ; sh:maxCount 1 ] .

<#AttributeShape> a sh:NodeShape ;
  sh:property [ sh:path schema:name ; sh:datatype xsd:string ; sh:minCount 1 ; sh:maxCount 1 ] ;
  sh:property [ sh:path ci:module ; sh:datatype xsd:string ; sh:minCount 1 ] .

<#StageShape> a sh:NodeShape ;
  sh:property [ sh:path schema:name ; sh:datatype xsd:string ; sh:minCount 1 ; sh:maxCount 1 ] ;
  sh:property [ sh:path ci:component ;    sh:node <#ManifestEntryShape> ] ;
  sh:property [ sh:path ci:sharedModule ; sh:node <#SharedModuleShape> ] .

<#ProvidesShape> a sh:NodeShape ;
  sh:property [ sh:path schema:name ; sh:datatype xsd:string ; sh:minCount 1 ; sh:maxCount 1 ] ;
  sh:property [ sh:path ci:service ; sh:datatype xsd:string ; sh:maxCount 1 ] ;
  sh:property [ sh:path ci:respondTo ; sh:datatype xsd:string ] ;
  sh:property [ sh:path ci:sendValue ; sh:datatype xsd:string ; sh:maxCount 1 ] ;
  sh:property [ sh:path ci:priority ; sh:datatype xsd:integer ; sh:maxCount 1 ] .

<#ConsumesShape> a sh:NodeShape ;
  sh:property [ sh:path schema:name ; sh:datatype xsd:string ; sh:minCount 1 ; sh:maxCount 1 ] ;
  sh:property [ sh:path ci:call ; sh:datatype xsd:string ; sh:minCount 1 ; sh:maxCount 1 ] ;
  sh:property [ sh:path ci:from ; sh:datatype xsd:string ; sh:maxCount 1 ] ;
  sh:property [ sh:path ci:module ; sh:datatype xsd:string ; sh:maxCount 1 ] .

<#AcceptsShape> a sh:NodeShape ;
  sh:property [ sh:path schema:name ; sh:datatype xsd:string ; sh:minCount 1 ; sh:maxCount 1 ] ;
  sh:property [ sh:path ci:onElement ; sh:datatype xsd:string ; sh:minCount 1 ; sh:maxCount 1 ] ;
  sh:property [ sh:path ci:applyValueTo ; sh:datatype xsd:string ; sh:minCount 1 ; sh:maxCount 1 ] ;
  sh:property [ sh:path ci:transform ; sh:datatype xsd:string ; sh:maxCount 1 ] .
