Skip to content

Instantly share code, notes, and snippets.

@AlBaker
Created April 21, 2014 02:26
Show Gist options
  • Save AlBaker/11130645 to your computer and use it in GitHub Desktop.
Save AlBaker/11130645 to your computer and use it in GitHub Desktop.
;; First, add a triple
;; Then run an udpate query, which is its own transaction
;; Finally, confirm via ask
(with-open [c (connect test-db-spec)]
(with-transaction [c]
(insert! c ["urn:testUpdate:a1" "urn:testUpdate:b" "aloha world"]))
(update c "DELETE { ?a ?b \"aloha world\" } INSERT { ?a ?b \"shalom world\" } WHERE { ?a ?b \"aloha world\" }"
{:parameters {"?a" "urn:testUpdate:a1" "?b" "urn:testUpdate:b"}})
(ask c "ask { ?s ?p \"shalom world\" }") => truthy)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment