threatgrid / asami

A graph store for Clojure and ClojureScript
Eclipse Public License 1.0
634 stars 29 forks source link

Label BGPs with `:as` #200

Open quoll opened 3 years ago

quoll commented 3 years ago

Basic Graph Patterns in queries will match to statements, but statements also have IDs (already in durable storage. #198 for in-memory)

Add an :as modifier to :where clauses. This follows a BGP. e.g. [:find ?v :stmt :where [?node :name "example"] [?node :attribute ?v] :as ?stmt]

This will bind the statement ID to the ?stmt variable.

Issue #199 is already looking to extend the resolve-triple function to 6 arity, though because storage already treats statement IDs as the 4th element of a tuple then this may be a simple 5-arity extension.