
Untitled
By: a guest on
Sep 18th, 2012 | syntax:
None | size: 0.94 KB | hits: 15 | expires: Never
(ns blueprints.test
(:refer-clojure :exclude [remove])
(:require [blueprints.core :as b])
(:require [blueprints.utils :as utils])
(:import (com.thinkaurelius.titan.core TitanFactory)))
(defn open
[config-or-dir]
(TitanFactory/open config-or-dir))
(defn open-in-memory
[]
(TitanFactory/openInMemoryGraph))
(def g (open-in-memory))
;;(def g (open "/tmp/titan"))
(type g)
;;==> StandardTitanGraph
(def james (b/add-vertex g {:name "James"}))
(type james)
;;==> PersistentStandardTitanVertex
(b/get-id james)
;;==> 4
;;==> nil (in SLIME)
(b/get-id (b/add-vertex g {:name "Julie"}))
;;==> 36
;;==> 36 (in SLIME -- it works!)
;; These print properly via the lein command line...
(println (.getVertex g (b/get-id james)))
;;==> #<PersistStandardTitanVertex v[4]>
;;==> nil (in SLIME)
(println (b/get-id (.getVertex g (b/get-id james))))
;;==> 4
;;==> nil (in SLIME)
(defn -main
"I don't do a whole lot."
[& args]
(println "Hello, World!"))