- Introduction
1.1 Terminology
1.2 Document Conventions
1.3 Conformance
Test suite
1.x Working notes:
- NX aggregate functions. These may not work.
- SHACL Rules
(informative section (non-normative) explaining the main features)
Basic outline, key features, not all features. Audience: rules engineer
Example.
What are "rules"? A set of conditions of the form that infer new information from existing data.
Apply rules: rules+data -> new information
2.1 Structure of a Rule
Head-Body: match body (the "if",) and generate new informtion ("triples") Or as H is true when B
Body is a pattern, with value restriction.
** Example 1 of a rule that does not depend on other rules. ** Example 2 of a rule with a filter.
2.2 Operations - infer(), query()
A rules system can provide one or both of these operations.
- "infer" - create all new information
- "query" - given a simple pattern, can it be inferred by the rules+data.
2.3 Rule Dependencies
Rules can depend on rules.
Including recursion.
** Example3: A rule that depends on another rule. :ancestor
2.4 Rule Dependency and Rule Set Stratification
Explanation
"We say that rule1 depends on rule2 if ..."
2.5 Negation-as-failure
{:s :p ?z . NOT EXISTS { ?z :q ?v } ... }
2.6 Assignment
and why it is beyond datalog
"safe assignment" - previous stratification.
- Shape Rules Abstract Syntax (Definition section)
3.1 Well-formedness Condition for a rule body FILTERs, Assignments
3.2 Dependency Relationship Definition
3.3 Stratification
Definition
... and well-formedness conditions (NAF and recursion)
EXISTS - with body pattern (a limited graph pattern)
- Concrete Syntax forms for Shapes Rules
4.1 RDF Rules Syntax
4.2 Compact Rules Syntax
4.2.1 Compact Syntax Abbreviations
4.3 SPARQL function restrictions
No BOUND, FILTER (NOT) EXISTS (available as a pattern)
Added pattern EXISTS/NOT EXISTS, arg is a body pattern.
?? IF
- Shape Rules Evaluation
5.1 Evaluation of an expression
5.2 Evaluation of a rule
5.3 Evaluation of a Rule Set
Evaluation of
- positive datalog infer(), query().
- semi-positve datalog
In semi-positive Datalog => Pattern for the EXISTS only mentions pattens that do not occur in any rule head.
- Possible variants
Are simpler to implement subsets well-defined enough? Stratified NAF
-
Attaching Rules to Shapes
Does (some) targets as patterns work for a definition? -
Workspace named tuples
Syntax:
? TUPLE(name/string, varTerm1, varTerm2, ...) -- include this and maybe a short form.
&name(varTerm1, varTerm2, ...)- other charcater: % (caveat %xx), ^, *, \name, |name|(varTerm1, varTerm2, ...)
Appendix A: SHACL Rules Grammar
Appendix B: Relationship to SHACL-AF
Triple rules
SPARQL rules
Appendix C: Relationship to node expressions