سؤال

The LogicBlox database is programmed using the LogiQL language, which is according to their site some sort of variant of Datalog:

Applications are written using the LogiQL language, an extended version of Datalog

What exactly are the differences between Datalog and LogiQL?

هل كانت مفيدة؟

المحلول

LogiQL is indeed a superset of Datalog, adding various features, including:

  • Transaction support
  • An extensional database where facts can be dynamically inserted and removed (i.e. the set of facts is not "static")
  • Entities
  • Aggregations
  • Delta logic to update the extensional database
  • Pulse predicates whose facts are only kept during the lifetime of a transaction
  • Modules, for large-scale application development
  • Support for machine learning and optimization

There's probably more that I'm forgetting.

نصائح أخرى

Indeed, the "academic" version of Datalog used for studying database theory is purposefully limited. Each "industrial" variant of Datalog adds its own extensions to support programming real applications. In addition to the things Zef listed, some other features LogiQL supports are

  • Useful primitive types such as datetime, int, string -- types that have infinite number of values
  • Operations over primitive types, e.g. datetime functions for getting the time now, parsing time, numeric comparisons, numeric functions such as addition or generating random numbers, etc. All the stuff you really need to build real applications, but can make the theory rather nasty if you studied it academically, and thus left out of the academic version of Datalog
  • Ability to construct new entities
  • Negation. Currently LogiQL supports globally stratified negation, meaning if a predicate A is defined by negating over predicate B, then predicate B's definition cannot also, transitively, negate over predicate A.

LogiQL is very much a superset of Datalog. Originally it was simply referred to internally at LogicBlox as "Datalog". Very much like other implementations of Datalog, there were additions unique to the LogicBlox flavor. At some point the language grew much more extensive, with so many new added features, that it was decided to rename it to "LogiQL" instead. But LogiQL is still LogicBlox's unique flavor and superset of Datalog.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top