Annotated claims

Two sources disagree. Which one do we follow, and why?

rdf12-annotated-claims.js · output · proof · check · try it in the playground


The question

The transport authority says the bridge is closed, with confidence 98. An anonymous post says it is open, with confidence 35. The authority’s trust score is 95, the post’s 20. Each claim is an RDF 1.2 reifier of its status triple.

Should we cross the bridge?


What we tell eyecode

Numbers in RDF are typed literals whose value is text. number_chars reads the text as a number, and spells a computed number back as text:

implied_by(integer_value(literal(Text, datatype(integer)), N),
           [atom_chars(Text, Chars), number_chars(N, Chars)])

RDF values are ordinary terms: iri(Text) for an IRI, literal(Text, datatype(IRI)) or literal(Text, lang(Tag)) for a literal, triple(S, P, O) for a triple term, and rdf(S, P, O, Graph) for a quad in a graph, 'default_graph' or iri(Name).


What eyecode concludes

The decision, and the ranked evidence behind it:

result_rdf(iri('https://example.org/bridge'), iri('https://example.org/decision'), iri('https://example.org/avoid_bridge'), 'default_graph')
result_rdf(iri('https://example.org/bridge'), iri('https://example.org/trustedSource'), iri('https://example.org/transportAuthority'), 'default_graph')
result_rdf(iri('https://example.org/bridge'), iri('https://example.org/score'), literal('9310', datatype('http://www.w3.org/2001/XMLSchema#integer')), 'default_graph')
result_rdf(iri('https://example.org/closed'), iri('https://example.org/rank'), literal('1', datatype('http://www.w3.org/2001/XMLSchema#integer')), 'default_graph')
result_rdf(iri('https://example.org/closed'), iri('https://example.org/assertedBy'), iri('https://example.org/transportAuthority'), 'default_graph')
result_rdf(iri('https://example.org/closed'), iri('https://example.org/score'), literal('9310', datatype('http://www.w3.org/2001/XMLSchema#integer')), 'default_graph')
result_rdf(iri('https://example.org/open'), iri('https://example.org/rank'), literal('2', datatype('http://www.w3.org/2001/XMLSchema#integer')), 'default_graph')
result_rdf(iri('https://example.org/open'), iri('https://example.org/assertedBy'), iri('https://example.org/anonymousPost'), 'default_graph')
result_rdf(iri('https://example.org/open'), iri('https://example.org/score'), literal('700', datatype('http://www.w3.org/2001/XMLSchema#integer')), 'default_graph')

Why: the proof in plain words

  1. The authority’s claim scores 98 × 95 = 9310; the post’s 35 × 20 = 700 — the claim rule, with the multiplications recomputed.
  2. No claim scores higher than 9310, so closed ranks first; one does for 700, so open ranks second — the rank rule.
  3. 9310 reaches 8000, and closed means avoid the bridge — the decision rule.

Each step names the exact line of the program it used, and the values it filled in.


Checked, with obligations

Verdict: checked_with_obligations.


Try it

eyecode examples/rdf12-annotated-claims.js                  # the results as quads
eyecode --proof examples/rdf12-annotated-claims.js          # with their proof
eyecode examples/rdf12-annotated-claims.js > out.js && eyecode-to-rdf out.js -o out.ttl

eyecode-to-rdf and rdf-to-eyecode come with rdf-interchange; they turn eyecode’s quads into RDF and RDF into quads. Or open it in the playground. Lower the authority’s confidence to 80 and run again: 7600 is below the threshold, and the decision becomes verify_manually.


Takeaway

When sources conflict, the reasons for following one of them can be written down, computed, ranked and checked, not just asserted.