From ec1d5cd7c3c37564b3b516b83894896e2d87cd62 Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Wed, 11 Jun 2025 12:28:37 +0100 Subject: [PATCH 01/53] feat: add memberShape to vocab, shacl-shacl and tests --- .../tests/core/property/manifest.ttl | 2 + .../tests/core/property/memberShape-001.ttl | 97 +++++++++++++++++ .../tests/core/property/memberShape-002.ttl | 101 ++++++++++++++++++ shacl12-vocabularies/shacl-shacl.ttl | 12 ++- shacl12-vocabularies/shacl.ttl | 20 ++++ 5 files changed, 231 insertions(+), 1 deletion(-) create mode 100644 shacl12-test-suite/tests/core/property/memberShape-001.ttl create mode 100644 shacl12-test-suite/tests/core/property/memberShape-002.ttl diff --git a/shacl12-test-suite/tests/core/property/manifest.ttl b/shacl12-test-suite/tests/core/property/manifest.ttl index 2ab26040..98a1e94e 100644 --- a/shacl12-test-suite/tests/core/property/manifest.ttl +++ b/shacl12-test-suite/tests/core/property/manifest.ttl @@ -26,6 +26,8 @@ mf:include ; mf:include ; mf:include ; + mf:include ; + mf:include ; mf:include ; mf:include ; mf:include ; diff --git a/shacl12-test-suite/tests/core/property/memberShape-001.ttl b/shacl12-test-suite/tests/core/property/memberShape-001.ttl new file mode 100644 index 00000000..7665097a --- /dev/null +++ b/shacl12-test-suite/tests/core/property/memberShape-001.ttl @@ -0,0 +1,97 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:Agenda + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Agenda" ; + sh:property ex:Agenda-speakerOrder ; +. + +ex:Agenda-speakerOrder + sh:path ex:speakerOrder ; + sh:memberShape [ + a sh:NodeShape ; + sh:nodeKind sh:IRI ; + ] ; + sh:maxCount 1 ; +. + +ex:Alice + rdf:type ex:Person ; + rdfs:label "Alice" ; +. + +ex:Bob + rdf:type ex:Person ; + rdfs:label "Bob" ; +. + +ex:Charlie + rdf:type ex:Person ; + rdfs:label "Charlie" ; +. + +ex:Person + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Person" ; +. + +# Valid agenda with all IRIs in the list +ex:agenda-1 + rdf:type ex:Agenda ; + ex:speakerOrder ( + ex:Alice + ex:Bob + ex:Charlie + ) ; + rdfs:label "Agenda 1" ; +. + +# Invalid agenda with a blank node in the list +ex:agenda-2 + rdf:type ex:Agenda ; + ex:speakerOrder ( + ex:Alice + ex:Bob + [ rdfs:label "Charlie" ] + ) ; + rdfs:label "Agenda 2" ; +. + +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + + rdf:type sht:Validate ; + rdfs:label "Test of sh:memberShape at property shape 001" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:agenda-2 ; + sh:resultPath ex:speakerOrder ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; + sh:sourceShape ex:Agenda-speakerOrder ; + ] ; + ] ; + mf:status sht:approved ; +. \ No newline at end of file diff --git a/shacl12-test-suite/tests/core/property/memberShape-002.ttl b/shacl12-test-suite/tests/core/property/memberShape-002.ttl new file mode 100644 index 00000000..dfca77f3 --- /dev/null +++ b/shacl12-test-suite/tests/core/property/memberShape-002.ttl @@ -0,0 +1,101 @@ +@prefix dash: . +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:Team + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Team" ; + sh:property ex:Team-members ; +. + +ex:Team-members + sh:path ex:members ; + sh:memberShape [ + sh:class ex:Person ; + ] ; + sh:maxCount 1 ; +. + +ex:Alice + rdf:type ex:Person ; + rdfs:label "Alice" ; +. + +ex:Bob + rdf:type ex:Person ; + rdfs:label "Bob" ; +. + +ex:Charlie + rdf:type ex:Animal ; + rdfs:label "Charlie" ; +. + +ex:Person + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Person" ; +. + +ex:Animal + rdf:type rdfs:Class ; + rdf:type sh:NodeShape ; + rdfs:label "Animal" ; +. + +# Valid team with all Person instances in the list +ex:team-1 + rdf:type ex:Team ; + ex:members ( + ex:Alice + ex:Bob + ) ; + rdfs:label "Team 1" ; +. + +# Invalid team with an Animal instance in the list +ex:team-2 + rdf:type ex:Team ; + ex:members ( + ex:Alice + ex:Bob + ex:Charlie + ) ; + rdfs:label "Team 2" ; +. + +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + + rdf:type sht:Validate ; + rdfs:label "Test of sh:memberShape with class constraint 002" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:focusNode ex:team-2 ; + sh:resultPath ex:members ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; + sh:sourceShape ex:Team-members ; + ] ; + ] ; + mf:status sht:approved ; +. \ No newline at end of file diff --git a/shacl12-vocabularies/shacl-shacl.ttl b/shacl12-vocabularies/shacl-shacl.ttl index 043cccbb..457276b3 100644 --- a/shacl12-vocabularies/shacl-shacl.ttl +++ b/shacl12-vocabularies/shacl-shacl.ttl @@ -72,10 +72,11 @@ shsh:ShapeShape sh:targetSubjectsOf sh:targetClass, sh:targetNode, sh:targetObjectsOf, sh:targetSubjectsOf ; sh:targetSubjectsOf sh:and, sh:class, sh:closed, sh:datatype, sh:disjoint, sh:equals, sh:flags, sh:hasValue, sh:ignoredProperties, sh:in, sh:languageIn, sh:lessThan, sh:lessThanOrEquals, sh:maxCount, sh:maxExclusive, - sh:maxInclusive, sh:maxLength, sh:minCount, sh:minExclusive, sh:minInclusive, sh:minLength, sh:node, sh:nodeKind, + sh:maxInclusive, sh:maxLength, sh:memberShape, sh:minCount, sh:minExclusive, sh:minInclusive, sh:minLength, sh:node, sh:nodeKind, sh:not, sh:or, sh:pattern, sh:property, sh:qualifiedMaxCount, sh:qualifiedMinCount, sh:qualifiedValueShape, sh:qualifiedValueShape, sh:qualifiedValueShapesDisjoint, sh:qualifiedValueShapesDisjoint, sh:uniqueLang, sh:xone ; + sh:targetObjectsOf sh:memberShape ; # memberShape-node sh:targetObjectsOf sh:node ; # node-node sh:targetObjectsOf sh:not ; # not-node sh:targetObjectsOf sh:property ; # property-node @@ -223,6 +224,11 @@ shsh:ShapeShape sh:maxCount 1 ; # minLength-maxCount sh:minInclusive 0 ; # minLength-minInclusive ] ; + sh:property [ + sh:path sh:memberShape ; + sh:node shsh:NodeShapeShape ; # memberShape-node + sh:maxCount 1 ; # memberShape-maxCount + ] ; sh:property [ sh:path sh:nodeKind ; sh:in ( sh:BlankNode sh:IRI sh:Literal sh:BlankNodeOrIRI sh:BlankNodeOrLiteral sh:IRIOrLiteral ) ; # nodeKind-in @@ -302,6 +308,10 @@ shsh:NodeShapeShape sh:path sh:qualifiedValueShape ; sh:maxCount 0 ; # qualifiedValueShape-scope ] ; + sh:property [ + sh:path sh:memberShape ; + sh:maxCount 0 ; # memberShape-scope + ] ; sh:property [ sh:path sh:uniqueLang ; sh:maxCount 0 ; # uniqueLang-scope diff --git a/shacl12-vocabularies/shacl.ttl b/shacl12-vocabularies/shacl.ttl index 67ee87b3..39c46e35 100644 --- a/shacl12-vocabularies/shacl.ttl +++ b/shacl12-vocabularies/shacl.ttl @@ -894,6 +894,26 @@ sh:minLength rdfs:range xsd:integer ; rdfs:isDefinedBy sh: . +sh:MemberShapeConstraintComponent + a sh:ConstraintComponent ; + rdfs:label "Member shape constraint component"@en ; + rdfs:comment "Can be used to specify constraints on the members of a given list, assuming that the given sh:property has rdf:Lists as values. A violation is reported for each member of the list that does not comply with the constraints specified by the given shape."@en ; + sh:parameter sh:MemberShapeConstraintComponent-memberShape ; + rdfs:isDefinedBy sh: . + +sh:MemberShapeConstraintComponent-memberShape + a sh:Parameter ; + sh:path sh:memberShape ; + sh:node sh:NodeShape ; + sh:maxCount 1 ; + rdfs:isDefinedBy sh: . + +sh:memberShape + a rdf:Property ; + rdfs:label "member shape"@en ; + rdfs:comment "Specifies the shape that all members of RDF lists must conform to."@en ; + rdfs:range sh:NodeShape ; + rdfs:isDefinedBy sh: . sh:NodeConstraintComponent a sh:ConstraintComponent ; From b09c177b37381ca8d651835625decf7a119a4e00 Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Wed, 11 Jun 2025 12:39:48 +0100 Subject: [PATCH 02/53] chore: add HTML documentation --- shacl12-core/index.html | 182 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 181 insertions(+), 1 deletion(-) diff --git a/shacl12-core/index.html b/shacl12-core/index.html index 0c130e0d..645ce662 100644 --- a/shacl12-core/index.html +++ b/shacl12-core/index.html @@ -2756,6 +2756,7 @@

