Created
January 25, 2013 00:41
-
-
Save nlacasse/4630424 to your computer and use it in GitHub Desktop.
insert-tuple
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn insert-tuple! | |
[inserter tuple] | |
; Get the resource and label names out of the tuple. | |
(let [[resource-1 label resource-2 & _ ] tuple | |
; Upsert the resource nodes. | |
node-1 (insert-resource-node! inserter resource-1) | |
node-2 (insert-resource-node! inserter resource-2)] | |
; Connect the nodes with an edge. | |
(connect-resource-nodes! inserter node-1 node-2 label))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment