@prefix : <https://raw.githubusercontent.com/treecg/ldes-client/main/shapes/treeNode.ttl#>.
@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 xsd: <http://www.w3.org/2001/XMLSchema#>.

<> rdfs:label "A shapes graph to extract tree:Node data"@en.
:NodeShape a sh:NodeShape;
  rdfs:label "A shape describing a tree:Node"@en;
  rdfs:comment "A shape that can be used to CBD extract tree Node data."@en;
  sh:property [
    sh:path [ sh:alternativePath (
      [ sh:inversePath tree:view ]
      [ sh:inversePath dcterms:isPartOf ]
      void:subset
    ) ];
    sh:node :CollectionShape;
    sh:minCount 1;
    sh:maxCount 1;
  ], [
    sh:path tree:relation;
    sh:node :RelationShape;
  ].

:CollectionShape a sh:NodeShape;
  rdfs:label "A shape describing a tree:Collection or an ldes:EventStream"@en;
  sh:property [ sh:path tree:search ].

:RelationShape a sh:NodeShape;
  sh:property [
    sh:path tree:node;
    sh:minCount 1;
    sh:maxCount 1;
  ];
  sh:xone ( [
    sh:path tree:value;
    sh:minCount 1;
    sh:maxCount 1;
  ] [
    sh:path tree:qualifiedValue;
    sh:minCount 1;
    sh:maxCount 1;
    sh:node :QualifiedValueShape;
  ] ).

