diff --git a/.github/workflows/Build-ShapeTemplates-spec.yml b/.github/workflows/Build-ShapeTopologies-spec.yml similarity index 84% rename from .github/workflows/Build-ShapeTemplates-spec.yml rename to .github/workflows/Build-ShapeTopologies-spec.yml index de31926..d78d0b7 100644 --- a/.github/workflows/Build-ShapeTemplates-spec.yml +++ b/.github/workflows/Build-ShapeTopologies-spec.yml @@ -1,4 +1,4 @@ -name: Build Shape Templates +name: Build Shape Topologies spec on: workflow_dispatch: {} pull_request: {} @@ -21,9 +21,9 @@ jobs: # if your doc isn’t in the root folder, # or Bikeshed otherwise can’t find it: - SOURCE: shape-templates.bs + SOURCE: shape-topologies.bs # output filename defaults to your input # with .html extension instead, # but if you want to customize it: - DESTINATION: shape-templates.html + DESTINATION: shape-topologies.html diff --git a/shape-templates.bs b/shape-topologies.bs similarity index 82% rename from shape-templates.bs rename to shape-topologies.bs index 6f888d7..5e29c66 100644 --- a/shape-templates.bs +++ b/shape-topologies.bs @@ -1,19 +1,19 @@
-Title: The Shape Templates algorithm
-Shortname: ShapeTemplates
+Title: The Shape Topologies algorithm
+Shortname: ShapeTopologies
 Level: 1
 Status: w3c/CG-DRAFT
 Markup Shorthands: markdown yes
 Group: TREE hypermedia community group
-URL: https://w3id.org/tree/specification/shape-templates
+URL: https://w3id.org/tree/specification/shape-topologies
 Repository: https://github.com/treecg/specification
 Mailing List: public-treecg@w3.org
 Mailing List Archives: https://lists.w3.org/Archives/Public/public-treecg/
 Editor: Pieter Colpaert, https://pietercolpaert.be
 Abstract:
     This algorithm defines what quads are part of an entity description.
-    It uses the concepts of Concise Bounded Descriptions, adds well-defined support for named graphs, and introduces the concept of a shape template.
-    A shape template is a structure of an entity description that follows similar design principles as SHACL Node Shapes.
+    It uses the concepts of Concise Bounded Descriptions, adds well-defined support for named graphs, and introduces the concept of a shape topology.
+    A shape topology is a structure of an entity description that follows similar design principles as SHACL Node Shapes.
     The algorithm returns the quads that match, and also provides hooks for the client to fetch more quads elsewhere (i.e. by dereferencing the subject).
 
@@ -21,22 +21,22 @@ Abstract: Input: * The subject IRI `M`. This is the first focus node. - * An optional [shape template](#shape-template-extraction) and a Term for the shape to start from `S` + * An optional [shape topology](#shape-topology-extraction) and a Term for the shape to start from `S` * A list of other subject IRIs to ignore, because we do not want to include quads from other entity descriptions. Process: - 1. When a shape template was set, execute the shape template extraction algorithm, yet exclude all quads that have another member (from the current context) set as their named graph - 2. If no shape template was set, extract all quads with subject the focus node, and recursively include its blank nodes (see also [[!CBD]]) + 1. When a shape topology was set, execute the shape topology extraction algorithm, yet exclude all quads that have another member (from the current context) set as their named graph + 2. If no shape topology was set, extract all quads with subject the focus node, and recursively include its blank nodes (see also [[!CBD]]) 3. Extract all quads with the graph name matching the focus node 4. When no quads were extracted from steps 1-3, a client MUST fetch more information about the focus node (i.e. by dereferencing it) and re-execute 1-3. -## Shape Template extraction ## {#shape-template-extraction} +## Shape Topology extraction ## {#shape-topology-extraction} -The Shape Template is a structure that looks as follows: +The Shape Topology is a structure that looks as follows:
```typescript - class ShapeTemplate { + class ShapeTopology { closed: boolean; requiredPaths: Path[]; optionalPaths: Path[]; @@ -44,19 +44,19 @@ The Shape Template is a structure that looks as follows: atLeastOneLists: [ Shape[] ]; } class NodeLink { - shape: ShapeTemplate; + shape: ShapeTopology; path: Path; } ```
-Paths in the shape templates are [SHACL Property Paths](https://www.w3.org/TR/shacl/#property-paths). +Paths in the shape topologies are [SHACL Property Paths](https://www.w3.org/TR/shacl/#property-paths). -A Shape Template has +A Shape Topology has * Closed: A boolean telling whether it’s closed or not. If it’s open, a client MUST extract all quads, after a potential HTTP request to the focus node, with subject the focus node, and recursively include its blank nodes * Required paths: MUST trigger an HTTP request if the member does not have this path. All quads from paths, after a potential HTTP request, matching this required path MUST be added to the Member set. * Optional paths: All quads from paths, after a potential HTTP request, matching this path MUST be added to the Member set. - * Node Links: A nodelink contains a reference to another Shape Template, as well as a path. All quads, after a potential HTTP request, matching this path MUST be added to the Member set. The targets MUST be processed again using the shape template extraction algorithm on that + * Node Links: A nodelink contains a reference to another Shape Topology, as well as a path. All quads, after a potential HTTP request, matching this path MUST be added to the Member set. The targets MUST be processed again using the shape topology extraction algorithm on that * atLeastOneLists: Each atLeastOneList is an array of at least one shape with one or more required paths and atLeastOneLists that must be set. If none of the shapes match, it will trigger an HTTP request. Only the quads from paths matching valid shapes are included in the Member. Note: Certain quads are going to be matched by the algorithm multiple times. Each quad will of course be part of the member only once. @@ -69,16 +69,16 @@ This results in this algorithm: 3. Visit all paths (required, optional, nodelinks and recursively the shapes in the atLeastOneLists if the shape is valid) paths and add all quads necessary to reach the targets to the result 4. For the results of nodelinks, if the target is a named node, set it as a focus node and repeat this algorithm with that nodelink’s shape as a shape -### Generating a shape template from SHACL ### {#shacl-to-shape-template} +### Generating a shape topology from SHACL ### {#shacl-to-shape-template} On a tree:Collection, a SHACL shape MAY be provided with the tree:shape property. -In that case, the SHACL shape MUST be processed towards a Shape Template as follows: +In that case, the SHACL shape MUST be processed towards a Shape topology as follows: 1. Checks if the shape is deactivated (:S sh:deactivated true), if it is, don’t continue 2. Check if the shape is closed (:S sh:closed true), set the closed boolean to true. 3. All sh:property elements with an sh:node link are added to the shape’s NodeLinks array 4. Add all properties with sh:minCount > 0 to the Required Paths array, and all others to the optional paths. 5. Processes the [conditionals](https://www.w3.org/TR/shacl/#core-components-logical) sh:xone, sh:or and sh:and (but doesn’t process sh:not): - - sh:and: all properties on that shape template MUST be merged with the current shape template + - sh:and: all properties on that shape topology MUST be merged with the current shape topology - sh:xone and sh:or: in both cases, at least one item must match at least one quad for all required paths. If not, it will do an HTTP request to the current namednode.