This guide covers
This guide covers Titanium 1.0.0-beta1.
clojurewerkz.titanium.graph/open
is a polymorphic function that
accepts:
.properties
) files as strings or java.io.File
instancesjava.io.File
instancesIt is a minimal wrapper on top of the configuration methods for Titan that already exist.
In-memory graph can be obtained using the
clojurewerkz.titanium.graph/open
function:
(ns myservice.graphs
(:require [clojurewerkz.titanium.graph :as tg]))
(defn- main
[& args]
;; opens an in-RAM graph database
(tg/open {"storage.backend" "inmemory"})
(comment Work with the graph here))
Here's one way of opening a Titan instance backed by BerkeleyDB. It's useful for testing and REPL experimentation:
(ns myservice.graphs
(:require [clojurewerkz.titanium.graph :as tg]))
(defn- main
[& args]
;; opens a BerkeleyDB-backed graph database in a temporary directory
(tg/open (System/getProperty "java.io.tmpdir"))
(comment Work with the graph here))
Note that BerkeleyDB will lock directory it uses, so only one JVM can access a directory at a time. If you have a BerkeleyDB-backed database open in the REPL, this may prevent you from running tests or apps on the command line.
Most everything else can be accomplished by using a .properties
file
or passing in a clojure map. Titanium steps out of your way and
doesn't provide anything extra on top of Titan. Here's what
Bumi uses to configure Titan. This
opens up a Titan instance with embedded Cassandra by specifying the
backend and the config file for cassandra.
;;...
(def graph-config
{ ;; Embedded cassandra settings
"storage.backend" "embeddedcassandra"
"storage.cassandra-config-dir"
(str "file://" (System/getProperty "user.dir") "/resources/cassandra.yaml") } )
(tg/open graph-config)
;;...
We recommend that you read the following guides in this order:
Please take a moment to tell us what you think about this guide on Twitter or the Titanium mailing list
Let us know what was unclear or what has not been covered. Maybe you do not like the guide style or grammar or discover spelling mistakes. Reader feedback is key to making the documentation better.
Please take a moment to tell us what you think about this guide on Twitter or the Titanium mailing list.
Let us know what was unclear or what has not been covered. Reader feedback is key to making the documentation better. If we know people are reading the documentation, we'll be much more inclined to make the documentation that much better. Please speak up!