Handling of Recursive Shapes

  • sh:and
  • +
  • sh:memberShape
  • sh:not
  • sh:or
  • sh:property
  • @@ -2810,7 +2811,7 @@

    Conformance Checking

    conforms to a given shape, and false otherwise.

    - Note that some constraint components of SHACL Core (e.g., those of sh:not, sh:or and sh:node) + Note that some constraint components of SHACL Core (e.g., those of sh:not, sh:or, sh:node and sh:memberShape) rely on conformance checking. In these cases, the validation results used to determine the outcome of conformance checking are separated from those of the surrounding validation process and typically do not end up in the same validation report @@ -5691,6 +5692,185 @@

    sh:property

    +
    +

    sh:memberShape

    +

    + sh:memberShape requires that each value node be the head of a well-formed RDF list, + and that each member of that list conforms to the given node shape. +

    +

    + Constraint Component IRI: sh:MemberShapeConstraintComponent +

    + +
    Parameters:
    + + + + + + + + + +
    PropertySummary and Syntax Rules
    sh:memberShape + The shape that all members of RDF lists must conform to. + The value of sh:memberShape must be a well-formed node shapes. + Node shapes cannot have any value for sh:memberShape. + A shape has at most one value for sh:memberShape. +
    +
    +
    TEXTUAL DEFINITION
    +
    + Let $memberShape be a value of sh:memberShape. + Each value node v must be a well-formed RDF list - a failure MUST be produced if v is not a well-formed RDF list. + For each member m of the list v: + A failure MUST be produced if the conformance checking of m against $memberShape produces a failure. + Otherwise, if m does not conform to $memberShape, + there is a validation result with v as sh:value and information about the non-conforming member. +
    +
    +

    The remainder of this section is informative.

    +

    + In the following example, all values of the property ex:speakerOrder must be RDF lists, and each member of those lists must be an IRI. +

    + +
    +

    sh:qualifiedValueShape, sh:qualifiedMinCount, sh:qualifiedMaxCount

    From 644e29cc7558e196dceef403c1eaec0e123f8bba Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Wed, 11 Jun 2025 15:04:12 +0100 Subject: [PATCH 03/53] fix: use SHACL list rather than RDF list, allow memberShape to be used on Node Shapes and add appropriate tests --- shacl12-core/index.html | 16 ++-- .../tests/core/node/manifest.ttl | 1 + .../tests/core/node/memberShape-001.ttl | 94 +++++++++++++++++++ .../tests/core/property/manifest.ttl | 2 + .../tests/core/property/memberShape-001.ttl | 2 +- .../tests/core/property/memberShape-002.ttl | 2 +- .../tests/core/property/memberShape-003.ttl | 86 +++++++++++++++++ .../tests/core/property/memberShape-004.ttl | 92 ++++++++++++++++++ shacl12-vocabularies/shacl-shacl.ttl | 5 +- 9 files changed, 286 insertions(+), 14 deletions(-) create mode 100644 shacl12-test-suite/tests/core/node/memberShape-001.ttl create mode 100644 shacl12-test-suite/tests/core/property/memberShape-003.ttl create mode 100644 shacl12-test-suite/tests/core/property/memberShape-004.ttl diff --git a/shacl12-core/index.html b/shacl12-core/index.html index 645ce662..5e50c54c 100644 --- a/shacl12-core/index.html +++ b/shacl12-core/index.html @@ -2758,10 +2758,10 @@

    Handling of Recursive Shapes

  • sh:and
  • sh:memberShape
  • sh:not
  • +
  • sh:node
  • sh:or
  • sh:property
  • sh:qualifiedValueShape
  • -
  • sh:node
  • sh:xone

@@ -5695,7 +5695,7 @@

sh:property

sh:memberShape

- sh:memberShape requires that each value node be the head of a well-formed RDF list, + sh:memberShape requires that each value node be a SHACL list, and that each member of that list conforms to the given node shape.

@@ -5711,9 +5711,8 @@

sh:memberShape

sh:memberShape - The shape that all members of RDF lists must conform to. + The shape that all members of the SHACL list must conform to. The value of sh:memberShape must be a well-formed node shapes. - Node shapes cannot have any value for sh:memberShape. A shape has at most one value for sh:memberShape. @@ -5722,16 +5721,17 @@

sh:memberShape

TEXTUAL DEFINITION
Let $memberShape be a value of sh:memberShape. - Each value node v must be a well-formed RDF list - a failure MUST be produced if v is not a well-formed RDF list. - For each member m of the list v: - A failure MUST be produced if the conformance checking of m against $memberShape produces a failure. + Each value node v must be a SHACL list - a failure MUST be produced if v is not a SHACL list. + For each member m of the list v + a failure MUST be produced if the conformance checking of m against $memberShape produces a failure. Otherwise, if m does not conform to $memberShape, - there is a validation result with v as sh:value and information about the non-conforming member. + there is a validation result with m as sh:value and information about the non-conforming member.

The remainder of this section is informative.

In the following example, all values of the property ex:speakerOrder must be RDF lists, and each member of those lists must be an IRI. + Note that sh:memberShape can be used in both property shapes (as shown) and node shapes (where it would apply to the focus node itself).

+
+

List Constraint Components

+

+ The constraint components in this section apply to value nodes that are SHACL lists. + They specify conditions on the structure, length, and members of RDF lists. +

+ +
+

sh:memberShape

+

+ sh:memberShape specifies that all members of SHACL list value nodes must conform to the given node shape. +

+

+ Constraint Component IRI: sh:MemberShapeConstraintComponent +

+ +
Parameters:
+ + + + + + + + + +
PropertySummary and Syntax Rules
sh:memberShape + The shape that all members of the SHACL list must conform to. + The value of sh:memberShape must be a well-formed node shape. +
+
+
TEXTUAL DEFINITION
+
+ Let $memberShape be a parameter value for sh:memberShape. + Each value node v must be a SHACL list - if v is not a SHACL list there is a validation result. + If any member of m of the list v does not conform to $memberShape, there is a validation result. There must be at most one validation result for each list v. +
+
+

The remainder of this section is informative.

+

+ Each member m of a value node v that does not conform to the $memberShape should be reported as a separate sh:detail in the validation result for v. + If the list v is not a valid SHACL list, this should also be reported as a sh:detail in the validation result for v. +

+

+ Examples of how to generate sh:details in validation results can be found in the test cases for sh:memberShape in the SHACL test suite: memberShape-001.ttl. +

+ +
+ +
+

sh:minListLength

+

+ sh:minListLength specifies the minimum number of members that SHACL list value nodes must have. +

+

+ Constraint Component IRI: sh:MinListLengthConstraintComponent +

+ +
Parameters:
+ + + + + + + + + +
PropertySummary and Syntax Rules
sh:minListLength + The minimum number of members in the SHACL list. + The values of sh:minListLength in a shape are literals with datatype xsd:integer. + The values of sh:minListLength in a shape are integers greater than or equal to 0. +
+
+
TEXTUAL DEFINITION
+
+ Let $minListLength be a parameter value for sh:minListLength. + Each value node v must be a SHACL list - if v is not a SHACL list there is a validation result. + If the number of members in a list v is less than $minListLength, + there is a validation result. +
+
+
+ +
+

sh:maxListLength

+

+ sh:maxListLength specifies the maximum number of members that SHACL list value nodes must have. +

+

+ Constraint Component IRI: sh:MaxListLengthConstraintComponent +

+ +
Parameters:
+ + + + + + + + + +
PropertySummary and Syntax Rules
sh:maxListLength + The maximum number of members in the SHACL list. + The values of sh:maxListLength in a shape are literals with datatype xsd:integer. + The values of sh:maxListLength in a shape are integers greater than or equal to 0. +
+
+
TEXTUAL DEFINITION
+
+ Let $maxListLength be a parameter value for sh:maxListLength. + Each value node v must be a SHACL list - if v is not a SHACL list there is a validation result. + If the number of members in the list v is greater than $maxListLength, + there is a validation result. +
+
+
+ +
+

sh:uniqueMembers

+

+ sh:uniqueMembers specifies whether SHACL list value nodes must have unique members. +

+

+ Constraint Component IRI: sh:UniqueMembersConstraintComponent +

