Skip to content
Generic datalog parser compliant to datomic, datascript and datahike queries.
Clojure
Branch: master
Clone or download
Christian Weilbach
Christian Weilbach Update README.
Latest commit 07be59e Nov 4, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
src/datalog Remove reflection, use proper EPL, reduce Clojure version dep. Nov 4, 2019
test/datalog Remove reflection, use proper EPL, reduce Clojure version dep. Nov 4, 2019
.gitignore migrate datahike parser (#2) Jun 19, 2019
CHANGELOG.md migrate datahike parser (#2) Jun 19, 2019
LICENSE migrate datahike parser (#2) Jun 19, 2019
README.md Update README. Nov 4, 2019
project.clj Remove reflection, use proper EPL, reduce Clojure version dep. Nov 4, 2019

README.md

datalog-parser

A Datalog parser.

Usage

Add [io.lambdaforge/datalog-parser "0.1.1"] to your project.clj. Start a repl and run:

(require '[datalog.parser :as parser])

(parser/parse '[:find ?x :in $ ?y :where [?x :z ?y]])

;;=> (namespaces omitted for brevity)
;; #Query{:qfind  #FindRel{:elements [#Variable{:symbol ?x}]}
;;        :qwith  nil
;;        :qin    [#BindScalar{:variable #SrcVar{:symbol $}}
;;                 #BindScalar{:variable #Variable{:symbol ?y}}]
;;        :qwhere [#Pattern{:source #DefaultSrc{}
;;                          :pattern [#Variable{:symbol ?x}
;;                                    #Constant{:value  :z}
;;                                    #Variable{:symbol ?y}]}]}

For more examples look at the tests.

TODO

0.2.0

Unparsing support, missing types:

  • PullSpec
  • PullAttrName
  • PullReverseAttrName
  • PullLimitExpr
  • PullDefaultExpr
  • PullWildcard
  • PullRecursionLimit
  • PullMapSpecEntry
  • PullAttrWithOpts

License

Copyright © 2019 lambdaforge UG (haftungsbeschränkt), Nikita Prokopov

This program and the accompanying materials are made available under the terms of the Eclipse Public License 1.0.

You can’t perform that action at this time.