File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9595 (or (keyword? form) (string? form)))
9696
9797(defn lookup-ref? [form]
98- (looks-like? [attr? '_] form))
98+ (and
99+ (or (sequential? form) (da/array? form))
100+ (= 2 (count form))
101+ (attr? (first form))))
99102
100103; ; Relation algebra
101104
666669
667670(defn resolve-pattern-lookup-refs [source pattern]
668671 (if (satisfies? db/IDB source)
669- (let [[e a v tx] pattern]
670- (->
671- [(if (or (lookup-ref? e) (attr? e)) (db/entid-strict source e) e)
672- a
673- (if (and v (attr? a) (db/ref? source a) (or (lookup-ref? v) (attr? v))) (db/entid-strict source v) v)
674- (if (lookup-ref? tx) (db/entid-strict source tx) tx)]
675- (subvec 0 (count pattern))))
672+ (let [[e a v tx] pattern
673+ e' (if (or (lookup-ref? e) (attr? e))
674+ (db/entid-strict source e)
675+ e)
676+ v' (if (and v (attr? a) (db/ref? source a) (or (lookup-ref? v) (attr? v)))
677+ (db/entid-strict source v)
678+ v)
679+ tx' (if (lookup-ref? tx)
680+ (db/entid-strict source tx)
681+ tx)]
682+ (subvec [e' a v' tx'] 0 (count pattern)))
676683 pattern))
677684
678685(defn dynamic-lookup-attrs [source pattern]
You can’t perform that action at this time.
0 commit comments