+ +
Parameters:
+ + + + + + + + + +
PropertySummary and Syntax Rules
sh:uniqueMembers + A boolean that specifies whether the members of the SHACL list must be unique. + The values of sh:uniqueMembers in a shape are literals with datatype xsd:boolean. +
+
+
TEXTUAL DEFINITION
+
+ Let $uniqueMembers be a parameter value for sh:uniqueMembers. + Each value node v must be a SHACL list - if v is not a SHACL list there is a validation result. + If $uniqueMembers is true and the list v has duplicate members, + there is a validation result. There must be at most one validation result for each list v. +
+
+

The remainder of this section is informative.

+

+ Each duplicate member of a list v should be reported as a separate sh:detail in the validation result for v. If the list v is not a valid SHACL list, this should also be reported as a sh:detail in the validation result for v. +

+

+ Examples of how to generate sh:details in validation results can be found in the test cases for sh:uniqueMembers in the SHACL test suite: uniqueMembers-001.ttl. +

+
+
+

Property Pair Constraint Components

@@ -5692,234 +5983,6 @@

sh:property

-
-

sh:memberShape

-

- sh:memberShape requires that each value node be a SHACL list, - and that each member of that list conforms to the given node shape. -

-

- Constraint Component IRI: sh:MemberShapeConstraintComponent -

- -
Parameters:
- - - - - - - - - - - - - - - - - - - - - -
PropertySummary and Syntax Rules
sh:memberShape - The shape that all members of the SHACL list must conform to. - The value of sh:memberShape must be a well-formed node shape. -
sh:minListLength - An optional non-negative integer that specifies the minimum number of members in the SHACL list. -
sh:maxListLength - An optional non-negative integer that specifies the maximum number of members in the SHACL list. -
sh:uniqList - An optional boolean that specifies whether the members of the SHACL list must be unique. -
-
-
TEXTUAL DEFINITION
-
- Let $memberShape be a value of sh:memberShape. - Each value node v must be a SHACL list - a failure MUST be produced if v is not a SHACL list. - For each value node v that is a valid SHACL list, a failure MUST be produced for each violation of the following conditions: -
    -
  • - If sh:minListLength is present, the number of members in the list v MUST be greater than or equal to the value of sh:minListLength. -
  • -
  • - If sh:maxListLength is present, the number of members in the list v MUST be less than or equal to the value of sh:maxListLength. -
  • -
  • - If sh:uniqList is present and has the value true, the members of the list v MUST be unique. -
  • -
- - For each member m of the list v - a failure MUST be produced if the conformance checking of m against $memberShape produces a failure. - - There MUST be at most one validation result for each list v and set of triggering constraints. In each validation result, the sh:detail property SHOULD be used to specify: -
    -
  • - The validation results for each member m of the list that fails conformance checking. - m SHOULD be used as the sh:focusNode for each sh:detail result. -
  • -
  • - If v is not a valid SHACL list. v SHOULD be used as the sh:focusNode for this sh:detail result. -
  • - Each instance where the list v does not conform to the constraints specified by sh:minListLength, sh:maxListLength, or sh:uniqList. -
  • -
  • -
-
-
-

The remainder of this section is informative.

-

- In the following example, all values of the property ex:speakerOrder must be RDF lists, and each member of those lists must be an IRI. - Note that sh:memberShape can be used in both property shapes (as shown) and node shapes (where it would apply to the focus node itself). - - Examples of how to generate sh:details can be found in the test cases for sh:memberShape in the SHACL test suite: memberShape-001.ttl. -

- -
-

sh:qualifiedValueShape, sh:qualifiedMinCount, sh:qualifiedMaxCount

From 2133631301404771efe85d3dcc32afdc385e9cd5 Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Sun, 29 Jun 2025 18:10:21 +0100 Subject: [PATCH 40/53] chore: add examples to list constraints --- shacl12-core/index.html | 268 ++++++++++++++++++++++++++++++++-------- 1 file changed, 218 insertions(+), 50 deletions(-) diff --git a/shacl12-core/index.html b/shacl12-core/index.html index 977d7b2b..1e4f0063 100644 --- a/shacl12-core/index.html +++ b/shacl12-core/index.html @@ -4524,7 +4524,7 @@

sh:uniqueLang

List Constraint Components

The constraint components in this section apply to value nodes that are SHACL lists. - They specify conditions on the structure, length, and members of RDF lists. + They specify conditions on the structure, length, and members of SHACL lists.

@@ -4555,7 +4555,7 @@

sh:memberShape

Let $memberShape be a parameter value for sh:memberShape. Each value node v must be a SHACL list - if v is not a SHACL list there is a validation result. - If any member of m of the list v does not conform to $memberShape, there is a validation result. There must be at most one validation result for each list v. + If any member m of the list v does not conform to $memberShape, there is a validation result. There must be at most one validation result for each list v.

The remainder of this section is informative.

@@ -4566,6 +4566,9 @@

sh:memberShape

Examples of how to generate sh:details in validation results can be found in the test cases for sh:memberShape in the SHACL test suite: memberShape-001.ttl.

+

+ In the following example, all values of the property ex:speakerOrder must be SHACL lists with members that are IRIs. +

@@ -4764,6 +4788,78 @@

sh:maxListLength

there is a validation result. +

The remainder of this section is informative.

+

+ In the following example, all values of the property ex:hobbies must be SHACL lists with at most 2 members. + Additional test cases for sh:maxListLength can be found in the SHACL test suite: maxListLength-001.ttl. +

+
@@ -4800,11 +4896,83 @@

sh:uniqueMembers

The remainder of this section is informative.

- Each duplicate member of a list v should be reported as a separate sh:detail in the validation result for v. If the list v is not a valid SHACL list, this should also be reported as a sh:detail in the validation result for v. + Each duplicate member m of a list v should be reported as a separate sh:detail in the validation result for v. If the list v is not a valid SHACL list, this should also be reported as a sh:detail in the validation result for v.

Examples of how to generate sh:details in validation results can be found in the test cases for sh:uniqueMembers in the SHACL test suite: uniqueMembers-001.ttl.

+

+ In the following example, all values of the property ex:preferences must be SHACL lists with members that have unique values within each SHACL list. +

