rify
Rify is a forward chaining inference engine designed specifically for use on in-memory RDF graphs.
It accepts conjunctive rules with limited expressiveness so reasoning is bounded by O(n^k) in both memory and in computation where n is the number of nodes in the input RDF graph.
Reasoning generates a proof which can be used to quickly verify the result pragmatically.
Logical rules are defined as if-then clauses. Something like this:
// actual definitions of these types are templated but this is the gist
Use
Two functions are central to this library: prove and validate.
// Example use of `prove`
use ;
// (?a, is, awesome) ∧ (?a, score, ?s) -> (?a score, awesome)
let awesome_score_axiom = create?;
assert_eq!;
// Example use of `validate`
use ;
// (?a, is, awesome) ∧ (?a, score, ?s) -> (?a score, awesome)
let awesome_score_axiom = ...;
let proof = vec!;
let Valid = .map_err?;
// Now we know that under the given rules, if all RDF triples in `assumed` are true, then all
// RDF triples in `implied` are also true.
recipies
In addition to normal cargo commands like cargo test and cargo check the ./justfile
defines some scripts which can be useful during develompent. For example, just js-test will
test the javascript bindings to this library. See ./justfile for more.
License
This project is licensed under either of Apache License, Version 2.0 or MIT license, at your option.