Skip to content
Draft
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
119 changes: 114 additions & 5 deletions shacl12-rules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -173,18 +173,32 @@ <h3>Document Conventions</h3>
<tr>
<th>Prefix</th>
<th>Namespace</th>
<th>Informal Name</th>
</tr>
<tr>
<td><code>rdf:</code></td>
<td><code>http://www.w3.org/1999/02/22-rdf-syntax-ns#</code></td>
<td>RDF</td>
</tr>
<tr>
<td><code>rdfs:</code></td>
<td><code>http://www.w3.org/2000/01/rdf-schema#</code></td>
<td>RDFS</td>
</tr>
<tr>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be moved below, after “sh”. Also, “srl” should be corrected to “shrl”. I like the additional “Informal name” column. However, from Andy’s latest comment in the Conversation tab, I understand that this PR is not intended to be merged into gh-pages, so we should copy these changes into a new branch/PR.

<td><code>srl:</code></td>
<td><code>http://www.w3.org/ns/shacl-rules#</code></td>
<td>SHACL Rules</td>
</tr>
<tr>
<td><code>shnex:</code></td>
<td><code>http://www.w3.org/ns/shnex#</code></td>
<td>SHACL Node Expressions</td>
</tr>
<tr>
<td><code>sh:</code></td>
<td><code>http://www.w3.org/ns/shacl#</code></td>
<td>SHACL</td>
</tr>
<tr>
<td><code>shrl:</code></td>
Copy link

@liviorobaldo liviorobaldo Dec 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<td><code>shrl:</code></td>
<td><code>http://www.w3.org/ns/shacl-rules#</code></td>
<td>SHACL Rules</td>
</tr>
<tr>
<td><code>shnex:</code></td>
<td><code>http://www.w3.org/ns/shnex#</code></td>
<td>SHACL Node Expressions</td>
</tr>

Expand All @@ -197,10 +211,12 @@ <h3>Document Conventions</h3>
<tr>
<td><code>xsd:</code></td>
<td><code>http://www.w3.org/2001/XMLSchema#</code></td>
<td>XML Schema</td>
</tr>
<tr>
<td><code>ex:</code></td>
<td><code>http://example.com/</code></td>
<td><code>http://example.com/ns#</code></td>
<td>Example</td>
</tr>
</table>
<p>
Expand Down Expand Up @@ -563,6 +579,7 @@ <h2>Concrete Syntax forms for Shapes Rules</h2>
<pre class="example-rules">
PREFIX : &lt;http://example/&gt;
PREFIX rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt;
PREFIX shr &lt;http://www.w3.org/ns/shacl-rules#&gt;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so is this now shr or slr?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like it's actually shrl for now!

PREFIX sh: &lt;http://www.w3.org/ns/shacl#&gt;
PREFIX shrl: &lt;http://www.w3.org/ns/shacl-rules#&gt;
PREFIX sparql: &lt;http://www.w3.org/ns/sparql#&gt;
Expand Down Expand Up @@ -644,10 +661,7 @@ <h3>RDF Rules Syntax</h3>
</ul>
</div>
<div class="ednote">
<p>Describe how the abstract model maps to triples??.
way round - copes with extra triples.
Output is the instance of the abtract model that generates the triples -
but need to define "maximal".
<p>Alternative: Describe how the abstract model maps to triples.
</p>
</div>

Expand Down Expand Up @@ -941,6 +955,101 @@ <h4>Evaluation of a Rule Set</h4>
</section>
</section>

<section id="drafting">
<h2>Drafting Notes</h2>
<section id="attach-shape-rule">
<h2>Attaching Rules to Shapes</h2>
<div class="ednote">
<p>@@ Discussion</p>
<p>
See SHACL AF <a href="https://www.w3.org/TR/shacl-af/#rules-syntax">`sh:rule`</a>,
which describes <a href="https://w3c.github.io/shacl/shacl-af/index.html#TripleRule">triple rules</a>,
with special cases
of <a href="https://w3c.github.io/shacl/shacl-af/index.html#PropertyValueRule"> property value rules</a>
and <a href="https://www.w3.org/TR/shacl-af/#SPARQLRule">SPARQL Rules</a> (AKA "CONSTRUCT rules").
</p>
<p><a href="https://github.com/w3c/data-shapes/issues/517">Core issue 517 : classification shapes</a></p>
<p>
How much compatibility?
At one level, nothing needs to be done because they have separate evaluation
and it is only a matter of whether an engine supports them or not.
It might be helpful to say when they happen (before 1.2 Rules — see also default values)
and can infer whether they generate inferred triple.
</p>
<ul>
<li>Extends to `rdf:type srl:Rule`</li>
<li>Uses `sh:this` and `$this`
(see <a href="rule-parameterization">Rule Parameterization</a>)</li>
</ul>
</div>
</section>

<section id="rule-parameterization">
<h2>Parameterization</h2>
<div class="ednote">
<p>@@ Discussion</p>
<p> Define a new rule that is another rule with some variables already set</p>
<ul>
<li>Where do the settings come from?</li>
<li>Is is just one "row" or a data table?</li>
<li>Logically, some `BIND` steps at the start of the rule body</li>
</ul>
</div>
</section>

<section id="evaluation2">
<h2>More on evaluation</h2>
<div class="ednote">
<p>@@ Discussion</p>
<p>The main evaluation description creates all inferred triples using
the datalog "naive" algorithm.</p>
<p>Do we need to talk about backward evaluation and stratification?</p>

</div>
</section>

<section id="negation">
<h2>Negation as semi-positive datalog</h2>
<div class="ednote">
<p>@@ Discussion</p>
<p>Negation (e.g., via SPARQL `NOT EXISTS`/`EXISTS`) can be allowed if
the pattern is executed only on the base data graph, not including the
inferred graph, i.e., inferred triples are not seen.
Or stratification — not seeing inferred triples from the current stratum.
</p>
<p>Priority for this feature?</p>
</div>
</section>

<section id="other">
<h2>Assignment restrictions</h3>
<div class="ednote">
<p>@@ Discussion</p>
<p>
Assignment takes the rule language outside datalog.
Can we define when it is "safe" (e.g., triples involving the assignment
are not mentioned in the body of any other rule)?
</p>
<p>Do we need "order" in the syntax?</p>
</div>
</section>
<section id="tuples">
<h2>Work space named tuples</h3>
<div class="ednote">
<p>@@ Discussion</p>
<p>
Currently, SHACL Rules are, in datatlog-speak, only unnamed 3-tuples.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Currently, SHACL Rules are, in datatlog-speak, only unnamed 3-tuples.
Currently, SHACL Rules are, in datalog-speak, only unnamed 3-tuples.

To support "programming" in rules, should we allow transient (not part of the output,
only during rulset evaluation) named n-tuples? <br/>
e.g., <code>name(termOrVar, ...)</code>, possibly with a unique marker, e.g.,
<span class="codepoint" translate="no"><bdi lang="en">&#x0060;</bdi>
<code class="uname">U+0060 grave accent</code></span>
giving <code>`name(termOrVar, ...)</code>.
</p>
</div>
</section >
</section>

<section id="shapes-rules-grammar">
<h2>Shapes Rules Language Grammar</h2>

Expand Down