+
From 61696f546af459e9ee0d66af068524dadb596779 Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Sun, 29 Jun 2025 18:17:48 +0100 Subject: [PATCH 41/53] chore: fix unique members namespace --- shacl12-test-suite/tests/core/property/uniqueMembers-001.ttl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shacl12-test-suite/tests/core/property/uniqueMembers-001.ttl b/shacl12-test-suite/tests/core/property/uniqueMembers-001.ttl index 07f43cf1..a4230405 100644 --- a/shacl12-test-suite/tests/core/property/uniqueMembers-001.ttl +++ b/shacl12-test-suite/tests/core/property/uniqueMembers-001.ttl @@ -1,5 +1,5 @@ @prefix dash: . -@prefix ex: . +@prefix ex: . @prefix mf: . @prefix owl: . @prefix rdf: . From 97ecfe6c7f185094583c0e7e71a6a68e02a44a05 Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Mon, 30 Jun 2025 10:56:09 +0100 Subject: [PATCH 42/53] chore: rename `uniqList` ->` uniqueMembers` in shacl shacl --- shacl12-vocabularies/shacl-shacl.ttl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shacl12-vocabularies/shacl-shacl.ttl b/shacl12-vocabularies/shacl-shacl.ttl index 1837b08b..67871c82 100644 --- a/shacl12-vocabularies/shacl-shacl.ttl +++ b/shacl12-vocabularies/shacl-shacl.ttl @@ -242,7 +242,7 @@ shsh:ShapeShape sh:minInclusive 0 ; # maxListLength-minInclusive ] ; sh:property [ - sh:path sh:uniqList ; + sh:path sh:uniqueMembers ; sh:datatype xsd:boolean ; # uniqList-datatype sh:maxCount 1 ; # uniqList-maxCount ] ; From 8c6b52b7c54d6ead580e31cf7c6464a82b88c919 Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Mon, 30 Jun 2025 10:57:05 +0100 Subject: [PATCH 43/53] chore: fix reference to `UniqueMembersConstraintComponent` in vocab --- shacl12-vocabularies/shacl.ttl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shacl12-vocabularies/shacl.ttl b/shacl12-vocabularies/shacl.ttl index 22860026..c851aa8b 100644 --- a/shacl12-vocabularies/shacl.ttl +++ b/shacl12-vocabularies/shacl.ttl @@ -942,7 +942,7 @@ sh:UniqueMembersConstraintComponent sh:parameter sh:UniqueMembersConstraintComponent-uniqueMembers ; rdfs:isDefinedBy sh: . -sh:MemberShapeConstraintComponent-uniqueMembers +sh:UniqueMembersConstraintComponent-uniqueMembers a sh:Parameter ; sh:path sh:uniqueMembers ; sh:datatype xsd:boolean ; From 5c72e8eb8a891b008e8c99c54dbdac60407a51ec Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Mon, 30 Jun 2025 11:07:24 +0100 Subject: [PATCH 44/53] chore: remove blank node targetNodes for lists --- .../tests/core/node/maxListLength-001.ttl | 10 ++- .../tests/core/node/memberShape-001.ttl | 89 ++++++++++--------- .../tests/core/node/minListLength-001.ttl | 6 +- .../tests/core/node/uniqueMembers-001.ttl | 16 ++-- 4 files changed, 70 insertions(+), 51 deletions(-) diff --git a/shacl12-test-suite/tests/core/node/maxListLength-001.ttl b/shacl12-test-suite/tests/core/node/maxListLength-001.ttl index e5e5438b..43614eac 100644 --- a/shacl12-test-suite/tests/core/node/maxListLength-001.ttl +++ b/shacl12-test-suite/tests/core/node/maxListLength-001.ttl @@ -12,12 +12,16 @@ ex:ListShape rdf:type sh:NodeShape ; sh:maxListLength 2 ; # Satisfies all constraints - sh:targetNode ( 1 2 ), rdf:nil ; + sh:targetNode ex:list0, rdf:nil ; # Violates maxListLength constraint - sh:targetNode _:b1, ex:notAList ; + sh:targetNode ex:list1, ex:notAList ; . -_:b1 +ex:list0 + rdf:first 1 ; + rdf:rest ( 2 ) . + +ex:list1 rdf:first 1 ; rdf:rest ( 2 3 ) . diff --git a/shacl12-test-suite/tests/core/node/memberShape-001.ttl b/shacl12-test-suite/tests/core/node/memberShape-001.ttl index b2518285..091f8df6 100644 --- a/shacl12-test-suite/tests/core/node/memberShape-001.ttl +++ b/shacl12-test-suite/tests/core/node/memberShape-001.ttl @@ -14,57 +14,64 @@ ex:IRIShape a sh:NodeShape ; ex:IRIListShape rdf:type sh:NodeShape ; sh:memberShape ex:IRIShape ; - sh:targetNode ( ex:Alice ex:Bob ) ; + sh:targetNode ex:list0 ; # Valid empty list - sh:targetNode () ; - # _:b1 is valid, the remainder trigger violations (including _:b3 which has no properties in this graph) - sh:targetNode _:b1, _:b2, _:b3, _:b4, _:b5, _:b6, _:b7, _:b9 ; + sh:targetNode rdf:nil ; + # ex:list1 is valid, the remainder trigger violations (including ex:list3 which has no properties in this graph) + sh:targetNode ex:list1, ex:list2, ex:list3, ex:list4, ex:list5, ex:list6, ex:list7, ex:list9 ; . -_:b1 +ex:list0 + rdf:first ex:Alice ; + rdf:rest ( + ex:Bob + ) ; +. + +ex:list1 rdf:first ex:Alice ; rdf:rest rdf:nil ; ex:extraProperty "extra" ; . -_:b2 +ex:list2 rdf:first ex:Alice ; rdf:rest ( "Bob" ) . -_:b4 +ex:list4 rdf:first ex:Alice ; . -_:b5 +ex:list5 rdf:first "Charlie" ; rdf:rest ( "Donna" ) . -_:b6 +ex:list6 rdf:first "Charlie" ; . -_:b8 rdfs:label "Malformed SHACL List" . +ex:list8 rdfs:label "Malformed SHACL List" . -_:b7 +ex:list7 rdf:first "Charlie" ; - rdf:rest _:b8 ; + rdf:rest ex:list8 ; . -# using _:b9 and _:b10 to test recursive list error -_:b9 +# using ex:list9 and ex:list10 to test recursive list error +ex:list9 rdf:first ex:Alice ; - rdf:rest _:b10 ; + rdf:rest ex:list10 ; . -_:b10 +ex:list10 rdf:first "Bob" ; - rdf:rest _:b9 . + rdf:rest ex:list9 . <> rdf:type mf:Manifest ; @@ -85,7 +92,7 @@ _:b10 sh:conforms "false"^^xsd:boolean ; sh:result [ rdf:type sh:ValidationResult ; - sh:focusNode _:b2 ; + sh:focusNode ex:list2 ; sh:resultMessage "Value does not conform to Shape ex:IRIListShape. See details for more information." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; @@ -102,43 +109,43 @@ _:b10 ] ; sh:result [ rdf:type sh:ValidationResult ; - sh:focusNode _:b3 ; + sh:focusNode ex:list3 ; sh:resultMessage "Value is a malformed SHACL List." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; sh:sourceShape ex:IRIListShape ; - sh:value _:b3 ; + sh:value ex:list3 ; sh:detail [ rdf:type sh:ValidationResult ; - sh:focusNode _:b3 ; - sh:resultMessage "Value is a malformed SHACL List. _:b3 is missing rdf:first and rdf:rest properties." ; + sh:focusNode ex:list3 ; + sh:resultMessage "Value is a malformed SHACL List. ex:list3 is missing rdf:first and rdf:rest properties." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; sh:sourceShape ex:IRIListShape ; - sh:value _:b3 ; + sh:value ex:list3 ; ] ; ] ; sh:result [ rdf:type sh:ValidationResult ; - sh:focusNode _:b4 ; + sh:focusNode ex:list4 ; sh:resultMessage "Value does not conform to Shape ex:IRIListShape. See details for more information." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; sh:sourceShape ex:IRIListShape ; - sh:value _:b4 ; + sh:value ex:list4 ; sh:detail [ rdf:type sh:ValidationResult ; - sh:focusNode _:b4 ; - sh:resultMessage "Value is a malformed SHACL List. _:b4 is missing rdf:rest property." ; + sh:focusNode ex:list4 ; + sh:resultMessage "Value is a malformed SHACL List. ex:list4 is missing rdf:rest property." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; sh:sourceShape ex:IRIListShape ; - sh:value _:b4 ; + sh:value ex:list4 ; ] ; ] ; sh:result [ rdf:type sh:ValidationResult ; - sh:focusNode _:b5 ; + sh:focusNode ex:list5 ; sh:resultMessage "Value does not conform to Shape ex:IRIListShape. See details for more information." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; @@ -163,7 +170,7 @@ _:b10 ] ; sh:result [ rdf:type sh:ValidationResult ; - sh:focusNode _:b6 ; + sh:focusNode ex:list6 ; sh:resultMessage "Value does not conform to Shape ex:IRIListShape. See details for more information." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; @@ -178,17 +185,17 @@ _:b10 sh:value "Charlie" ; ], [ rdf:type sh:ValidationResult ; - sh:focusNode _:b6 ; - sh:resultMessage "Value is a malformed SHACL List. _:b6 is missing rdf:rest property." ; + sh:focusNode ex:list6 ; + sh:resultMessage "Value is a malformed SHACL List. ex:list6 is missing rdf:rest property." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; sh:sourceShape ex:IRIListShape ; - sh:value _:b6 ; + sh:value ex:list6 ; ] ; ] ; sh:result [ rdf:type sh:ValidationResult ; - sh:focusNode _:b7 ; + sh:focusNode ex:list7 ; sh:resultMessage "Value does not conform to Shape ex:IRIListShape. See details for more information." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; @@ -203,17 +210,17 @@ _:b10 sh:value "Charlie" ; ], [ rdf:type sh:ValidationResult ; - sh:focusNode _:b8 ; - sh:resultMessage "Value is a malformed SHACL List. _:b8 is missing rdf:first and rdf:rest property." ; + sh:focusNode ex:list8 ; + sh:resultMessage "Value is a malformed SHACL List. ex:list8 is missing rdf:first and rdf:rest property." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; sh:sourceShape ex:IRIListShape ; - sh:value _:b8 ; + sh:value ex:list8 ; ] ; ] ; sh:result [ rdf:type sh:ValidationResult ; - sh:focusNode _:b9 ; + sh:focusNode ex:list9 ; sh:resultMessage "Value does not conform to Shape ex:IRIListShape. See details for more information." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; @@ -228,12 +235,12 @@ _:b10 sh:value "Charlie" ; ], [ rdf:type sh:ValidationResult ; - sh:focusNode _:b10 ; - sh:resultMessage "Value is a malformed SHACL List. A list cannot have itself in the rdf:rest+ path. List _:b9 follows from _:b10." ; + sh:focusNode ex:list10 ; + sh:resultMessage "Value is a malformed SHACL List. A list cannot have itself in the rdf:rest+ path. List ex:list9 follows from ex:list10." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; sh:sourceShape ex:IRIListShape ; - sh:value _:b9 ; + sh:value ex:list9 ; ] ; ] ; ] ; diff --git a/shacl12-test-suite/tests/core/node/minListLength-001.ttl b/shacl12-test-suite/tests/core/node/minListLength-001.ttl index 10e2aa1f..8bf4f50a 100644 --- a/shacl12-test-suite/tests/core/node/minListLength-001.ttl +++ b/shacl12-test-suite/tests/core/node/minListLength-001.ttl @@ -12,11 +12,15 @@ ex:ListShape rdf:type sh:NodeShape ; sh:minListLength 1 ; # Satisfies all constraints - sh:targetNode ( 1 2 ) ; + sh:targetNode ex:list0 ; # Violates minListLength constraint sh:targetNode rdf:nil, ex:notAList ; . +ex:list0 + rdf:first 1 ; + rdf:rest ( 2 ) . + <> rdf:type mf:Manifest ; mf:entries ( diff --git a/shacl12-test-suite/tests/core/node/uniqueMembers-001.ttl b/shacl12-test-suite/tests/core/node/uniqueMembers-001.ttl index 521d726f..1b136e21 100644 --- a/shacl12-test-suite/tests/core/node/uniqueMembers-001.ttl +++ b/shacl12-test-suite/tests/core/node/uniqueMembers-001.ttl @@ -12,12 +12,16 @@ ex:ListShape rdf:type sh:NodeShape ; sh:uniqueMembers true ; # Satisfies all constraints - sh:targetNode ( 1 2 ), rdf:nil ; + sh:targetNode ex:list0, rdf:nil ; # Violates uniqueMembers constraint - sh:targetNode _:b1, ex:notAList ; + sh:targetNode ex:list1, ex:notAList ; . -_:b1 +ex:list0 + rdf:first 1 ; + rdf:rest ( 2 ) . + +ex:list1 rdf:first 1 ; rdf:rest ( 2 1 2 2 ) . @@ -40,14 +44,14 @@ _:b1 sh:conforms "false"^^xsd:boolean ; sh:result [ rdf:type sh:ValidationResult ; - sh:focusNode _:b1 ; + sh:focusNode ex:list1 ; sh:resultMessage "Value does not conform to Shape ex:ListShape. See details for more information." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:UniqueMembersConstraintComponent ; sh:sourceShape ex:ListShape ; sh:detail [ rdf:type sh:ValidationResult ; - sh:focusNode _:b1 ; + sh:focusNode ex:list1 ; sh:resultMessage "List is required to have unique elements. Two occurences of '\"1\"^^xsd:integer' found." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:UniqueMembersConstraintComponent ; @@ -55,7 +59,7 @@ _:b1 sh:value 1 ; ], [ rdf:type sh:ValidationResult ; - sh:focusNode _:b1 ; + sh:focusNode ex:list1 ; sh:resultMessage "List is required to have unique elements. Three occurences of '\"2\"^^xsd:integer' found." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:UniqueMembersConstraintComponent ; From ca91c2c71ce6526995d39a5ba2eca744ba2d9d39 Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Mon, 30 Jun 2025 11:23:31 +0100 Subject: [PATCH 45/53] fix: make invalid SHACL lists a top-level violation --- shacl12-core/index.html | 8 +- .../tests/core/node/memberShape-001.ttl | 82 ++----------------- .../tests/core/node/uniqueMembers-001.ttl | 11 +-- .../tests/core/property/uniqueMembers-001.ttl | 12 +-- 4 files changed, 14 insertions(+), 99 deletions(-) diff --git a/shacl12-core/index.html b/shacl12-core/index.html index 1e4f0063..5b7de87b 100644 --- a/shacl12-core/index.html +++ b/shacl12-core/index.html @@ -4555,13 +4555,13 @@

