This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-04
Channels
- # announcements (123)
- # asami (1)
- # babashka (50)
- # beginners (49)
- # biff (21)
- # calva (48)
- # cider (6)
- # clj-yaml (8)
- # cljsrn (2)
- # clojure (9)
- # clojure-conj (1)
- # clojure-indonesia (1)
- # clojure-losangeles (1)
- # clojure-uk (18)
- # clojurescript (21)
- # data-science (19)
- # datahike (13)
- # events (1)
- # fulcro (1)
- # honeysql (4)
- # hyperfiddle (40)
- # improve-getting-started (3)
- # inf-clojure (1)
- # malli (6)
- # off-topic (45)
- # releases (3)
- # rewrite-clj (14)
- # scittle (1)
- # shadow-cljs (57)
- # tools-deps (1)
- # vim (13)
- # xtdb (14)
There seems to be a bug 🐛 in the impl of transitive attribute queries. The last example from the https://github.com/quoll/asami/wiki/6.-Querying#transitive-attributes doesn’t work:
(let [conn (d/connect "asami:")]
@(d/transact conn {:tx-data [{:db/id -1 :name "Washington Monument"}
{:db/id -2 :name "National Mall"}
{:db/id -3 :name "Washington, DC"}
{:db/id -4 :name "USA"}
{:db/id -5 :name "Earth"}
{:db/id -6 :name "Solar System"}
{:db/id -7 :name "Orion-Cygnus Arm"}
{:db/id -8 :name "Milky Way Galaxy"}
{:db/id -9 :db/ident 9 :name "Arlington"}
{:db/id -10 :db/ident 10 :name "Falls Church"}
[:db/add -1 :is-in -2]
[:db/add -2 :is-in -3]
[:db/add -3 :is-in -4]
[:db/add -4 :is-in -5]
[:db/add -5 :is-in -6]
[:db/add -6 :is-in -7]
[:db/add -7 :is-in -8]
[:db/add -9 :neighbor -3]
[:db/add -10 :neighbor -9]]})
(d/q '[:find ?name :where [?e :name "Falls Church"][?e ?a* ?e2][?e2 :name ?name]] (d/db conn)))
; =>
; Execution error (ExceptionInfo) at asami.common-index/eval9492$fn (common_index.cljc:346).
; Unable to do transitive closure with nothing bound
; ex-data: `{:args [?e ?a ?e2]}
`
The ?e
should have been bound due to the preceding rule [?e :name "Falls Church"]
but the code does not seem to understand that. Perhaps because the get-transitive-from-index
defmethod is not aware of the context it is called in? (Latest Asami 2.3.3.)