Skip to content
A wrapper around neo4j (http://neo4j.org/ ) in the Clojure language
Pull request Compare This branch is even with tlpierce:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
src
.gitignore
README
build.xml
license.txt
project.clj

README

The clojure-neo4j project provides a more lispy interface to Neo4j, a graph-structured on-disk transactional database.

This library is under active development and there's plenty more work to do.

Usage:

(use ['neo4j :exclude ['start 'shutdown]])

(neo4j/start "/path/to/db")

;;; Create a root for customers and add a customer.
(with-tx
  (let [customer-root (new-node) 
        bob (new-node)]
    (relate (top-node) :customers customer-root)
    (relate customer-root :customer bob)
    (properties bob {"name" "Bob"
                     "age" 30
                     "id" "C12345"})))

;;; Fetch all customer IDs
(with-tx
  (let [customer-root (-> (top-node)
                          (.getSingleRelationship (relationship :customers) outgoing)
                          (.getEndNode))]
    (doall (map #(property % "id") 
                (traverse customer-root
                          breadth-first
                          (depth-of 1)
                          all-but-start
                          {:customer outgoing})))))

(neo4j/shutdown)
Something went wrong with that request. Please try again.