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:
Detailed API docs are at http://wagjo.github.com/borneo/
Quick overview of available functions (most important ones are emphasized):
- 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
- 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
- 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
(ns foo.example (:require [borneo.core :as neo])) (neo/with-neo "/path/to/db" TODO )
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 (http://opensource.org/licenses/eclipse-1.0.php) 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.