Skip to content

Nemo v0.4.0

Compare
Choose a tag to compare
@mmarx mmarx released this 08 Dec 14:35
· 1018 commits to main since this release
v0.4.0

Version 0.4.0 of Nemo extends the fast in-memory rule reasoner with support for aggregation and tracing. The command-line client nmo can be used to access this functionality (use nmo --help for a brief documentation). The online documentation of Nemo covers many of the current features.

New Features and Improvements

  • Aggregates in rule heads
  • tracing of atoms shows why an atom was derived: e.g., the CLI option --trace 'p(42)' shows a derivation tree for atom p(42) after reasoning
  • arithmetic terms can now be used in rule bodies
  • inequality operator != for arithmetic comparisons
  • wildcard terms: _ in an atom always matches, but does not introduce a variable binding, e.g., q(?x, ?y) :- p(?x, _, _, ?y) is equivalent to q(?x, ?y) :- p(?x, ?z, ?zz, ?y)
  • loading of RDF N-Quads and TriG files
  • @import syntax for more control over input formats
  • @export syntax for more control over output formats (e.g., specifying the delimiter for CSV-like outputs)

Notable bug fixes and internal improvements

  • New dictionary implementation significantly reduces memory consumption on large datasets

Current Functionality

  • Execution (materialization) of Datalog extended with stratified negation and existential rules (tuple-generating dependencies)
  • Loading input data from local or remote CSV/TSV and RDF (NT, Turtle, RDF/XML, NQ, TriG) files
  • Writing results to CSV files
  • Compatibility with RDF and SPARQL syntax for IRIs and literals
  • Datatypes integer (whole numbers), float64 (64bit floating point numbers), string (Unicode strings), and any (union type that can represent any element; default for most contexts)
  • Support for built-in predicates <=, <, >=, >, !=, and = and built-in functions +, -, *, and / for types integer and float64
  • Aggregation: #count, #min, #max, and #sum

Nemo v0.4.0 is built for mid-sized computing tasks that can still be processed on a normal laptop in seconds or minutes (typically hundreds of thousands to hundreds of millions of facts). In such cases, Nemo is already quite fast – at least fast enough to outperform existing free rule engines on the tests we conducted so far. Example tasks and benchmark results can be found in our sister repository Nemo examples and benchmarks.

Note that the combination of existential quantifiers and stratified negation do not have a standard semantics, and may lead to unexpected conclusions which can be avoided by careful modeling (see Ellmauthaler, Krötzsch, Mennicke; AAAI 2022).

Known Limitations

The following features are not included in v0.4.0 yet and will be added in upcoming releases:

  • Support for RDF output
  • Support for unary - in arithmetic expressions (current workaround: use 0-?X instead of -?X)
  • More built-in functions, especially for string data
  • More control over output formats

Moreover, the documentation, though improved, is still very limited. This will be expanded gradually.

Full Changelog: v0.3.0...v0.4.0