mentat/fixtures/seattle.script
2018-03-06 09:02:11 -08:00

28 lines
814 B
Text

.i fixtures/cities.schema
.i fixtures/all_seattle.edn
.q [:find ?name ?cat
:where
[?c :community/name ?name]
[?c :community/type :community.type/website]
[(fulltext $ :community/category "food") [[?c ?cat]]]]
.q [:find ?c_name ?r_name
:where
[?c :community/name ?c_name]
[?c :community/neighborhood ?n]
[?n :neighborhood/district ?d]
[?d :district/region ?r]
[?r :db/ident ?r_name]]
.q [:find ?n . :where [(fulltext $ :community/name "Wallingford") [[?e ?n]]]]
.q [:find [?when ...] :where [_ :db/txInstant ?when] :order (asc ?when)]
.cache :neighborhood/name reverse
.cache :neighborhood/district forward
.q [:find ?district :where
[?neighborhood :neighborhood/name "Beacon Hill"]
[?neighborhood :neighborhood/district ?d]
[?d :district/name ?district]]