Named witnesses, with classifications and reciprocal child relations.
N3 source · output · proof · check · playground
The question
Ann and Bob each need a mother in the model. Can a rule name those mothers deterministically and use the same names in later inferences?
Historical background
RDF 1.1 described when a fresh IRI can stand in for a blank node. Giving a witness an identifier lets another statement refer to it. The example uses that pattern for the mother witness and the link back to the child. RDF 1.1 Concepts, replacing blank nodes with IRIs
What the N3 says
@prefix : <http://example.org/people#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
:ann a :Person.
:bob a :Person.
{ ?p a :Person. (:mother ?p) log:skolem ?m } => { ?p :mother ?m. ?m a :Woman }.
{ ?p :mother ?m } => { ?m :hasChild ?p }.
The naming key (:mother ?p) contains a role and a person. log:skolem
binds ?m to the corresponding IRI before the rule concludes the mother
link and the :Woman classification. The next rule uses that same IRI to
add the reciprocal :hasChild link.
These are explicit named witnesses, chosen by the rule. They do not claim to identify a person’s real mother. An ordinary forward rule computes the name; there is no restricted firing with a conclusion blank node.
What eyemind concludes
Ann and Bob have different mother IRIs. Each mother is classified as a woman and has the corresponding child link. The same IRI occurs in all three triples about that mother.
The check report writes the claims as terms:
// Checked answers: these follow from the input program and are every answer of its questions.
rdf(iri('http://example.org/people#ann'), iri('http://example.org/people#mother'), iri('https://eyereasoner.github.io/.well-known/genid/ee2956d8f5822f2cb3b208c5b988d2d006eedc4b3785315b961306ac4e4059b1'))
rdf(iri('https://eyereasoner.github.io/.well-known/genid/ee2956d8f5822f2cb3b208c5b988d2d006eedc4b3785315b961306ac4e4059b1'), iri('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), iri('http://example.org/people#Woman'))
rdf(iri('http://example.org/people#bob'), iri('http://example.org/people#mother'), iri('https://eyereasoner.github.io/.well-known/genid/bd71c82d337e4be11be5babdab1403beb35f509f069848b543dbfca97f131ddf'))
rdf(iri('https://eyereasoner.github.io/.well-known/genid/bd71c82d337e4be11be5babdab1403beb35f509f069848b543dbfca97f131ddf'), iri('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), iri('http://example.org/people#Woman'))
rdf(iri('https://eyereasoner.github.io/.well-known/genid/ee2956d8f5822f2cb3b208c5b988d2d006eedc4b3785315b961306ac4e4059b1'), iri('http://example.org/people#hasChild'), iri('http://example.org/people#ann'))
rdf(iri('https://eyereasoner.github.io/.well-known/genid/bd71c82d337e4be11be5babdab1403beb35f509f069848b543dbfca97f131ddf'), iri('http://example.org/people#hasChild'), iri('http://example.org/people#bob'))
What the proof establishes
The proof cites the program compiled from the N3 rules: each mother link and
:Woman classification has a step citing the first rule, and each
:hasChild link one citing the second. The naming itself appears in the
call tables, one per person, each holding the IRI that log:skolem computes
for that naming key.
The checker follows the certificate without invoking the reasoning engine. It checks each call table by applying the compiled program one level, computing the mother IRIs itself, requires the listing to be closed under the rules, and replays each listed triple’s firing. The names are computed in the premise, as ordinary values, so no rule introduces a witness of its own.
The verdict is checked: the claims follow from the program and are every
answer of its questions. The proof cites the clauses of the compiled
program, which --program writes out.
Try it
node bin/eyemind.js examples/existential-n3.n3
node bin/eyemind.js -c examples/existential-n3.n3
node bin/eyemind.js --check-proof examples/proof/existential-n3.js examples/existential-n3.n3
Add :cy a :Person . to a copy. The rules give Cy a mother IRI and the two
associated classification and child triples.
