LeanRDF

What is proven, what is trusted

The guarantees

Each package makes one kind of claim, and each claim is a Lean theorem.

PackageWhen it saysLean proves
leanrdfthe checker accepts a certificate for q over gg.RDFSEntails q: every RDFS interpretation recognizing xsd:string and rdf:langString that satisfies g satisfies q
leanrdf-owlthe checker accepts a certificate under owlRules or owlELRulesg.OWLEntails q, for interpretations with the OWL 2 RDF-Based conditions LeanRDF transcribes
leanrdf-sparqlthe evaluator returns solutionsthey are a permutation of the SPARQL 1.1 semantics, sorted by ORDER BY when there is one (runQuery_answer)
leanrdf-shaclthe report says "conforms"the data conforms to the shapes (validate_conforms), and each reported result is a real violation (validate_sound)
leanrdf-elpi"ENTAILED", "CERTIFIED" or a printed subsumptionone of the first two rows, because the verified checker accepted a certificate

The library uses only the three standard axioms propext, Quot.sound and Classical.choice, contains no sorry, and every package has tests that pin the axioms of its main theorems with #print axioms.

What is never claimed

The trusted base

Not trusted: lean-elpi, the clause generator, the saturation driver, certify, the oxilite translator, JSON and results parsing, oxilite itself and any other external engine.

Recorded simplifications

Every place where LeanRDF covers less than the specification is recorded in tg.md/simplifications.md, with its effect.

SimplificationEffect
Interpretations live in Typenone on soundness
D is {xsd:string, rdf:langString}, values abstractno value-space entailment ("01"^^xsd:integer ≠ "1"); SPARQL and SHACL compare values separately
IRIs checked by the N-Triples grammar, not full RFC 3987input validation only
rdf:_n axioms only for rdf:_n that occurincompleteness, not unsoundness
A subset of the OWL 2 RDF-Based conditions, some only in the direction the rules usesoundness carries over to full OWL 2 entailment
OWL 2 RL without list rules and inconsistency rulesthose inferences are not derived
EL intersections of two or three classeslonger intersections are not derived
Recursive SHACL shapes are rejected when read§3.4 leaves them undefined

The tools never overclaim

$ lake exe leanrdf-demo examples/pets.nt examples/query-tom-dog.nt
Verdict: NOT DERIVED (no instance of the query is derived).
This is not a claim of non-entailment: completeness is not proven.

Every tool uses the same exit codes: 0 everything claimed was proven, 1 something was not derived (or the data does not conform), 2 a certificate was rejected, which is a bug on the untrusted side, and 3 an input error.

Open directions