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
Informally, if a <a>shape</a> is also declared to be a <a>class</a> in the <a>shapes graph</a> then
1128
1128
all <a>SHACL instances</a> of this class are a target for the shape.
@@ -1138,6 +1138,19 @@ <h4>Implicit Class Targets</h4>
1138
1138
in a <a>shapes graph</a><code>SG</code> and <code>s</code> is also a <a>SHACL instance</a> of <code>rdfs:Class</code>
1139
1139
in <code>SG</code> then the set of <a>SHACL instances</a> of <code>s</code> in a data graph <code>DG</code> is a <a>target</a> from <code>DG</code> for <code>s</code> in <code>SG</code>.
1140
1140
</div>
1141
+
<pid="ShapeClass">
1142
+
The SHACL namespace includes a dedicated class <code>sh:ShapeClass</code> that can serve as a syntactic shortcut for the implicit class targets pattern.
1143
+
</p>
1144
+
<divclass="def">
1145
+
<divclass="def-header">TEXTUAL DEFINITION</div>
1146
+
The class <code>sh:ShapeClass</code> is an <code>rdfs:subClassOf</code> of both <code>sh:NodeShape</code> and <code>rdfs:Class</code>.
1147
+
If <code>s</code> is a <a>SHACL instance</a> of <code>sh:ShapeClass</code> in a <a>shapes graph</a><code>SG</code>
1148
+
then the set of <a>SHACL instances</a> of <code>s</code> in a data graph <code>DG</code> is a <a>target</a> from <code>DG</code> for <code>s</code> in <code>SG</code>.
1149
+
</div>
1150
+
<p>
1151
+
Please keep in mind that <code>sh:ShapeClass</code> may not be understood to be a subclass of <code>rdfs:Class</code> by some SHACL-unaware implementations.
1152
+
It is therefore recommended (but not required) that graphs that use <code>sh:ShapeClass</code> include an <code>owl:imports sh:</code> statement.
1153
+
</p>
1141
1154
<p><em>The remainder of this section is informative.</em></p>
1142
1155
<p>
1143
1156
In the following example, <code>ex:Alice</code> is a focus node, because it is a <a>SHACL instance</a> of
@@ -1157,6 +1170,18 @@ <h4>Implicit Class Targets</h4>
1157
1170
</div>
1158
1171
</div>
1159
1172
</aside>
1173
+
<p>
1174
+
In the following variation of the example above, <code>ex:Person</code> is declared as an instance of <code>sh:ShapeClass</code>,
1175
+
with the same interpretation.
1176
+
</p>
1177
+
<asideclass="example">
1178
+
<divclass="shapes-graph">
1179
+
<divclass="turtle">
1180
+
ex:Person
1181
+
<b>a sh:ShapeClass</b> .</pre>
1182
+
</div>
1183
+
</div>
1184
+
</aside>
1160
1185
</section>
1161
1186
1162
1187
<sectionid="targetSubjectsOf">
@@ -4305,7 +4330,7 @@ <h2>Acknowledgements</h2>
4305
4330
<sectionclass="appendix informative">
4306
4331
<h2>Revision History</h2>
4307
4332
<p>
4308
-
The detailed list of changes and their diffs can be found in the Git repository.
4333
+
The detailed list of changes and their diffs can be found in the <ahref="https://github.com/w3c/data-shapes">Git repository</a>.
4309
4334
</p>
4310
4335
<ul>
4311
4336
<li><b>2024-02-14</b>: New work started by cloning the main SHACL spec and splitting it into SHACL Core and SHACL-SPARQL</li>
@@ -4317,9 +4342,10 @@ <h2>Changes between SHACL 1.0 Core and SHACL 1.2 Core</h2>
4317
4342
<ul>
4318
4343
<li>Introduced <a>node expressions</a> as an extension point to dynamically compute lists of nodes. Generalized <code>sh:targetNode</code> and <code>sh:path</code> to support node expressions.</li>
4319
4344
<li>Added the new constraint component <ahref="#SingleLineConstraintComponent"><code>sh:singleLine</code></a>, see <ahref="https://github.com/w3c/data-shapes/issues/177">Issue 177</a></li>
4345
+
<li>Added the new class <ahref="#ShapeClass"><code>sh:ShapeClass</code></a> for implicit class targets, see <ahref="https://github.com/w3c/data-shapes/issues/212">Issue 212</a></li>
4320
4346
<li>Moved SPARQL-based validators from Core to an Appendix of SHACL-SPARQL, see <ahref="https://github.com/w3c/data-shapes/issues/271">Issue 271</a></li>
Copy file name to clipboardExpand all lines: shacl12-vocabularies/shacl.ttl
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,14 @@ sh:PropertyShape
58
58
rdfs:subClassOf sh:Shape ;
59
59
rdfs:isDefinedBy sh: .
60
60
61
+
sh:ShapeClass
62
+
a rdfs:Class ;
63
+
rdfs:comment "A shape class is a class that is also a node shape. sh:ShapeClass can be used as rdf:type instead of the combination of rdfs:Class and sh:NodeShape."@en ;
0 commit comments