Skip to content


Subversion checkout URL

You can clone with
Download ZIP
tree: bff8c17ac7
Fetching contributors…

Cannot retrieve contributors at this time

90 lines (66 sloc) 5.559 kb


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
    • with-db! - establish a connection to the database
    • with-tx - establish a transaction
    • get-db - get current database instance
    • 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
    • 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
  • Relationships
    • rel-nodes - returns the two nodes attached to the given relationship
    • 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
    • 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 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.

Jump to Line
Something went wrong with that request. Please try again.