EyeProlog combines ISO Prolog and W3C RDF 1.2 to turn portable rules and linked data into answers and inspectable proofs.
Book — The Art of EyeProlog · Why EyeProlog? · Playground
The book is the reference for the language, command line, JavaScript API, RDF 1.2 support, examples, proofs, conformance, and implementation.
EyeProlog requires Node.js 18 or newer.
npm install --global eyeprolog
eyeprolog examples/socrates.pl
eyeprolog --proof examples/socrates.pl
eyeprolog --goal 'type(socrates, mortal)' examples/socrates.pl
Programs may declare their default queries with %% goal: comments.
Double-quoted text follows the ISO double_quotes flag and defaults to a
proper list of one-character atoms (chars), matching Trealla and Scryer.
EyeProlog adds 50 public library predicates to its 115-predicate ISO profile.
All 50 are ordinary Prolog clauses across src/eyeprolog-library.pl and
src/eyeprolog-common-library.pl; both are autoloaded in Node and the
browser. None requires host support. Other Prolog systems should load only
eyeprolog-library.pl, which avoids redefining their common list predicates.
Portable text predicates use ISO atoms or character lists; the
RDF tools emit lexical values as ISO atoms as well.
node tools/rdf-to-pl.mjs --rules rules.pl data.ttl -o program.pl
eyeprolog program.pl > derived.pl
node tools/pl-to-rdf.mjs derived.pl -o derived.nq
See the book for RDF mappings, graphs, triple terms, reifiers, annotations, formats, and policy examples.
git clone https://github.com/eyereasoner/eyeprolog.git
cd eyeprolog
npm install
npm test
EyeProlog is released under the MIT License.