【发布时间】:2015-05-14 04:26:44
【问题描述】:
我试图找到两个输入之间的纬度。我的查询:
(defn- latlngs-within-new-bounds
[db a w]
(d/q '[:find ?lat
:in $ ?a ?w
:where
[ ?e :location/lat ?lat]
[(>= ?lat ?a)]
(not
[(>= ?lat ?w)])]
db a w))
我的错误:
3 Unhandled com.google.common.util.concurrent.UncheckedExecutionException
java.lang.RuntimeException: Unable to resolve symbol: ?lat in this
context
2 Caused by clojure.lang.Compiler$CompilerException
1 Caused by java.lang.RuntimeException
Unable to resolve symbol: ?lat in this context
Util.java: 221 clojure.lang.Util/runtimeException
如果能帮助我理解我的查询出了什么问题,我们将不胜感激。如果您还可以使用 Datomic 规则来分解每一半的 in-bounds 部分,则可以加分。
【问题讨论】:
-
你想在这里完成什么:
(>= :location/lat ?w)? :location/lat 似乎无法与 ?w 相提并论 -
你是对的。我已将其重新格式化为更简单的情况和有效的查询。
-
你真的在执行那个查询吗?由于
:in行中的a和w参数应该是?a和?w。 -
是的,我是。是的,我还需要修复其他结构性问题。该错误与这些参数中的任何一个都无关,并且在我修复它时保持不变。