sh:memberShape

Let $memberShape be a parameter value for sh:memberShape. Each value node v must be a SHACL list - if v is not a SHACL list there is a validation result. - If any member m of the list v does not conform to $memberShape, there is a validation result. There must be at most one validation result for each list v. + If any member m of the SHACL list v does not conform to $memberShape, there is a validation result.

The remainder of this section is informative.

Each member m of a value node v that does not conform to the $memberShape should be reported as a separate sh:detail in the validation result for v. - If the list v is not a valid SHACL list, this should also be reported as a sh:detail in the validation result for v. + If v is not a valid SHACL list, this should be reported as a top-level validation result and validation of individual members should not be attempted.

Examples of how to generate sh:details in validation results can be found in the test cases for sh:memberShape in the SHACL test suite: memberShape-001.ttl. @@ -4891,12 +4891,12 @@

sh:uniqueMembers

Let $uniqueMembers be a parameter value for sh:uniqueMembers. Each value node v must be a SHACL list - if v is not a SHACL list there is a validation result. If $uniqueMembers is true and the list v has duplicate members, - there is a validation result. There must be at most one validation result for each list v. + there is a validation result.

The remainder of this section is informative.

- Each duplicate member m of a list v should be reported as a separate sh:detail in the validation result for v. If the list v is not a valid SHACL list, this should also be reported as a sh:detail in the validation result for v. + Each duplicate member m of a list v should be reported as a separate sh:detail in the validation result for v. If the list v is not a valid SHACL list, this should be reported as a top-level validation result and validation of unique membership should not be attempted.

