Fork me on GitHub

I'm trying asami to store var information and then query it transitively, but I don't know what's the best way to store the data. E.g. given this:

(def data [{:entity/type :call
            :var/name 'assoc
            :var/ns 'clojure.core
            :from/var 'foo
            :from/ns 'example}

           {:entity/type :call
            :var/name 'foo
            :var/ns 'example
            :from/var 'bar
            :from/ns 'example}])
You can see that a call was made to clojure.core/assoc from the var example/foo. And there was a call from example/bar to example/foo. So transitively example/bar was calling clojure.core/assoc too. How could I accomplish this with asami? Any ideas?


This is for XT's Datalog, not Asami's, but sharing just in case this snippet is helpful/illustrative:


I was explaining in a DM that rules were needed here, since there is no attribute to be transitive over. My thoughts were either: • use a production rule that creates an attribute to create the connections, which can then be traversed transitively • use a rules system like Datomic's which can make those connections without having to materialize them

👍 1

For anyone looking on, the rules that @U899JBRPF shows are the Datomic-style that I was referring to in the second suggestion


Asami doesn't have those