From 5498be5217323a5f5de15f8731fd88b6723d1115 Mon Sep 17 00:00:00 2001 From: Vladimir Alexiev Date: Tue, 5 Aug 2025 10:22:02 +0300 Subject: [PATCH 1/7] minor editorial change --- shacl12-vocabularies/shacl-shacl.ttl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shacl12-vocabularies/shacl-shacl.ttl b/shacl12-vocabularies/shacl-shacl.ttl index 31f7e7a50..fc0536f37 100644 --- a/shacl12-vocabularies/shacl-shacl.ttl +++ b/shacl12-vocabularies/shacl-shacl.ttl @@ -23,11 +23,11 @@ shsh: shsh:ListShape a sh:NodeShape ; rdfs:label "List shape"@en ; - rdfs:comment "A shape describing well-formed RDF lists. Currently does not check for non-recursion. This could be expressed using SHACL-SPARQL."@en ; + rdfs:comment "A shape describing well-formed RDF lists. Currently does not check for non-recursion (this could be expressed using SHACL-SPARQL)."@en ; rdfs:seeAlso ; sh:property [ sh:path [ sh:zeroOrMorePath rdf:rest ] ; - rdfs:comment "Each list member (including this node) must be have the shape shsh:ListNodeShape."@en ; + rdfs:comment "Each list member (including this node) must have the shape shsh:ListNodeShape."@en ; sh:hasValue rdf:nil ; sh:node shsh:ListNodeShape ; ] . From 822536e70a859382eb6c31cd661f980509da824d Mon Sep 17 00:00:00 2001 From: Vladimir Alexiev Date: Thu, 7 Aug 2025 16:53:58 +0300 Subject: [PATCH 2/7] two variants of EBNF diagrams: rr and puml --- shacl12-core/images/Makefile | 4 + shacl12-core/images/SHACL-UML.puml | 53 ++++++++++++ shacl12-core/images/SHACL-UML.svg | 1 + shacl12-core/images/path-EBNF-rr.svg | 123 +++++++++++++++++++++++++++ shacl12-core/images/path-EBNF-rr.txt | 6 ++ shacl12-core/images/path-EBNF.puml | 3 + shacl12-core/images/path-EBNF.svg | 1 + 7 files changed, 191 insertions(+) create mode 100644 shacl12-core/images/Makefile create mode 100644 shacl12-core/images/SHACL-UML.puml create mode 100644 shacl12-core/images/SHACL-UML.svg create mode 100644 shacl12-core/images/path-EBNF-rr.svg create mode 100644 shacl12-core/images/path-EBNF-rr.txt create mode 100644 shacl12-core/images/path-EBNF.puml create mode 100644 shacl12-core/images/path-EBNF.svg diff --git a/shacl12-core/images/Makefile b/shacl12-core/images/Makefile new file mode 100644 index 000000000..32a5e100d --- /dev/null +++ b/shacl12-core/images/Makefile @@ -0,0 +1,4 @@ +all: SHACL-UML.svg path-EBNF.svg + +%.svg: %.puml + plantuml -Tsvg $^ diff --git a/shacl12-core/images/SHACL-UML.puml b/shacl12-core/images/SHACL-UML.puml new file mode 100644 index 000000000..feea87eab --- /dev/null +++ b/shacl12-core/images/SHACL-UML.puml @@ -0,0 +1,53 @@ +@startuml +hide circles +hide empty members +skinparam pathHoverColor red ' on cover, highlight blue links as red +' skinparam topurl https://raw.githack.com/w3c/data-shapes/master/shacl12-core/index.html ' links resolve to anchors in current HTML page, when the SVG is embedded + +class "sh:Shape" as Shape [[#shapes]] { + [[#targetClass sh:targetClass]] : rdfs:Class + [[#targetNode sh:targetNode]] : any + [[#targetSubjectsOf sh:targetSubjectsOf]] : rdf:Property + [[#targetObjectsOf sh:targetObjectsOf]] : rdf:Property + .... + [[#deactivated sh:deactivated]] : xsd:boolean + [[#message sh:message]] : xsd:string or rdf:langString + [[#severity sh:severity]] : sh:Severity +} + +class "sh:NodeShape" as NodeShape [[#node-shapes]] { + [[#constraints Constraint parameters]], for example: + [[#NodeKindConstraintComponent sh:nodeKind]] a sh:NodeKind + [[#ClosedConstraintComponent sh:closed]] : xsd:boolean or [[#syntax-rule-closed-datatype sh:ByTypes]] + [[#ClosedConstraintComponent sh:ignoredProperties]] : list + [[#OrConstraintComponent sh:or]], [[#AndConstraintComponent sh:and]], [[#XoneConstraintComponent sh:xone]] : list of Shape + [[#NotConstraintComponent sh:not]] : [[#shapes sh:Shape]] + ... +} + +class "sh:PropertyShape" as PropertyShape [[#property-shapes]] { + [[#constraints Constraint parameters]], for example: + [[#MinCountConstraintComponent sh:minCount]], [[#MaxCountConstraintComponent sh:maxCount]] : xsd:integer + [[#MinLengthConstraintComponent sh:minLength]], [[#MaxLengthConstraintComponent sh:maxLength]] : xsd:integer + [[#ClassConstraintComponent sh:class]] or [[#DatatypeConstraintComponent sh:datatype]] : IRI or list of IRIs + [[#NodeConstraintComponent sh:node]] : [[#node-shapes sh:NodeShape]] + ... + .... + [[#name sh:name]] : xsd:string or rdf:langString + [[#description sh:description]] : xsd:string or rdf:langString + [[#syntax-rule-path-defaultValue sh:defaultValue]] : any + [[#syntax-rule-path-defaultValue sh:values]] : any + [[#order sh:order]] : xsd:integer or xsd:decimal + [[#property-paths sh:path]] : predicate or list or blank node +} + +class "sh:PropertyGroup" as PropertyGroup [[#group sh:group]] { + [[#group sh:order]] : xsd:integer or xsd:decimal + ... eg rdfs:label +} + +Shape <|-- NodeShape +Shape <|-- PropertyShape +NodeShape -> PropertyShape : [[#property-shapes sh:property]] * +PropertyShape --> PropertyGroup : [[#group sh:group]] +@enduml diff --git a/shacl12-core/images/SHACL-UML.svg b/shacl12-core/images/SHACL-UML.svg new file mode 100644 index 000000000..2a34e1d68 --- /dev/null +++ b/shacl12-core/images/SHACL-UML.svg @@ -0,0 +1 @@ +sh:Shapesh:targetClass: rdfs:Classsh:targetNode: anysh:targetSubjectsOf: rdf:Propertysh:targetObjectsOf: rdf:Propertysh:deactivated: xsd:booleansh:message: xsd:string or rdf:langStringsh:severity: sh:Severitysh:NodeShapeConstraint parameters, for example:sh:nodeKinda sh:NodeKindsh:closed: xsd:boolean orsh:ByTypessh:ignoredProperties: listsh:or,sh:and,sh:xone: list of Shapesh:not:sh:Shape...sh:PropertyShapeConstraint parameters, for example:sh:minCount,sh:maxCount: xsd:integersh:minLength,sh:maxLength: xsd:integersh:classorsh:datatype: IRI or list of IRIssh:node:sh:NodeShape...sh:name: xsd:string or rdf:langStringsh:description: xsd:string or rdf:langStringsh:defaultValue: anysh:values: anysh:order: xsd:integer or xsd:decimalsh:path: predicate or list or blank nodesh:PropertyGroupsh:order: xsd:integer or xsd:decimal... eg rdfs:labelsh:property*sh:group \ No newline at end of file diff --git a/shacl12-core/images/path-EBNF-rr.svg b/shacl12-core/images/path-EBNF-rr.svg new file mode 100644 index 000000000..2ed87ccaa --- /dev/null +++ b/shacl12-core/images/path-EBNF-rr.svg @@ -0,0 +1,123 @@ + + + + + + + + + + ( + + + + path + + + + ) + + + + predicate + + + + [ + + + sh:inversePath + + + sh:alternativePath + + + sh:zeroOrMorePath + + + sh:oneOrMorePath + + + + path + + + + ] + + + + diff --git a/shacl12-core/images/path-EBNF-rr.txt b/shacl12-core/images/path-EBNF-rr.txt new file mode 100644 index 000000000..9895bd0ca --- /dev/null +++ b/shacl12-core/images/path-EBNF-rr.txt @@ -0,0 +1,6 @@ +/* https://www.bottlecaps.de/rr/ui : check SVG, uncheck Embedded */ + +path ::= predicate | + '(' path* ')' | + '[' ('sh:inversePath'|'sh:alternativePath'|'sh:zeroOrMorePath'|'sh:oneOrMorePath') path ']' + diff --git a/shacl12-core/images/path-EBNF.puml b/shacl12-core/images/path-EBNF.puml new file mode 100644 index 000000000..b594cd5ef --- /dev/null +++ b/shacl12-core/images/path-EBNF.puml @@ -0,0 +1,3 @@ +@startEbnf +path = predicate | "(", {path}-, ")" | "[", ("sh:inversePath"|"sh:alternativePath"|"sh:zeroOrMorePath"|"sh:oneOrMorePath"), path, "]" ; +@endEbnf \ No newline at end of file diff --git a/shacl12-core/images/path-EBNF.svg b/shacl12-core/images/path-EBNF.svg new file mode 100644 index 000000000..dfe0ba7de --- /dev/null +++ b/shacl12-core/images/path-EBNF.svg @@ -0,0 +1 @@ +pathpredicate(path)[sh:inversePathsh:alternativePathsh:zeroOrMorePathsh:oneOrMorePathpath] \ No newline at end of file From f3bc76a1706deabe2fa7bfe3d398061a994e4d49 Mon Sep 17 00:00:00 2001 From: Vladimir Alexiev Date: Fri, 17 Oct 2025 15:07:18 +0300 Subject: [PATCH 3/7] add sh:zeroOrOnePath --- shacl12-core/images/path-EBNF-rr.svg | 22 +++++++++++++++------- shacl12-core/images/path-EBNF.puml | 4 ++-- shacl12-core/images/path-EBNF.svg | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/shacl12-core/images/path-EBNF-rr.svg b/shacl12-core/images/path-EBNF-rr.svg index 2ed87ccaa..000e1670e 100644 --- a/shacl12-core/images/path-EBNF-rr.svg +++ b/shacl12-core/images/path-EBNF-rr.svg @@ -1,5 +1,5 @@ - + diff --git a/shacl12-core/images/path-EBNF.puml b/shacl12-core/images/path-EBNF.puml index b594cd5ef..e2ffba8ca 100644 --- a/shacl12-core/images/path-EBNF.puml +++ b/shacl12-core/images/path-EBNF.puml @@ -1,3 +1,3 @@ @startEbnf -path = predicate | "(", {path}-, ")" | "[", ("sh:inversePath"|"sh:alternativePath"|"sh:zeroOrMorePath"|"sh:oneOrMorePath"), path, "]" ; -@endEbnf \ No newline at end of file +path = predicate | "(", {path}-, ")" | "[", ("sh:inversePath"|"sh:alternativePath"|"sh:zeroOrOnePath"|"sh:zeroOrMorePath"|"sh:oneOrMorePath"), path, "]" ; +@endEbnf diff --git a/shacl12-core/images/path-EBNF.svg b/shacl12-core/images/path-EBNF.svg index dfe0ba7de..36b0634c1 100644 --- a/shacl12-core/images/path-EBNF.svg +++ b/shacl12-core/images/path-EBNF.svg @@ -1 +1 @@ -pathpredicate(path)[sh:inversePathsh:alternativePathsh:zeroOrMorePathsh:oneOrMorePathpath] \ No newline at end of file +pathpredicate(path)[sh:inversePathsh:alternativePathsh:zeroOrOnePathsh:zeroOrMorePathsh:oneOrMorePathpath] \ No newline at end of file From 9ff571d45fe7029913dee6eeb19722c1b6c0c2b2 Mon Sep 17 00:00:00 2001 From: Vladimir Alexiev Date: Fri, 17 Oct 2025 15:11:30 +0300 Subject: [PATCH 4/7] add sh:zeroOrOnePath --- shacl12-core/images/path-EBNF-rr.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shacl12-core/images/path-EBNF-rr.txt b/shacl12-core/images/path-EBNF-rr.txt index 9895bd0ca..08c3a6ef6 100644 --- a/shacl12-core/images/path-EBNF-rr.txt +++ b/shacl12-core/images/path-EBNF-rr.txt @@ -2,5 +2,5 @@ path ::= predicate | '(' path* ')' | - '[' ('sh:inversePath'|'sh:alternativePath'|'sh:zeroOrMorePath'|'sh:oneOrMorePath') path ']' + '[' ('sh:inversePath'|'sh:alternativePath'|'sh:zeroOrOnePath'|'sh:zeroOrMorePath'|'sh:oneOrMorePath') path ']' From c0a3902332b332455f26b87891090797ca391c07 Mon Sep 17 00:00:00 2001 From: Vladimir Alexiev Date: Fri, 17 Oct 2025 15:34:37 +0300 Subject: [PATCH 5/7] add the diagram in sec 3 --- shacl12-core/index.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shacl12-core/index.html b/shacl12-core/index.html index f2e51773b..9434abb18 100644 --- a/shacl12-core/index.html +++ b/shacl12-core/index.html @@ -2379,7 +2379,12 @@