Examples of how to generate sh:details in validation results can be found in the test cases for sh:uniqueMembers in the SHACL test suite: uniqueMembers-001.ttl. diff --git a/shacl12-test-suite/tests/core/node/memberShape-001.ttl b/shacl12-test-suite/tests/core/node/memberShape-001.ttl index 091f8df6..b4d9ed39 100644 --- a/shacl12-test-suite/tests/core/node/memberShape-001.ttl +++ b/shacl12-test-suite/tests/core/node/memberShape-001.ttl @@ -110,38 +110,20 @@ ex:list10 sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:list3 ; - sh:resultMessage "Value is a malformed SHACL List." ; + sh:resultMessage "Value is a malformed SHACL List. ex:list3 is missing rdf:first and rdf:rest properties." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; sh:sourceShape ex:IRIListShape ; sh:value ex:list3 ; - sh:detail [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:list3 ; - sh:resultMessage "Value is a malformed SHACL List. ex:list3 is missing rdf:first and rdf:rest properties." ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; - sh:sourceShape ex:IRIListShape ; - sh:value ex:list3 ; - ] ; ] ; sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:list4 ; - sh:resultMessage "Value does not conform to Shape ex:IRIListShape. See details for more information." ; + sh:resultMessage "Value is a malformed SHACL List. ex:list4 is missing rdf:rest property." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; sh:sourceShape ex:IRIListShape ; sh:value ex:list4 ; - sh:detail [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:list4 ; - sh:resultMessage "Value is a malformed SHACL List. ex:list4 is missing rdf:rest property." ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; - sh:sourceShape ex:IRIListShape ; - sh:value ex:list4 ; - ] ; ] ; sh:result [ rdf:type sh:ValidationResult ; @@ -171,77 +153,29 @@ ex:list10 sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:list6 ; - sh:resultMessage "Value does not conform to Shape ex:IRIListShape. See details for more information." ; + sh:resultMessage "Value is a malformed SHACL List. ex:list6 is missing rdf:rest property." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; sh:sourceShape ex:IRIListShape ; - sh:detail [ - rdf:type sh:ValidationResult ; - sh:focusNode "Charlie" ; - sh:resultMessage "Value is not of Node Kind sh:IRI" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape ex:IRIShape ; - sh:value "Charlie" ; - ], [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:list6 ; - sh:resultMessage "Value is a malformed SHACL List. ex:list6 is missing rdf:rest property." ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; - sh:sourceShape ex:IRIListShape ; - sh:value ex:list6 ; - ] ; + sh:value ex:list6 ; ] ; sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:list7 ; - sh:resultMessage "Value does not conform to Shape ex:IRIListShape. See details for more information." ; + sh:resultMessage "Value is a malformed SHACL List. ex:list8 is missing rdf:first and rdf:rest property." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; sh:sourceShape ex:IRIListShape ; - sh:detail [ - rdf:type sh:ValidationResult ; - sh:focusNode "Charlie" ; - sh:resultMessage "Value is not of Node Kind sh:IRI" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape ex:IRIShape ; - sh:value "Charlie" ; - ], [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:list8 ; - sh:resultMessage "Value is a malformed SHACL List. ex:list8 is missing rdf:first and rdf:rest property." ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; - sh:sourceShape ex:IRIListShape ; - sh:value ex:list8 ; - ] ; + sh:value ex:list8 ; ] ; sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:list9 ; - sh:resultMessage "Value does not conform to Shape ex:IRIListShape. See details for more information." ; + sh:resultMessage "Value is a malformed SHACL List. A list cannot have itself in the rdf:rest+ path. List ex:list9 follows from ex:list10." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; sh:sourceShape ex:IRIListShape ; - sh:detail [ - rdf:type sh:ValidationResult ; - sh:focusNode "Charlie" ; - sh:resultMessage "Value is not of Node Kind sh:IRI" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape ex:IRIShape ; - sh:value "Charlie" ; - ], [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:list10 ; - sh:resultMessage "Value is a malformed SHACL List. A list cannot have itself in the rdf:rest+ path. List ex:list9 follows from ex:list10." ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; - sh:sourceShape ex:IRIListShape ; - sh:value ex:list9 ; - ] ; + sh:value ex:list10 ; ] ; ] ; mf:status sht:approved ; diff --git a/shacl12-test-suite/tests/core/node/uniqueMembers-001.ttl b/shacl12-test-suite/tests/core/node/uniqueMembers-001.ttl index 1b136e21..f292d344 100644 --- a/shacl12-test-suite/tests/core/node/uniqueMembers-001.ttl +++ b/shacl12-test-suite/tests/core/node/uniqueMembers-001.ttl @@ -70,20 +70,11 @@ ex:list1 sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:notAList ; - sh:resultMessage "Value does not conform to Shape ex:ListShape. See details for more information." ; + sh:resultMessage "Value is a malformed SHACL List. ex:notAList is missing rdf:first and rdf:rest properties." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:UniqueMembersConstraintComponent ; sh:sourceShape ex:ListShape ; sh:value ex:notAList ; - sh:detail [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:notAList ; - sh:resultMessage "Value is a malformed SHACL List. ex:notAList is missing rdf:first and rdf:rest properties." ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:UniqueMembersConstraintComponent ; - sh:sourceShape ex:ListShape ; - sh:value ex:notAList ; - ] ] ; ] ; mf:status sht:approved ; diff --git a/shacl12-test-suite/tests/core/property/uniqueMembers-001.ttl b/shacl12-test-suite/tests/core/property/uniqueMembers-001.ttl index a4230405..aadc19d0 100644 --- a/shacl12-test-suite/tests/core/property/uniqueMembers-001.ttl +++ b/shacl12-test-suite/tests/core/property/uniqueMembers-001.ttl @@ -92,22 +92,12 @@ _:b1 sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:person4 ; - sh:resultMessage "Value does not conform to Shape ex:PersonShape. See details for more information." ; + sh:resultMessage "Value is a malformed SHACL List. ex:notAList is missing rdf:first and rdf:rest properties." ; sh:resultPath ex:preferences ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:UniqueMembersConstraintComponent ; sh:sourceShape ex:PersonShape ; sh:value ex:notAList ; - sh:detail [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:person4 ; - sh:resultMessage "Value is a malformed SHACL List. ex:notAList is missing rdf:first and rdf:rest properties." ; - sh:resultPath ex:preferences ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:UniqueMembersConstraintComponent ; - sh:sourceShape ex:PersonShape ; - sh:value ex:notAList ; - ] ] ; ] ; mf:status sht:approved ; From 1c17cb034c0650d3e4faa659bc658892221757d6 Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Mon, 30 Jun 2025 14:03:38 +0100 Subject: [PATCH 46/53] fix: Use correct focusNode and value for maxListLength test --- shacl12-test-suite/tests/core/node/maxListLength-001.ttl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shacl12-test-suite/tests/core/node/maxListLength-001.ttl b/shacl12-test-suite/tests/core/node/maxListLength-001.ttl index 43614eac..3ce778b7 100644 --- a/shacl12-test-suite/tests/core/node/maxListLength-001.ttl +++ b/shacl12-test-suite/tests/core/node/maxListLength-001.ttl @@ -44,11 +44,12 @@ ex:list1 sh:conforms "false"^^xsd:boolean ; sh:result [ rdf:type sh:ValidationResult ; - sh:focusNode rdf:nil ; + sh:focusNode ex:list1 ; sh:resultMessage "List has length 3, but maximum allowed length is 2." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MaxListLengthConstraintComponent ; sh:sourceShape ex:ListShape ; + sh:value ex:list1 ; ] ; sh:result [ rdf:type sh:ValidationResult ; From 54f1500d267125518e57b47db13a3287ab1265e9 Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Mon, 30 Jun 2025 14:05:30 +0100 Subject: [PATCH 47/53] fix: remove unnecessary maxCount and fix maxListLength name error in vocab --- shacl12-vocabularies/shacl.ttl | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/shacl12-vocabularies/shacl.ttl b/shacl12-vocabularies/shacl.ttl index c851aa8b..4223b768 100644 --- a/shacl12-vocabularies/shacl.ttl +++ b/shacl12-vocabularies/shacl.ttl @@ -918,21 +918,19 @@ sh:MinListLengthConstraintComponent-minListLength a sh:Parameter ; sh:path sh:minListLength ; sh:datatype xsd:integer ; - sh:maxCount 1 ; rdfs:isDefinedBy sh: . sh:MaxListLengthConstraintComponent a sh:ConstraintComponent ; rdfs:label "Maximum list length constraint component"@en ; rdfs:comment "Specifies the maximum length of a SHACL list. A violation is reported if the value is not a valid SHACL list."@en ; - sh:parameter sh:MaxListLengthConstraintComponent-minListLength ; + sh:parameter sh:MaxListLengthConstraintComponent-maxListLength ; rdfs:isDefinedBy sh: . sh:MaxListLengthConstraintComponent-maxListLength a sh:Parameter ; sh:path sh:maxListLength ; sh:datatype xsd:integer ; - sh:maxCount 1 ; rdfs:isDefinedBy sh: . sh:UniqueMembersConstraintComponent @@ -946,7 +944,6 @@ sh:UniqueMembersConstraintComponent-uniqueMembers a sh:Parameter ; sh:path sh:uniqueMembers ; sh:datatype xsd:boolean ; - sh:maxCount 1 ; rdfs:isDefinedBy sh: . sh:memberShape From 91bf091e071fedccab4de57b8273344a20cb97b9 Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Mon, 30 Jun 2025 14:47:07 +0100 Subject: [PATCH 48/53] chore: remove result messages from tests --- .../tests/core/node/maxListLength-001.ttl | 2 -- shacl12-test-suite/tests/core/node/memberShape-001.ttl | 10 ---------- .../tests/core/node/minListLength-001.ttl | 2 -- .../tests/core/node/uniqueMembers-001.ttl | 4 ---- .../tests/core/property/maxListLength-001.ttl | 2 -- .../tests/core/property/memberShape-001.ttl | 2 -- .../tests/core/property/minListLength-001.ttl | 2 -- .../tests/core/property/uniqueMembers-001.ttl | 4 ---- 8 files changed, 28 deletions(-) diff --git a/shacl12-test-suite/tests/core/node/maxListLength-001.ttl b/shacl12-test-suite/tests/core/node/maxListLength-001.ttl index 3ce778b7..5e412494 100644 --- a/shacl12-test-suite/tests/core/node/maxListLength-001.ttl +++ b/shacl12-test-suite/tests/core/node/maxListLength-001.ttl @@ -45,7 +45,6 @@ ex:list1 sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:list1 ; - sh:resultMessage "List has length 3, but maximum allowed length is 2." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MaxListLengthConstraintComponent ; sh:sourceShape ex:ListShape ; @@ -54,7 +53,6 @@ ex:list1 sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:notAList ; - sh:resultMessage "Value is a malformed SHACL List. ex:notAList is missing rdf:first and rdf:rest properties." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MaxListLengthConstraintComponent ; sh:sourceShape ex:ListShape ; diff --git a/shacl12-test-suite/tests/core/node/memberShape-001.ttl b/shacl12-test-suite/tests/core/node/memberShape-001.ttl index b4d9ed39..9dde67e2 100644 --- a/shacl12-test-suite/tests/core/node/memberShape-001.ttl +++ b/shacl12-test-suite/tests/core/node/memberShape-001.ttl @@ -93,14 +93,12 @@ ex:list10 sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:list2 ; - sh:resultMessage "Value does not conform to Shape ex:IRIListShape. See details for more information." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; sh:sourceShape ex:IRIListShape ; sh:detail [ rdf:type sh:ValidationResult ; sh:focusNode "Bob" ; - sh:resultMessage "Value is not of Node Kind sh:IRI" ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; sh:sourceShape ex:IRIShape ; @@ -110,7 +108,6 @@ ex:list10 sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:list3 ; - sh:resultMessage "Value is a malformed SHACL List. ex:list3 is missing rdf:first and rdf:rest properties." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; sh:sourceShape ex:IRIListShape ; @@ -119,7 +116,6 @@ ex:list10 sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:list4 ; - sh:resultMessage "Value is a malformed SHACL List. ex:list4 is missing rdf:rest property." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; sh:sourceShape ex:IRIListShape ; @@ -128,14 +124,12 @@ ex:list10 sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:list5 ; - sh:resultMessage "Value does not conform to Shape ex:IRIListShape. See details for more information." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; sh:sourceShape ex:IRIListShape ; sh:detail [ rdf:type sh:ValidationResult ; sh:focusNode "Charlie" ; - sh:resultMessage "Value is not of Node Kind sh:IRI" ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; sh:sourceShape ex:IRIShape ; @@ -143,7 +137,6 @@ ex:list10 ], [ rdf:type sh:ValidationResult ; sh:focusNode "Donna" ; - sh:resultMessage "Value is not of Node Kind sh:IRI" ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; sh:sourceShape ex:IRIShape ; @@ -153,7 +146,6 @@ ex:list10 sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:list6 ; - sh:resultMessage "Value is a malformed SHACL List. ex:list6 is missing rdf:rest property." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; sh:sourceShape ex:IRIListShape ; @@ -162,7 +154,6 @@ ex:list10 sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:list7 ; - sh:resultMessage "Value is a malformed SHACL List. ex:list8 is missing rdf:first and rdf:rest property." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; sh:sourceShape ex:IRIListShape ; @@ -171,7 +162,6 @@ ex:list10 sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:list9 ; - sh:resultMessage "Value is a malformed SHACL List. A list cannot have itself in the rdf:rest+ path. List ex:list9 follows from ex:list10." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; sh:sourceShape ex:IRIListShape ; diff --git a/shacl12-test-suite/tests/core/node/minListLength-001.ttl b/shacl12-test-suite/tests/core/node/minListLength-001.ttl index 8bf4f50a..118a7ec0 100644 --- a/shacl12-test-suite/tests/core/node/minListLength-001.ttl +++ b/shacl12-test-suite/tests/core/node/minListLength-001.ttl @@ -41,7 +41,6 @@ ex:list0 sh:result [ rdf:type sh:ValidationResult ; sh:focusNode rdf:nil ; - sh:resultMessage "List has length 0, but minimum required length is 1." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MinListLengthConstraintComponent ; sh:sourceShape ex:ListShape ; @@ -49,7 +48,6 @@ ex:list0 sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:notAList ; - sh:resultMessage "Value is a malformed SHACL List. ex:notAList is missing rdf:first and rdf:rest properties." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MinListLengthConstraintComponent ; sh:sourceShape ex:ListShape ; diff --git a/shacl12-test-suite/tests/core/node/uniqueMembers-001.ttl b/shacl12-test-suite/tests/core/node/uniqueMembers-001.ttl index f292d344..287e9137 100644 --- a/shacl12-test-suite/tests/core/node/uniqueMembers-001.ttl +++ b/shacl12-test-suite/tests/core/node/uniqueMembers-001.ttl @@ -45,14 +45,12 @@ ex:list1 sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:list1 ; - sh:resultMessage "Value does not conform to Shape ex:ListShape. See details for more information." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:UniqueMembersConstraintComponent ; sh:sourceShape ex:ListShape ; sh:detail [ rdf:type sh:ValidationResult ; sh:focusNode ex:list1 ; - sh:resultMessage "List is required to have unique elements. Two occurences of '\"1\"^^xsd:integer' found." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:UniqueMembersConstraintComponent ; sh:sourceShape ex:ListShape ; @@ -60,7 +58,6 @@ ex:list1 ], [ rdf:type sh:ValidationResult ; sh:focusNode ex:list1 ; - sh:resultMessage "List is required to have unique elements. Three occurences of '\"2\"^^xsd:integer' found." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:UniqueMembersConstraintComponent ; sh:sourceShape ex:ListShape ; @@ -70,7 +67,6 @@ ex:list1 sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:notAList ; - sh:resultMessage "Value is a malformed SHACL List. ex:notAList is missing rdf:first and rdf:rest properties." ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:UniqueMembersConstraintComponent ; sh:sourceShape ex:ListShape ; diff --git a/shacl12-test-suite/tests/core/property/maxListLength-001.ttl b/shacl12-test-suite/tests/core/property/maxListLength-001.ttl index 709e9e27..a9bebf95 100644 --- a/shacl12-test-suite/tests/core/property/maxListLength-001.ttl +++ b/shacl12-test-suite/tests/core/property/maxListLength-001.ttl @@ -63,7 +63,6 @@ _:b1 sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:person3 ; - sh:resultMessage "List has length 3, but maximum allowed length is 2." ; sh:resultPath ex:hobbies ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MaxListLengthConstraintComponent ; @@ -73,7 +72,6 @@ _:b1 sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:person4 ; - sh:resultMessage "Value is a malformed SHACL List. ex:notAList is missing rdf:first and rdf:rest properties." ; sh:resultPath ex:hobbies ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MaxListLengthConstraintComponent ; diff --git a/shacl12-test-suite/tests/core/property/memberShape-001.ttl b/shacl12-test-suite/tests/core/property/memberShape-001.ttl index 40bc2c7b..223420fb 100644 --- a/shacl12-test-suite/tests/core/property/memberShape-001.ttl +++ b/shacl12-test-suite/tests/core/property/memberShape-001.ttl @@ -68,7 +68,6 @@ _:b1 sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:list2 ; - sh:resultMessage "Value does not conform to Shape ex:TestShape. See details for more information." ; sh:resultPath ex:testProperty ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; @@ -77,7 +76,6 @@ _:b1 sh:detail [ rdf:type sh:ValidationResult ; sh:focusNode _:bc ; - sh:resultMessage "Value is not of Node Kind sh:IRI" ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; sh:sourceShape ex:IRIShape ; diff --git a/shacl12-test-suite/tests/core/property/minListLength-001.ttl b/shacl12-test-suite/tests/core/property/minListLength-001.ttl index 2a7c91ac..8e771917 100644 --- a/shacl12-test-suite/tests/core/property/minListLength-001.ttl +++ b/shacl12-test-suite/tests/core/property/minListLength-001.ttl @@ -54,7 +54,6 @@ ex:person3 sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:person2 ; - sh:resultMessage "List has length 0, but minimum required length is 1." ; sh:resultPath ex:skills ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MinListLengthConstraintComponent ; @@ -64,7 +63,6 @@ ex:person3 sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:person3 ; - sh:resultMessage "Value is a malformed SHACL List. ex:notAList is missing rdf:first and rdf:rest properties." ; sh:resultPath ex:skills ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MinListLengthConstraintComponent ; diff --git a/shacl12-test-suite/tests/core/property/uniqueMembers-001.ttl b/shacl12-test-suite/tests/core/property/uniqueMembers-001.ttl index aadc19d0..d1e58e29 100644 --- a/shacl12-test-suite/tests/core/property/uniqueMembers-001.ttl +++ b/shacl12-test-suite/tests/core/property/uniqueMembers-001.ttl @@ -63,7 +63,6 @@ _:b1 sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:person3 ; - sh:resultMessage "Value does not conform to Shape ex:PersonShape. See details for more information." ; sh:resultPath ex:preferences ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:UniqueMembersConstraintComponent ; @@ -72,7 +71,6 @@ _:b1 sh:detail [ rdf:type sh:ValidationResult ; sh:focusNode ex:person3 ; - sh:resultMessage "List is required to have unique elements. Two occurences of '\"coffee\"' found." ; sh:resultPath ex:preferences ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:UniqueMembersConstraintComponent ; @@ -81,7 +79,6 @@ _:b1 ], [ rdf:type sh:ValidationResult ; sh:focusNode ex:person3 ; - sh:resultMessage "List is required to have unique elements. Three occurences of '\"tea\"' found." ; sh:resultPath ex:preferences ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:UniqueMembersConstraintComponent ; @@ -92,7 +89,6 @@ _:b1 sh:result [ rdf:type sh:ValidationResult ; sh:focusNode ex:person4 ; - sh:resultMessage "Value is a malformed SHACL List. ex:notAList is missing rdf:first and rdf:rest properties." ; sh:resultPath ex:preferences ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:UniqueMembersConstraintComponent ; From 99ca14f632dba3ca9f623d708864dd8071f375b3 Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Mon, 30 Jun 2025 15:02:45 +0100 Subject: [PATCH 49/53] chore: make sourceShape a property shape where applicable --- .../tests/core/property/maxListLength-001.ttl | 15 ++++++++------ .../tests/core/property/memberShape-001.ttl | 2 +- .../tests/core/property/minListLength-001.ttl | 10 ++++++++-- .../tests/core/property/uniqueMembers-001.ttl | 20 +++++++++++-------- 4 files changed, 30 insertions(+), 17 deletions(-) diff --git a/shacl12-test-suite/tests/core/property/maxListLength-001.ttl b/shacl12-test-suite/tests/core/property/maxListLength-001.ttl index a9bebf95..6b98001b 100644 --- a/shacl12-test-suite/tests/core/property/maxListLength-001.ttl +++ b/shacl12-test-suite/tests/core/property/maxListLength-001.ttl @@ -11,10 +11,13 @@ ex:PersonShape rdf:type sh:NodeShape ; sh:targetClass ex:Person ; - sh:property [ - sh:path ex:hobbies ; - sh:maxListLength 2 ; - ] ; + sh:property ex:PersonShape-hobbies ; +. + +ex:PersonShape-hobbies + rdf:type sh:PropertyShape ; + sh:path ex:hobbies ; + sh:maxListLength 2 ; . # Satisfies all constraints @@ -66,7 +69,7 @@ _:b1 sh:resultPath ex:hobbies ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MaxListLengthConstraintComponent ; - sh:sourceShape ex:PersonShape ; + sh:sourceShape ex:PersonShape-hobbies ; sh:value _:b1 ; ] ; sh:result [ @@ -75,7 +78,7 @@ _:b1 sh:resultPath ex:hobbies ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MaxListLengthConstraintComponent ; - sh:sourceShape ex:PersonShape ; + sh:sourceShape ex:PersonShape-hobbies ; sh:value ex:notAList ; ] ; ] ; diff --git a/shacl12-test-suite/tests/core/property/memberShape-001.ttl b/shacl12-test-suite/tests/core/property/memberShape-001.ttl index 223420fb..f525f1ec 100644 --- a/shacl12-test-suite/tests/core/property/memberShape-001.ttl +++ b/shacl12-test-suite/tests/core/property/memberShape-001.ttl @@ -71,7 +71,7 @@ _:b1 sh:resultPath ex:testProperty ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; - sh:sourceShape ex:TestShape ; + sh:sourceShape ex:TestShape-testProperty ; sh:value _:b1 ; sh:detail [ rdf:type sh:ValidationResult ; diff --git a/shacl12-test-suite/tests/core/property/minListLength-001.ttl b/shacl12-test-suite/tests/core/property/minListLength-001.ttl index 8e771917..ebe5bf8a 100644 --- a/shacl12-test-suite/tests/core/property/minListLength-001.ttl +++ b/shacl12-test-suite/tests/core/property/minListLength-001.ttl @@ -17,6 +17,12 @@ ex:PersonShape ] ; . +ex:PersonShape-skills + rdf:type sh:PropertyShape ; + sh:path ex:skills ; + sh:minListLength 1 ; +. + # Satisfies all constraints ex:person1 rdf:type ex:Person ; @@ -57,7 +63,7 @@ ex:person3 sh:resultPath ex:skills ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MinListLengthConstraintComponent ; - sh:sourceShape ex:PersonShape ; + sh:sourceShape ex:PersonShape-skills ; sh:value rdf:nil ; ] ; sh:result [ @@ -66,7 +72,7 @@ ex:person3 sh:resultPath ex:skills ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MinListLengthConstraintComponent ; - sh:sourceShape ex:PersonShape ; + sh:sourceShape ex:PersonShape-skills ; sh:value ex:notAList ; ] ; ] ; diff --git a/shacl12-test-suite/tests/core/property/uniqueMembers-001.ttl b/shacl12-test-suite/tests/core/property/uniqueMembers-001.ttl index d1e58e29..2f77226a 100644 --- a/shacl12-test-suite/tests/core/property/uniqueMembers-001.ttl +++ b/shacl12-test-suite/tests/core/property/uniqueMembers-001.ttl @@ -11,10 +11,14 @@ ex:PersonShape rdf:type sh:NodeShape ; sh:targetClass ex:Person ; - sh:property [ - sh:path ex:preferences ; - sh:uniqueMembers true ; - ] ; + sh:property ex:PersonShape-preferences + ; +. + +ex:PersonShape-preferences + rdf:type sh:PropertyShape ; + sh:path ex:preferences ; + sh:uniqueMembers true ; . # Satisfies all constraints @@ -66,7 +70,7 @@ _:b1 sh:resultPath ex:preferences ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:UniqueMembersConstraintComponent ; - sh:sourceShape ex:PersonShape ; + sh:sourceShape ex:PersonShape-preferences ; sh:value _:b1 ; sh:detail [ rdf:type sh:ValidationResult ; @@ -74,7 +78,7 @@ _:b1 sh:resultPath ex:preferences ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:UniqueMembersConstraintComponent ; - sh:sourceShape ex:PersonShape ; + sh:sourceShape ex:PersonShape-preferences ; sh:value "coffee" ; ], [ rdf:type sh:ValidationResult ; @@ -82,7 +86,7 @@ _:b1 sh:resultPath ex:preferences ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:UniqueMembersConstraintComponent ; - sh:sourceShape ex:PersonShape ; + sh:sourceShape ex:PersonShape-preferences ; sh:value "tea" ; ] ] ; @@ -92,7 +96,7 @@ _:b1 sh:resultPath ex:preferences ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:UniqueMembersConstraintComponent ; - sh:sourceShape ex:PersonShape ; + sh:sourceShape ex:PersonShape-preferences ; sh:value ex:notAList ; ] ; ] ; From 9195eca481fc853502c4239cee5c2d7711304932 Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Thu, 3 Jul 2025 18:19:12 +0200 Subject: [PATCH 50/53] chore: remove lingering `uniqList` references --- shacl12-vocabularies/shacl-shacl.ttl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shacl12-vocabularies/shacl-shacl.ttl b/shacl12-vocabularies/shacl-shacl.ttl index 67871c82..0c808319 100644 --- a/shacl12-vocabularies/shacl-shacl.ttl +++ b/shacl12-vocabularies/shacl-shacl.ttl @@ -75,7 +75,7 @@ shsh:ShapeShape sh:maxInclusive, sh:maxLength, sh:memberShape, sh:minCount, sh:minExclusive, sh:minInclusive, sh:minLength, sh:node, sh:nodeKind, sh:not, sh:or, sh:pattern, sh:property, sh:qualifiedMaxCount, sh:qualifiedMinCount, sh:qualifiedValueShape, sh:qualifiedValueShape, sh:qualifiedValueShapesDisjoint, sh:qualifiedValueShapesDisjoint, sh:uniqueLang, sh:xone , - sh:minListLength, sh:maxListLength, sh:uniqList ; + sh:minListLength, sh:maxListLength, sh:uniqueMembers ; sh:targetObjectsOf sh:memberShape ; # memberShape-node sh:targetObjectsOf sh:node ; # node-node @@ -243,8 +243,8 @@ shsh:ShapeShape ] ; sh:property [ sh:path sh:uniqueMembers ; - sh:datatype xsd:boolean ; # uniqList-datatype - sh:maxCount 1 ; # uniqList-maxCount + sh:datatype xsd:boolean ; # uniqueMembers-datatype + sh:maxCount 1 ; # uniqueMembers-maxCount ] ; sh:property [ sh:path sh:nodeKind ; From 58daff683e4d0c3c200018051082235fac217154 Mon Sep 17 00:00:00 2001 From: Holger Knublauch Date: Mon, 7 Jul 2025 11:17:54 +0300 Subject: [PATCH 51/53] Fixed membershape test case --- shacl12-test-suite/tests/core/node/memberShape-001.ttl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shacl12-test-suite/tests/core/node/memberShape-001.ttl b/shacl12-test-suite/tests/core/node/memberShape-001.ttl index 9dde67e2..bb251f2b 100644 --- a/shacl12-test-suite/tests/core/node/memberShape-001.ttl +++ b/shacl12-test-suite/tests/core/node/memberShape-001.ttl @@ -96,6 +96,7 @@ ex:list10 sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; sh:sourceShape ex:IRIListShape ; + sh:value ex:list2 ; sh:detail [ rdf:type sh:ValidationResult ; sh:focusNode "Bob" ; @@ -127,6 +128,7 @@ ex:list10 sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; sh:sourceShape ex:IRIListShape ; + sh:value ex:list5 ; sh:detail [ rdf:type sh:ValidationResult ; sh:focusNode "Charlie" ; @@ -157,7 +159,7 @@ ex:list10 sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; sh:sourceShape ex:IRIListShape ; - sh:value ex:list8 ; + sh:value ex:list7 ; ] ; sh:result [ rdf:type sh:ValidationResult ; @@ -165,7 +167,7 @@ ex:list10 sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; sh:sourceShape ex:IRIListShape ; - sh:value ex:list10 ; + sh:value ex:list9 ; ] ; ] ; mf:status sht:approved ; From e01a2a6d320296f74bd22d80d2895b80bef7cf28 Mon Sep 17 00:00:00 2001 From: Holger Knublauch Date: Mon, 7 Jul 2025 11:19:45 +0300 Subject: [PATCH 52/53] Fixed missing sh:value at minListLength test --- shacl12-test-suite/tests/core/node/minListLength-001.ttl | 1 + 1 file changed, 1 insertion(+) diff --git a/shacl12-test-suite/tests/core/node/minListLength-001.ttl b/shacl12-test-suite/tests/core/node/minListLength-001.ttl index 118a7ec0..5b38bf2f 100644 --- a/shacl12-test-suite/tests/core/node/minListLength-001.ttl +++ b/shacl12-test-suite/tests/core/node/minListLength-001.ttl @@ -44,6 +44,7 @@ ex:list0 sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MinListLengthConstraintComponent ; sh:sourceShape ex:ListShape ; + sh:value rdf:nil ; ] ; sh:result [ rdf:type sh:ValidationResult ; From 77f8392eb6c135a62d921e69e627180796115885 Mon Sep 17 00:00:00 2001 From: Holger Knublauch Date: Mon, 7 Jul 2025 11:40:37 +0300 Subject: [PATCH 53/53] Fixed missing sh:value at uniqueMembers test case --- shacl12-test-suite/tests/core/node/uniqueMembers-001.ttl | 1 + 1 file changed, 1 insertion(+) diff --git a/shacl12-test-suite/tests/core/node/uniqueMembers-001.ttl b/shacl12-test-suite/tests/core/node/uniqueMembers-001.ttl index 287e9137..bc2790dc 100644 --- a/shacl12-test-suite/tests/core/node/uniqueMembers-001.ttl +++ b/shacl12-test-suite/tests/core/node/uniqueMembers-001.ttl @@ -48,6 +48,7 @@ ex:list1 sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:UniqueMembersConstraintComponent ; sh:sourceShape ex:ListShape ; + sh:value ex:list1 ; sh:detail [ rdf:type sh:ValidationResult ; sh:focusNode ex:list1 ;