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..dc55a4495 --- /dev/null +++ b/shacl12-core/images/SHACL-UML.puml @@ -0,0 +1,54 @@ +@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 + [[#codeIdentifier sh:codeIdentifier]] : xsd:string + [[#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..05f87de4e --- /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: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 diff --git a/shacl12-core/images/path-EBNF-rr.svg b/shacl12-core/images/path-EBNF-rr.svg new file mode 100644 index 000000000..000e1670e --- /dev/null +++ b/shacl12-core/images/path-EBNF-rr.svg @@ -0,0 +1,131 @@ + + + + + + + + + + ( + + + + path + + + + ) + + + + predicate + + + + [ + + + sh:inversePath + + + sh:alternativePath + + + sh:zeroOrOnePath + + + 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..08c3a6ef6 --- /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:zeroOrOnePath'|'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..e2ffba8ca --- /dev/null +++ b/shacl12-core/images/path-EBNF.puml @@ -0,0 +1,3 @@ +@startEbnf +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 new file mode 100644 index 000000000..36b0634c1 --- /dev/null +++ b/shacl12-core/images/path-EBNF.svg @@ -0,0 +1 @@ +pathpredicate(path)[sh:inversePathsh:alternativePathsh:zeroOrOnePathsh:zeroOrMorePathsh:oneOrMorePathpath] \ No newline at end of file diff --git a/shacl12-core/index.html b/shacl12-core/index.html index f2e51773b..e401ab97e 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):

+ 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. 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 ; ] .