This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-04
Channels
- # announcements (7)
- # babashka (32)
- # beginners (106)
- # bristol-clojurians (10)
- # cider (6)
- # clj-kondo (5)
- # cljdoc (10)
- # clojure (110)
- # clojure-australia (10)
- # clojure-dev (6)
- # clojure-europe (12)
- # clojure-nl (2)
- # clojure-norway (16)
- # clojure-spec (9)
- # clojure-uk (59)
- # clojurescript (105)
- # community-development (2)
- # conjure (46)
- # cursive (12)
- # data-science (1)
- # datalog (26)
- # datomic (37)
- # docker (4)
- # emacs (10)
- # events (1)
- # fulcro (8)
- # graalvm (2)
- # jobs (1)
- # jobs-discuss (1)
- # malli (24)
- # meander (13)
- # off-topic (52)
- # pathom (4)
- # polylith (17)
- # proletarian (4)
- # react (1)
- # rewrite-clj (4)
- # shadow-cljs (56)
- # sql (21)
- # xtdb (14)
The datalog bnf can be translated to spec or malli (I have an example of the latter) You can then call parse/decode and bob's your uncle That takes care of parsing, at least
I sort of assume there's a theoretical starting point that would be useful if I wanted to write my own
I also just found https://github.com/lambdaforge/datalog-parser
tweaks this a little to form the AST, does some algebra and reordering on it, and then executes it
Specifically… https://github.com/threatgrid/naga/tree/d149904da8ecb510ddbbb5b73824c74da4b05d77/src/naga/storage/memory
I was getting a bit lost this morning in the planner distinctions and how that effected everything
Also, the code I pointed you at doesn’t handle queries as you’re familiar with them. You’d be looking for the query
function in code.clj line 294. After the storage object, this function takes 2 arguments:
• output-pattern
: this is the content of a :find
clause and can be something like [?p ?v]
• patterns
: this is the content of a :where
clause, and can be something like [?e :age ?a] [(> ?a 20)] [?e ?p ?v]
The plan-path
function can be safely ignored. Just assume that the output plan
value is the same as the input patterns
value. It also returns resolution-map
, but that’s a bit misleading. It’s just that the default planner used this map, and the first step of the query also happened to use this map, and I figured I could save myself a step by returning it and using it, rather than looking it up again.
The datalog bnf can be translated to spec or malli (I have an example of the latter) You can then call parse/decode and bob's your uncle That takes care of parsing, at least