Fork me on GitHub
#datascript
<
2017-11-09
>
Niki08:11:39

this structure is already hardcoded

Niki08:11:19

if you use same attribute (e.g. :contains for parent-child relationship all the way down, then you can write a generic recursive query)

Niki08:11:57

although recursive query will find everything on its path, not just leaves

Niki08:11:21

(d/q '[:find ?c
       :in $ % ?p
       :where (contains ?p ?c)]
  db
  [[(contains ?p ?c)
    [?p :contains ?c]]
   [(contains ?p ?c)
    [?p :contains ?x]
    (contains ?x ?c)]]
  (d/entid db [:name "asia"]))