You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let <code>$memberShape</code> be a <a>parameter value</a> for <code>sh:memberShape</code>.
4568
4568
Each <a>value node</a><code>v</code> must be a <ahref="#syntax-rule-SHACL-list">SHACL list</a> - if <code>v</code> is not a SHACL list there is a <a>validation result</a>.
4569
-
If any member of <code>m</code> of the list <code>v</code> does not <a>conform</a> to <code>$memberShape</code>, there is a <a>validation result</a>. There must be at most one <a>validation result</a> for each list <code>v</code>.
4569
+
If any member <code>m</code> of the list <code>v</code> does not <a>conform</a> to <code>$memberShape</code>, there is a <a>validation result</a>. There must be at most one <a>validation result</a> for each list <code>v</code>.
4570
4570
</div>
4571
4571
</div>
4572
4572
<p><em>The remainder of this section is informative.</em></p>
@@ -4577,6 +4577,9 @@ <h4>sh:memberShape</h4>
4577
4577
<p>
4578
4578
Examples of how to generate <code>sh:detail</code>s in validation results can be found in the test cases for <code>sh:memberShape</code> in the SHACL test suite: <ahref="../shacl12-test-suite/tests/core/node/memberShape-001.ttl">memberShape-001.ttl</a>.
4579
4579
</p>
4580
+
<p>
4581
+
In the following example, all values of the property <code>ex:speakerOrder</code> must be SHACL lists with members that are IRIs.
4582
+
</p>
4580
4583
<asideclass="example">
4581
4584
<divclass="shapes-graph">
4582
4585
<divclass="turtle">
@@ -4588,18 +4591,13 @@ <h4>sh:memberShape</h4>
4588
4591
sh:memberShape [
4589
4592
sh:nodeKind sh:IRI ;
4590
4593
] ;
4591
-
sh:maxCount 1 ;
4592
4594
] .
4593
4595
</div>
4594
4596
<divclass="jsonld">
4595
4597
<preclass="jsonld">{
4596
4598
"@id": "ex:AgendaShape",
4597
4599
"@type": "sh:NodeShape",
4598
4600
"sh:property": {
4599
-
"sh:maxCount": {
4600
-
"@type": "xsd:integer",
4601
-
"@value": "1"
4602
-
},
4603
4601
"sh:memberShape": {
4604
4602
"sh:nodeKind": {
4605
4603
"@id": "sh:IRI"
@@ -4659,48 +4657,6 @@ <h4>sh:memberShape</h4>
4659
4657
}
4660
4658
}
4661
4659
]
4662
-
}</pre>
4663
-
</div>
4664
-
</div>
4665
-
<divclass="validation-report">
4666
-
<divclass="turtle">
4667
-
[] a sh:ValidationReport ;
4668
-
sh:conforms false ;
4669
-
sh:result [
4670
-
a sh:ValidationResult ;
4671
-
sh:focusNode ex:agenda2 ;
4672
-
sh:resultMessage "List member does not have the required node kind sh:IRI." ;
"sh:resultMessage": "List member does not have the required node kind sh:IRI.",
4690
-
"sh:resultPath": {
4691
-
"@id": "ex:speakerOrder"
4692
-
},
4693
-
"sh:resultSeverity": {
4694
-
"@id": "sh:Violation"
4695
-
},
4696
-
"sh:sourceConstraintComponent": {
4697
-
"@id": "sh:MemberShapeConstraintComponent"
4698
-
},
4699
-
"sh:sourceShape": {
4700
-
"@id": "ex:AgendaShape"
4701
-
},
4702
-
"sh:value": "Charlie"
4703
-
}
4704
4660
}</pre>
4705
4661
</div>
4706
4662
</div>
@@ -4740,6 +4696,74 @@ <h4>sh:minListLength</h4>
4740
4696
there is a <a>validation result</a>.
4741
4697
</div>
4742
4698
</div>
4699
+
<p><em>The remainder of this section is informative.</em></p>
4700
+
<p>
4701
+
In the following example, all values of the property <code>ex:skills</code> must be SHACL lists with at least 1 member.
4702
+
Additional test cases for <code>sh:minListLength</code> can be found in the SHACL test suite: <ahref="../shacl12-test-suite/tests/core/node/minListLength-001.ttl">minListLength-001.ttl</a>.
<spanclass="focus-node-error">ex:person2</span> a ex:Person ;
4740
+
ex:skills () .
4741
+
</div>
4742
+
<divclass="jsonld">
4743
+
<preclass="jsonld">{
4744
+
"@graph": [
4745
+
{
4746
+
"@id": "ex:person1",
4747
+
"@type": "ex:Person",
4748
+
"ex:skills": {
4749
+
"@list": [
4750
+
"programming",
4751
+
"design"
4752
+
]
4753
+
}
4754
+
},
4755
+
{
4756
+
"@id": "ex:person2",
4757
+
"@type": "ex:Person",
4758
+
"ex:skills": {
4759
+
"@list": []
4760
+
}
4761
+
}
4762
+
]
4763
+
}</pre>
4764
+
</div>
4765
+
</div>
4766
+
</aside>
4743
4767
</section>
4744
4768
4745
4769
<sectionid="MaxListLengthConstraintComponent">
@@ -4775,6 +4799,78 @@ <h4>sh:maxListLength</h4>
4775
4799
there is a <a>validation result</a>.
4776
4800
</div>
4777
4801
</div>
4802
+
<p><em>The remainder of this section is informative.</em></p>
4803
+
<p>
4804
+
In the following example, all values of the property <code>ex:hobbies</code> must be SHACL lists with at most 2 members.
4805
+
Additional test cases for <code>sh:maxListLength</code> can be found in the SHACL test suite: <ahref="../shacl12-test-suite/tests/core/node/maxListLength-001.ttl">maxListLength-001.ttl</a>.
<spanclass="focus-node-error">ex:person2</span> a ex:Person ;
4843
+
ex:hobbies ( "reading" "writing" "swimming" ) .
4844
+
</div>
4845
+
<divclass="jsonld">
4846
+
<preclass="jsonld">{
4847
+
"@graph": [
4848
+
{
4849
+
"@id": "ex:person1",
4850
+
"@type": "ex:Person",
4851
+
"ex:hobbies": {
4852
+
"@list": [
4853
+
"reading",
4854
+
"writing"
4855
+
]
4856
+
}
4857
+
},
4858
+
{
4859
+
"@id": "ex:person2",
4860
+
"@type": "ex:Person",
4861
+
"ex:hobbies": {
4862
+
"@list": [
4863
+
"reading",
4864
+
"writing",
4865
+
"swimming"
4866
+
]
4867
+
}
4868
+
}
4869
+
]
4870
+
}</pre>
4871
+
</div>
4872
+
</div>
4873
+
</aside>
4778
4874
</section>
4779
4875
4780
4876
<sectionid="UniqueMembersConstraintComponent">
@@ -4811,11 +4907,83 @@ <h4>sh:uniqueMembers</h4>
4811
4907
</div>
4812
4908
<p><em>The remainder of this section is informative.</em></p>
4813
4909
<p>
4814
-
Each duplicate member of a list <code>v</code> should be reported as a separate <code>sh:detail</code> in the <a>validation result</a> for <code>v</code>. If the list <code>v</code> is not a valid <ahref="#syntax-rule-SHACL-list">SHACL list</a>, this should also be reported as a <code>sh:detail</code> in the <a>validation result</a> for <code>v</code>.
4910
+
Each duplicate member <code>m</code>of a list <code>v</code> should be reported as a separate <code>sh:detail</code> in the <a>validation result</a> for <code>v</code>. If the list <code>v</code> is not a valid <ahref="#syntax-rule-SHACL-list">SHACL list</a>, this should also be reported as a <code>sh:detail</code> in the <a>validation result</a> for <code>v</code>.
4815
4911
</p>
4816
4912
<p>
4817
4913
Examples of how to generate <code>sh:detail</code>s in validation results can be found in the test cases for <code>sh:uniqueMembers</code> in the SHACL test suite: <ahref="../shacl12-test-suite/tests/core/node/uniqueMembers-001.ttl">uniqueMembers-001.ttl</a>.
4818
4914
</p>
4915
+
<p>
4916
+
In the following example, all values of the property <code>ex:preferences</code> must be SHACL lists with members that have unique values within each SHACL list.
0 commit comments