Skip to content
Draft
Changes from 9 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
91 changes: 52 additions & 39 deletions shacl12-rules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -585,35 +585,35 @@ <h2>Concrete Syntax forms for Shapes Rules</h2>
PREFIX sparql: &lt;http://www.w3.org/ns/sparql#&gt;

:ruleSet-1
rdf:type srl:RuleSet;
srl:data (
rdf:type shrl:RuleSet;
shrl:data (
&lt;&lt;( :x :p 1 )&gt;&gt;
&lt;&lt;( :x :q 2 )&gt;&gt;
);
srl:ruleSet (
shrl:ruleSet (
[
rdf:type srl:Rule;
srl:head (
[ srl:subject [ srl:var "x" ] ; srl:predicate :bothPositive; srl:object true ]
)
srl:body (
[ srl:subject [ srl:var "x" ]; srl:predicate :p; srl:object [ srl:var "v1" ] ]
[ srl:expr [ sparql:greaterThan ( [ srl:var "v1" ] 0 ) ] ]
[ srl:subject [ srl:var "x" ] ; srl:predicate :q; srl:object [ srl:var "v2" ] ]
[ srl:expr [ sparql:greaterThan ( [ srl:var "v2" ] 0 ) ] ]
rdf:type shrl:Rule;
shrl:head (
[ shrl:subject [ shrl:var "x" ] ; shrl:predicate :bothPositive; shrl:object true ]
) ;
shrl:body (
[ shrl:subject [ shrl:var "x" ]; shrl:predicate :p; shrl:object [ shrl:var "v1" ] ]
[ shrl:expr [ sparql:greaterThan ( [ shrl:var "v1" ] 0 ) ] ]
[ shrl:subject [ shrl:var "x" ] ; shrl:predicate :q; shrl:object [ shrl:var "v2" ] ]
[ shrl:expr [ sparql:greaterThan ( [ shrl:var "v2" ] 0 ) ] ]
);
]
[
rdf:type srl:Rule;
srl:head (
[ srl:subject [ srl:var "x" ] ; srl:predicate :oneIsZero ; srl:object true ]
)
srl:body (
[ srl:subject [ srl:var "x" ] ; srl:predicate :p ; srl:object [ srl:var "v1" ] ]
[ srl:subject [ srl:var "x" ] ; srl:predicate :q ; srl:object [ srl:var "v2" ] ]
[ srl:expr [ sparql:function-or (
[ sparql:equals ( [ srl:var "v1" ] 0 ) ]
[ sparql:equals ( [ srl:var "v2" ] 0 ) ]
rdf:type shrl:Rule;
shrl:head (
[ shrl:subject [ shrl:var "x" ] ; shrl:predicate :oneIsZero ; shrl:object true ]
) ;
shrl:body (
[ shrl:subject [ shrl:var "x" ] ; shrl:predicate :p ; shrl:object [ shrl:var "v1" ] ]
[ shrl:subject [ shrl:var "x" ] ; shrl:predicate :q ; shrl:object [ shrl:var "v2" ] ]
[ shrl:expr [ sparql:function-or (
[ sparql:equals ( [ shrl:var "v1" ] 0 ) ]
[ sparql:equals ( [ shrl:var "v2" ] 0 ) ]
) ]
]
);
Expand Down Expand Up @@ -661,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 @@ -967,16 +964,17 @@ <h2>Attaching Rules to Shapes</h2>
<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 a special case of <a href="https://w3c.github.io/shacl/shacl-af/index.html#PropertyValueRule"> property value 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 top done because they have separate evaluation
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 - seea also defaul values)
and can infer if they generate infered triple.
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>
Expand All @@ -992,7 +990,7 @@ <h2>Parameterization</h2>
<p>@@ Discussion</p>
<p> Define a new rule that is another rule with some variables already set</p>
<ul>
<li>Where do the setting come from?</li>
<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>
Expand All @@ -1003,7 +1001,7 @@ <h2>Parameterization</h2>
<h2>More on evaluation</h2>
<div class="ednote">
<p>@@ Discussion</p>
<p>The main evaluatiuon description creates all inferred triple using
<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>

Expand All @@ -1014,10 +1012,10 @@ <h2>More on evaluation</h2>
<h2>Negation as semi-positive datalog</h2>
<div class="ednote">
<p>@@ Discussion</p>
<p>Negation (e.g. via SPARQL `NOT EXISTS`/`EXISTS`) can allowed if
the pattern is executed only one the base data graph, not including the
inferred graph. i.e. inferred triples are not seen.
Or stratification - not seeing inferred tripels from the current stratum.
<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>
Expand All @@ -1028,12 +1026,27 @@ <h2>Assignment restrictions</h3>
<div class="ednote">
<p>@@ Discussion</p>
<p>
Assignment takes the rule lanuage 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).
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>

Expand Down