SHACL Property Paths

SHACL includes RDF terms to represent the following subset of SPARQL property paths: PredicatePath, InversePath, SequencePath, AlternativePath, ZeroOrMorePath, OneOrMorePath and ZeroOrOnePath. + This syntax diagram shows how they can be used together + (PredicatePath is the basic case consisting of a single predicate, + SequencePath uses a parenthesized list of paths, + and the rest use a blank node and a specific sh: term):

+

The following sub-sections provide syntax rules of well-formed SHACL property paths together with mapping rules to SPARQL 1.2 property paths. From 07f6426ba89836ffe148790d2d5e9a83ebfc6efd Mon Sep 17 00:00:00 2001 From: Vladimir Alexiev Date: Fri, 17 Oct 2025 15:41:25 +0300 Subject: [PATCH 6/7] add "alt" for accessibility --- shacl12-core/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shacl12-core/index.html b/shacl12-core/index.html index 9434abb18..e401ab97e 100644 --- a/shacl12-core/index.html +++ b/shacl12-core/index.html @@ -2384,7 +2384,7 @@

SHACL Property Paths

SequencePath uses a parenthesized list of paths, and the rest use a blank node and a specific sh: term):

- + Railroad grammar diagram of RDF terms to represent property paths

The following sub-sections provide syntax rules of well-formed SHACL property paths together with mapping rules to SPARQL 1.2 property paths. From 4410d72178ac78434cc1da9e6e66bd8ad34a3548 Mon Sep 17 00:00:00 2001 From: Vladimir Alexiev Date: Fri, 17 Oct 2025 16:08:32 +0300 Subject: [PATCH 7/7] add sh:codeIdentifier --- shacl12-core/images/SHACL-UML.puml | 1 + shacl12-core/images/SHACL-UML.svg | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/shacl12-core/images/SHACL-UML.puml b/shacl12-core/images/SHACL-UML.puml index feea87eab..dc55a4495 100644 --- a/shacl12-core/images/SHACL-UML.puml +++ b/shacl12-core/images/SHACL-UML.puml @@ -37,6 +37,7 @@ class "sh:PropertyShape" as PropertyShape [[#property-shapes]] { [[#description sh:description]] : xsd:string or rdf:langString [[#syntax-rule-path-defaultValue sh:defaultValue]] : any [[#syntax-rule-path-defaultValue sh:values]] : any + [[#codeIdentifier sh:codeIdentifier]] : xsd:string [[#order sh:order]] : xsd:integer or xsd:decimal [[#property-paths sh:path]] : predicate or list or blank node } diff --git a/shacl12-core/images/SHACL-UML.svg b/shacl12-core/images/SHACL-UML.svg index 2a34e1d68..05f87de4e 100644 --- a/shacl12-core/images/SHACL-UML.svg +++ b/shacl12-core/images/SHACL-UML.svg @@ -1 +1 @@ -sh:Shapesh:targetClass: rdfs:Classsh:targetNode: anysh:targetSubjectsOf: rdf:Propertysh:targetObjectsOf: rdf:Propertysh:deactivated: xsd:booleansh:message: xsd:string or rdf:langStringsh:severity: sh:Severitysh:NodeShapeConstraint parameters, for example:sh:nodeKinda sh:NodeKindsh:closed: xsd:boolean orsh:ByTypessh:ignoredProperties: listsh:or,sh:and,sh:xone: list of Shapesh:not:sh:Shape...sh:PropertyShapeConstraint parameters, for example:sh:minCount,sh:maxCount: xsd:integersh:minLength,sh:maxLength: xsd:integersh:classorsh:datatype: IRI or list of IRIssh:node:sh:NodeShape...sh:name: xsd:string or rdf:langStringsh:description: xsd:string or rdf:langStringsh:defaultValue: anysh:values: anysh:order: xsd:integer or xsd:decimalsh:path: predicate or list or blank nodesh:PropertyGroupsh:order: xsd:integer or xsd:decimal... eg rdfs:labelsh:property*sh:group \ No newline at end of file +sh:Shapesh:targetClass: rdfs:Classsh:targetNode: anysh:targetSubjectsOf: rdf:Propertysh:targetObjectsOf: rdf:Propertysh:deactivated: xsd:booleansh:message: xsd:string or rdf:langStringsh:severity: sh:Severitysh:NodeShapeConstraint parameters, for example:sh:nodeKinda sh:NodeKindsh:closed: xsd:boolean orsh:ByTypessh:ignoredProperties: listsh:or,sh:and,sh:xone: list of Shapesh:not:sh:Shape...sh:PropertyShapeConstraint parameters, for example:sh:minCount,sh:maxCount: xsd:integersh:minLength,sh:maxLength: xsd:integersh:classorsh:datatype: IRI or list of IRIssh:node:sh:NodeShape...sh:name: xsd:string or rdf:langStringsh:description: xsd:string or rdf:langStringsh:defaultValue: anysh:values: anysh:codeIdentifier: xsd:stringsh:order: xsd:integer or xsd:decimalsh:path: predicate or list or blank nodesh:PropertyGroupsh:order: xsd:integer or xsd:decimal... eg rdfs:labelsh:property*sh:group \ No newline at end of file