-
Notifications
You must be signed in to change notification settings - Fork 38
SHACL Rules - content planning #554
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
base: gh-pages
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -656,26 +656,42 @@ <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> | ||||||||||||||||||||||||||
<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>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/ns#</code></td> | ||||||||||||||||||||||||||
<td>Example</td> | ||||||||||||||||||||||||||
</tr> | ||||||||||||||||||||||||||
</table> | ||||||||||||||||||||||||||
<p> | ||||||||||||||||||||||||||
|
@@ -917,39 +933,40 @@ <h2>Concrete Syntax forms for Shapes Rules</h2> | |||||||||||||||||||||||||
<pre class="example-rules"> | ||||||||||||||||||||||||||
PREFIX : <http://example/> | ||||||||||||||||||||||||||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||||||||||||||||||||||||||
PREFIX shr <http://www.w3.org/ns/shacl-rules#> | ||||||||||||||||||||||||||
PREFIX sh: <http://www.w3.org/ns/shacl#> | ||||||||||||||||||||||||||
PREFIX sparql: <http://www.w3.org/ns/sparql#> | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
:ruleSet-1 | ||||||||||||||||||||||||||
rdf:type sh:RuleSet; | ||||||||||||||||||||||||||
sh:data ( | ||||||||||||||||||||||||||
rdf:type srl:RuleSet; | ||||||||||||||||||||||||||
srl:data ( | ||||||||||||||||||||||||||
<<( :x :p 1 )>> | ||||||||||||||||||||||||||
<<( :x :q 2 )>> | ||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||
sh:ruleSet ( | ||||||||||||||||||||||||||
srl:ruleSet ( | ||||||||||||||||||||||||||
[ | ||||||||||||||||||||||||||
rdf:type sh:Rule; | ||||||||||||||||||||||||||
sh:head ( | ||||||||||||||||||||||||||
[ sh:subject [ sh:var "x" ] ; sh:predicate :bothPositive; sh:object true ] | ||||||||||||||||||||||||||
rdf:type srl:Rule; | ||||||||||||||||||||||||||
srl:head ( | ||||||||||||||||||||||||||
[ srl:subject [ srl:var "x" ] ; srl:predicate :bothPositive; srl:object true ] | ||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||
sh:body ( | ||||||||||||||||||||||||||
[ sh:subject [ sh:var "x" ]; sh:predicate :p; sh:object [ sh:var "v1" ] ] | ||||||||||||||||||||||||||
[ sh:expr [ sparql:greaterThan ( [ sh:var "v1" ] 0 ) ] ] | ||||||||||||||||||||||||||
[ sh:subject [ sh:var "x" ] ; sh:predicate :q; sh:object [ sh:var "v2" ] ] | ||||||||||||||||||||||||||
[ sh:expr [ sparql:greaterThan ( [ sh:var "v2" ] 0 ) ] ] | ||||||||||||||||||||||||||
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 sh:Rule; | ||||||||||||||||||||||||||
sh:head ( | ||||||||||||||||||||||||||
[ sh:subject [ sh:var "x" ] ; sh:predicate :oneIsZero ; sh:object true ] | ||||||||||||||||||||||||||
rdf:type srl:Rule; | ||||||||||||||||||||||||||
srl:head ( | ||||||||||||||||||||||||||
[ srl:subject [ srl:var "x" ] ; srl:predicate :oneIsZero ; srl:object true ] | ||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||
sh:body ( | ||||||||||||||||||||||||||
[ sh:subject [ sh:var "x" ] ; sh:predicate :p ; sh:object [ sh:var "v1" ] ] | ||||||||||||||||||||||||||
[ sh:subject [ sh:var "x" ] ; sh:predicate :q ; sh:object [ sh:var "v2" ] ] | ||||||||||||||||||||||||||
[ sh:expr [ sparql:function-or ( | ||||||||||||||||||||||||||
[ sparql:equals ( [ sh:var "v1" ] 0 ) ] | ||||||||||||||||||||||||||
[ sparql:equals ( [ sh:var "v2" ] 0 ) ] | ||||||||||||||||||||||||||
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 ) ] | ||||||||||||||||||||||||||
) ] | ||||||||||||||||||||||||||
] | ||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||
|
@@ -971,10 +988,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> | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
|
@@ -1144,6 +1158,98 @@ <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 a special case of <a href="https://w3c.github.io/shacl/shacl-af/index.html#PropertyValueRule"> property value rules</a> | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||
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 | ||||||||||||||||||||||||||
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. | ||||||||||||||||||||||||||
Comment on lines
+1176
to
+1179
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||
</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 setting come from?</li> | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||
<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 evaluatiuon description creates all inferred triple using | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||
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 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. | ||||||||||||||||||||||||||
Comment on lines
+1217
to
+1220
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||
</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 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). | ||||||||||||||||||||||||||
Comment on lines
+1231
to
+1233
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||
</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 is, in datatlog-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. <code>`</code> | ||||||||||||||||||||||||||
giving <code>`name(termOrVar, ...)</code>. | ||||||||||||||||||||||||||
Comment on lines
+1243
to
+1247
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||
</p> | ||||||||||||||||||||||||||
</div> | ||||||||||||||||||||||||||
</section > | ||||||||||||||||||||||||||
</section> | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
<section id="shapes-rules-grammar"> | ||||||||||||||||||||||||||
<h2>Shapes Rules Language Grammar</h2> | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
|
There was a problem hiding this comment.
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?