Nested RDF 1.2 triple terms: one pattern reaches the triple inside a claim inside a review.
data/nested-triple-term-n3.ttl · nested-triple-term-n3.n3 · output · proof · check · playground
The question
Which relationship sits inside the claim inside the review?
Historical background
RDF 1.2 allows a triple term to occur inside another triple term. A description can therefore reach through a review to the statement it concerns with a nested pattern. The example makes both levels visible. W3C, RDF 1.2 Concepts and Abstract Data Model
What the program says
data/nested-triple-term-n3.ttl:
# An auditor reviews a claim about who knows whom. A nested triple-term
# pattern concludes the innermost relationship without asserting the claim.
@prefix : <https://example.org/> .
:auditor :reviews <<( :alice :claims <<( :bob :knows :carol )>> )>> .
nested-triple-term-n3.n3:
# An auditor reviews a claim about who knows whom. A nested triple-term
# pattern concludes the innermost relationship without asserting the claim.
@prefix : <https://example.org/> .
{ ?reviewer :reviews <<( ?claimant :claims <<( ?s :knows ?o )>> )>> }
=> { ?s :knows ?o } .
What eyemind concludes
The command writes these conclusions in its native output format:
@prefix : <https://example.org/> .
:bob :knows :carol .
Unification matches both nested triple terms in a single premise. The conclusion states only the innermost relationship.
The check report records the corresponding claims as JavaScript expressions:
// Checked answers: these follow from the input program and are every answer of its questions.
rdf(iri('https://example.org/bob'), iri('https://example.org/knows'), iri('https://example.org/carol'))
What the proof establishes
The saved report ends with verdict('checked').
The checker reads the clauses from the compiled program, not from the
proof, and never calls the reasoning engine. It answers the original
questions from the proof’s call tables, checking each table by expanding its
call one level against the program; it requires each derived listing to be
closed under the forward rules; and it replays the recorded firing of each
listed fact, computing primitives again. A step, table or listing the check
does not use fails it.
The verdict establishes that the displayed claims follow from the compiled program and are every answer of its original questions.
Try it
From the repository root:
node bin/eyemind.js examples/data/nested-triple-term-n3.ttl examples/nested-triple-term-n3.n3
node bin/eyemind.js --proof examples/data/nested-triple-term-n3.ttl examples/nested-triple-term-n3.n3
node bin/eyemind.js --check-proof examples/proof/nested-triple-term-n3.js examples/data/nested-triple-term-n3.ttl examples/nested-triple-term-n3.n3
