rdf4j.sparql.processor

with-sparql

macro

added in 0.1.15

(with-sparql args & body)

args => [key value …] Evaluates body in context of processed SPARQL request on given data within a transaction.

The query (:query) result is exposed to the body with variable defined by key :result and is a sequence of BindingSets or Statements for tuple or graph queries respectively.

NB: The transaction is finished by commit so SPARQL query might affect the repository content. It depends on this macro user ;-)

All possible keys are: - :query or :sparql (required) :: SPARQL query as string - :result (required) :: Declares variable for holding sparql query results - :data (optional) :: A collection of data loaded into repository - :binding (optional) :: A map with bindings - :repository (optional). :: User’s repository. Alternatively creates one using (r/make-repository-with-lucene)