Skip to content

tlpierce/clojure-neo4j

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

A wrapper around neo4j (http://neo4j.org/ ) in the Clojure language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Clojure 100.0%