Skip to content

#338: Generalized sh:deactivated to node expressions #372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions shacl12-core/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1956,13 +1956,21 @@ <h4>Declaring Messages for a Shape</h4>
<h4>Deactivating a Shape</h4>
<p class="syntax">
<span data-syntax-rule="deactivated-maxCount">Shapes can have at most one value for the property <code>sh:deactivated</code>.</span>
<span data-syntax-rule="deactivated-datatype">The value of <code>sh:deactivated</code> in a shape must be either <code>true</code> or <code>false</code>.</span>
<span data-syntax-rule="deactivated-datatype">The value of <code>sh:deactivated</code> in a shape is a <a>node expression</a>
that must have either <code>true</code> or <code>false</code> as the (only) <a>output node</a>.</span>
</p>
<p>
A shape that has the <a>value</a> <code>true</code> for the property <code>sh:deactivated</code> is called <dfn data-lt="deactivate">deactivated</dfn>.
Let <code>expr</code> be the <a>value</a> of <code>sh:deactivated</code> in a <a>shape</a>.
If <code>evalExpr(expr, <a>data graph</a>, <a>focus node</a>, {})</code> produces <code>true</code> as its only
<a>output node</a>, the shape is called <dfn data-lt="deactivate">deactivated</dfn>.
All RDF terms <a>conform</a> to a deactivated shape.
</p>
<p><em>The remainder of this section is informative.</em></p>
<p>
In SHACL Core, the only valid values for <code>sh:deactivated</code> are the
<a href="#LiteralExpression">constant literal node expressions</a>
<code>true</code> and <code>false</code>.
</p>
<p>
Use cases of this feature include shape reuse and debugging.
In scenarios where shapes from other graphs or files are imported into a given <a>shapes graph</a>,
Expand Down Expand Up @@ -2391,7 +2399,7 @@ <h2>Node Expressions</h2>
<li>At <a href="#property-shapes"><code>sh:values</code> and <code>sh:defaultValue</code></a> to derive the value nodes of a property shape.</li>
<li>At <a href="#targetNode"><code>sh:targetNode</code></a> to dynamically compute the targets of a shape.</li>
<li>At <a href="#ExpressionConstraintComponent"><code>sh:expression</code></a> to validate nodes against a condition.</li>
<li>At <a href="#deactivated"><code>sh:deactivated</code></a> to deactivate certain shapes under specific conditions. <span class="todo">TODO: This change needs to be made still, see ISSUE 338.</span></li>
<li>At <a href="#deactivated"><code>sh:deactivated</code></a> to deactivate certain shapes under specific conditions.</li>
</ul>
<p>
Readers who are only interested in SHACL Core can typically skip this section.
Expand Down Expand Up @@ -6578,7 +6586,7 @@ <h2>Revision History</h2>
<section class="appendix informative" id="changes-12">
<h2>Changes between SHACL 1.0 Core and SHACL 1.2 Core</h2>
<ul>
<li>Introduced <a>node expressions</a> as an extension point to dynamically compute lists of nodes. Generalized <code>sh:targetNode</code> and <code>sh:defaultValue</code>, and introduced <code>sh:values</code> to support node expressions.</li>
<li>Introduced <a>node expressions</a> as an extension point to dynamically compute lists of nodes. Generalized <code>sh:targetNode</code>, <code>sh:deactivated</code> and <code>sh:defaultValue</code>, and introduced <code>sh:values</code> to support node expressions.</li>
<li>Added the new constraint component <a href="#SingleLineConstraintComponent"><code>sh:singleLine</code></a>, see <a href="https://github.com/w3c/data-shapes/issues/177">Issue 177</a></li>
<li>Added the new class <a href="#ShapeClass"><code>sh:ShapeClass</code></a> for implicit class targets, see <a href="https://github.com/w3c/data-shapes/issues/212">Issue 212</a></li>
<li>Moved SPARQL-based validators from Core to an Appendix of SHACL-SPARQL, see <a href="https://github.com/w3c/data-shapes/issues/271">Issue 271</a></li>
Expand Down
2 changes: 1 addition & 1 deletion shacl12-vocabularies/shacl.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ sh:deactivated
rdfs:label "deactivated"@en ;
rdfs:comment "If set to true then all nodes conform to this."@en ;
# rdfs:domain sh:Shape or sh:SPARQLConstraint
rdfs:range xsd:boolean ;
# rdfs:range xsd:boolean (node expression)
rdfs:isDefinedBy sh: .

sh:targetClass
Expand Down