Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Clojure wrapper for Neo4j, a graph database.
tree: c9c87d7e15

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


Wrapper for Neo4j, a graph database.

Purpose of this library is to provide intiutive access to commonly used Neo4j operations. It uses official Neo4j Java bindings. It does not use Blueprints interface.


Add the following dependency to your project.clj file:

[borneo "0.1.0-SNAPSHOT"]


Detailed API docs are at

Quick overview of available functions (most important ones are emphasized):

  • Database management
    • neo-db - Holds current database instance
    • start! - Establish a connection to the database
    • stop! - Closes a connection stored in *neo-db*
    • with-db! - establish a connection to the database
    • with-local-db! - establish a thread local connection to the database
    • with-tx - establish a transaction
    • get-path - get path to where database is stored
    • read-only? - returns true if database is read only
    • index - returns Index Manager
  • Property Containers (both Nodes and Relationships)
    • prop? - returns true if node or relationship contains given property
    • prop - returns specific property value for a given node or relationship
    • props - returns map of properties for a given node or relationship
    • set-prop! - sets or removes property in a given node or relationship
    • set-props! - sets (or removes) properties for a given node or relationships
    • get-id - returns id of a given node or relationship
    • delete! - deletes relationship or free node
  • Relationships
    • rel-nodes - returns the two nodes attached to the given relationship
    • start-node - returns start node for given relationsip
    • end-node - returns end node for given relationsip
    • other-node - returns other node for given relationsip
    • rel-type - returns type of given relationship
    • create-rel! - create relationship between two nodes
    • all-rel-types - returns lazy seq of all relationship types in database
  • Nodes
    • rel? - returns true if node has given relationship(s)
    • rels - returns relationships attached to given node
    • single-rel - returns single relationship for given node
    • create-node! - creates new node, not linked with any other nodes
    • create-child! - creates a child node of a given parent
    • delete-node! - delete node and all its relationships
  • Graph traversal protocols
  • Graph traversal
    • all-nodes - returns lazy-seq of all nodes in database
    • node-by-id - returns node with a given id
    • rel-by-id - returns relationship with a given id
    • root - returns root/reference node
    • walk - walk though the graph by following through given single relations
    • traverse - traverse the graph


(ns foo.example
  (:require [borneo.core :as neo]))

(neo/with-neo "/path/to/db"





Disclaimer: Forked from hgavin/clojure-neo4j

Disclaimer: Small amount of comments and docs are based on official Neo4j javadocs.

Copyright (C) 2011, Jozef Wagner. All rights reserved.

The use and distribution terms for this software are covered by the Eclipse Public License 1.0 ( which can be found in the file epl-v10.html at the root of this distribution.

By using this software in any fashion, you are agreeing to be bound by the terms of this license.

You must not remove this notice, or any other, from this software.

Something went wrong with that request. Please try again.