From 3440a74faf0e347c619c20292d75f8e37575c013 Mon Sep 17 00:00:00 2001
From: Andy Seaborne
@@ -917,39 +933,40 @@ @@ Discussion
+ See SHACL AF `sh:rule`,
+ which describes triple rules,
+ with a special case of property value rules
+ and SPARQL Rules (AKA "CONSTRUCT rules").
+ Core issue 517 : classification shapes
+ 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.
+ @@ Discussion Define a new rule that is another rule with some variables already set @@ Discussion The main evaluatiuon description creates all inferred triple using
+ the datalog "naive" algorithm. Do we need to talk about backward evaluation and stratification? @@ Discussion 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.
+ Priority for this feature? @@ Discussion
+ 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).
+ Do we need "order" in the syntax? 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".
+ Alternative: Describe how the abstract model maps to triples.
Document Conventions
Prefix
Namespace
+ Informal Name
rdf:
+ http://www.w3.org/1999/02/22-rdf-syntax-ns#
RDF
+ rdfs:
+ http://www.w3.org/2000/01/rdf-schema#
RDFS
+
+
+
+ srl:
+ http://www.w3.org/ns/shacl-rules#
SHACL Rules
+
+
+ shnex:
+ http://www.w3.org/ns/shnex#
SHACL Node Expressions
sh:
+ http://www.w3.org/ns/shacl#
SHACL
xsd:
+ http://www.w3.org/2001/XMLSchema#
XML Schema
ex:
+ http://example.com/ns#
Example
Concrete Syntax forms for Shapes 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 ) ]
) ]
]
);
@@ -1144,6 +1161,85 @@
Evaluation of a Rule Set
+ Drafting Notes
+ Attaching Rules to Shapes
+
+
+ Parameterization
+
+
+ More on evaluation
+ Negation as semi-positive datalog
+ Assignment restrictions
+
Shapes Rules Language Grammar
From 6a72a17581f28cd0a10f37de54a1203cb9db81c3 Mon Sep 17 00:00:00 2001
From: Andy Seaborne RDF Rules Syntax
Assignment restrictions
Do we need "order" in the syntax?
+ +@@ Discussion
+
+ 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?
+ e.g. name(termOrVar, ...)
, possibly with a unique marker e.g. `
+ giving `name(termOrVar, ...)
.
+