Rule tuples - workspace during rule evaluation
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 28/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- data
Research direction
No files, tests, or entry points are named in the issue. Start by mapping the repository's existing SHACL rule syntax and evaluation path; done would require an agreed tuple syntax, matching and storage semantics, DATA handling, and tests covering the proposed behavior.
Written by the indexing model from the issue text.
Description
Datalog is based around "atoms". An atom consists of a name (a predicate symbol) and zero or more terms, where each term is a constant or a variable. Atoms are also called literals. Atoms do not contains atoms (unlike prolog).
Viewed as datalog, SHACL Rules has one type of atom used as triple/triple pattern/triple template, depending on position.
Having other tuples forms can be useful during rule execution.
A rule might emit a tuple to represent intermediate matching results to be shared by several other rules. Without some working space during execution, either the same pattern will be repeated in the other rules, or some intermediate triples are needed and these will end up in the output inference graph.
Rule tuples are workspace elements and are disjoint from triples. They are tuples of RDF terms (no variables).
Syntax of tuple patterns, templates and tuples:
TUPLE(termOrVar , ...)
with a shorthand:
$(termOrVar , ...)
Often, the first argument will be a fixed name - think of it as an SQL table name or a programming language struct.
There is a tuple store which holds tuples for the lifetime of the evaluation.
The tuple store holds duplicate data tuples (unlike an RDF graph which is a set).
A rule tuple pattern can appear in the body of a rule, where it matches in a similar fashion to a triple pattern -- look in the tuple store for matches based on arity and any constant RDF terms, returning a sequence of solution mappings. (Implementation note: indexing by first argument will greatly speed up access for the "fixed name" style.)
A rule tuple template can appear in the head of a rule, where it acts to generate grounded data tuples (i.e. no variables) which are added to the tuple store.
A rule data tuple can appear in a DATA block, where it is added to the tuple store at the start of execution.
The tuple store is ephemeral. It is not defined as an output of the evaluation process.
- Dominant language
- HTML
- Stars
- 162
- Forks
- 48
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 26
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from w3c/data-shapes
-
UI
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
w3c/data-shapes#1178 · 7 comments ·
-
High-Priority UI
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
w3c/data-shapes#1141 · 1 comment ·
-
SHACL-SHACL
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
w3c/data-shapes#1101 ·
-
Profiling
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
w3c/data-shapes#986 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
w3c/data-shapes#967 · 1 comment ·
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Schema-level dtype cannot be serialized: to_yaml raises RepresenterError, to_json raises TypeError Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
unionai-oss/pandera#2511 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
unitaryfoundation/qldpc-challenge#1651 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
statsmodels/statsmodels#10271 ·