Permalink
Browse files

purge fn, docs typos

  • Loading branch information...
1 parent 1d21c3b commit 21930ea7b909e10254fb3a62d200b094929d05cd unknown committed Mar 7, 2011
Showing with 121 additions and 123 deletions.
  1. +44 −41 README.md
  2. +77 −82 src/borneo/core.clj
View
85 README.md
@@ -1,6 +1,6 @@
# borneo
-Wrapper for Neo4j, a graph database.
+Clojure 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
@@ -91,48 +91,49 @@ Quick overview of available functions (most important ones are
emphasized):
* _Database management_
- * _[\*neo-db\*](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/*neo-db*)_ - Holds current database instance
- * _[start!](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/start!)_ - Establish a connection to the database
- * _[stop!](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/stop!)_ - Closes a connection stored in \*neo-db\*
- * ___[with-db!](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/with-db!)_ - establish a connection to the database__
- * _[with-local-db!](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/with-local-db!)_ - establish a thread local connection to the database
- * ___[with-tx](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/with-tx)_ - establish a transaction__
- * _[get-path](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/get-path)_ - get path to where database is stored
- * _[read-only?](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/read-only?)_ - returns true if database is read only
- * _[index](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/index)_ - returns Index Manager
+ * _[\*neo-db\*](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/*neo-db*)_ holds current database instance
+ * _[start!](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/start!)_ establishes a connection to the database
+ * _[stop!](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/stop!)_ closes a connection stored in \*neo-db\*
+ * ___[with-db!](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/with-db!)_ establishes a connection to the database__
+ * _[with-local-db!](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/with-local-db!)_ establishes a thread local connection to the database
+ * ___[with-tx](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/with-tx)_ establishes a transaction__
+ * _[get-path](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/get-path)_ gets path to where database is stored
+ * _[read-only?](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/read-only?)_ returns true if database is read only
+ * _[index](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/index)_ returns Index Manager
+ * _[purge!](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/purge!)_ deletes all nodes and relationships
* _Property Containers (both Nodes and Relationships)_
- * _[prop?](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/prop?)_ - returns true if node or relationship contains given property
- * _[prop](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/prop)_ - returns specific property value for a given node or relationship
- * ___[props](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/props)_ - returns map of properties for a given node or relationship__
- * _[set-prop!](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/set-prop!)_ - sets or removes property in a given node or relationship
- * ___[set-props!](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/set-props!)_ - sets (or removes) properties for a given node or relationships__
- * _[get-id](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/get-id)_ - returns id of a given node or relationship
- * ___[delete!](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/delete!)_ - deletes relationship or free node__
+ * _[prop?](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/prop?)_ returns true if node or relationship contains given property
+ * _[prop](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/prop)_ returns specific property value for a given node or relationship
+ * ___[props](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/props)_ returns map of properties for a given node or relationship__
+ * _[set-prop!](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/set-prop!)_ sets or removes property in a given node or relationship
+ * ___[set-props!](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/set-props!)_ sets (or removes) properties for a given node or relationships__
+ * _[get-id](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/get-id)_ returns id of a given node or relationship
+ * ___[delete!](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/delete!)_ deletes relationship or "free" node__
* _Relationships_
- * ___[rel-nodes](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/rel-nodes)_ - returns the two nodes attached to the given relationship__
- * _[start-node](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/start-node)_ - returns start node for given relationsip
- * _[end-node](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/end-node)_ - returns end node for given relationsip
- * _[other-node](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/other-node)_ - returns other node for given relationsip
- * ___[rel-type](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/rel-type)_ - returns type of given relationship__
- * ___[create-rel!](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/create-rel!)_ - create relationship between two nodes__
- * _[all-rel-types](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/all-rel-types)_ - returns lazy seq of all relationship types in database
+ * ___[rel-nodes](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/rel-nodes)_ returns the two nodes attached to the given relationship__
+ * _[start-node](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/start-node)_ returns start node for given relationsip
+ * _[end-node](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/end-node)_ returns end node for given relationsip
+ * _[other-node](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/other-node)_ returns other node for given relationsip
+ * ___[rel-type](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/rel-type)_ returns type of given relationship__
+ * ___[create-rel!](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/create-rel!)_ creates relationship between two nodes__
+ * _[all-rel-types](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/all-rel-types)_ returns lazy seq of all relationship types in database
* _Nodes_
- * _[rel?](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/rel?)_ - returns true if node has given relationship(s)
- * ___[rels](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/rels)_ - returns relationships attached to given node__
- * _[single-rel](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/single-rel)_ - returns single relationship for given node
- * _[create-node!](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/create-node!)_ - creates new node, not linked with any other nodes
- * ___[create-child!](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/create-child!)_ - creates a child node of a given parent__
- * ___[delete-node!](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/delete-node!)_ - delete node and all its relationships__
+ * _[rel?](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/rel?)_ returns true if node has given relationship(s)
+ * ___[rels](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/rels)_ returns relationships attached to given node__
+ * _[single-rel](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/single-rel)_ returns single relationship for given node
+ * _[create-node!](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/create-node!)_ creates new node, not linked with any other nodes
+ * ___[create-child!](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/create-child!)_ creates a child node of a given parent__
+ * ___[delete-node!](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/delete-node!)_ deletes node and all its relationships__
* _Graph traversal protocols_
- * _[ReturnableEvaluator](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/ReturnableEvaluator)_ - Protocol for return evaluation. Used for graph traversing.
- * _[StopEvaluator](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/StopEvaluator)_ - Protocol for stop evaluation. Used for graph traversing.
+ * _[ReturnableEvaluator](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/ReturnableEvaluator)_ protocol for return evaluation. Used for graph traversing.
+ * _[StopEvaluator](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/StopEvaluator)_ protocol for stop evaluation. Used for graph traversing.
* _Graph traversal_
- * _[all-nodes](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/all-nodes)_ - returns lazy-seq of all nodes in database
- * _[node-by-id](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/node-by-id)_ - returns node with a given id
- * _[rel-by-id](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/rel-by-id)_ - returns relationship with a given id
- * ___[root](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/root)_ - returns root/reference node__
- * ___[walk](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/walk)_ - walk though the graph by following through given single relations__
- * ___[traverse](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/traverse)_ - traverse the graph__
+ * _[all-nodes](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/all-nodes)_ returns lazy-seq of all nodes in database
+ * _[node-by-id](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/node-by-id)_ returns node with a given id
+ * _[rel-by-id](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/rel-by-id)_ returns relationship with a given id
+ * ___[root](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/root)_ returns root/reference node__
+ * ___[walk](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/walk)_ walks though the graph by following through given single relations__
+ * ___[traverse](http://wagjo.github.com/borneo/borneo.core-api.html#borneo.core/traverse)_ traverses the graph__
## Examples
@@ -202,7 +203,7 @@ graph](http://dist.neo4j.org/basic-neo4j-code-examples-2008-05-08.pdf)
### Basic traversal
-Assuming I do not have any of previous references to nodes.
+Assuming I do not have any previous references to nodes.
Get me all human nodes:
@@ -222,7 +223,7 @@ I want to see their properties:
;; {:name "Morpheus", :rank "Captain", :age 35}
;; {:name "Cypher"})
-I want to find Mr. Andersons node, assuming I don't have one:
+Want to find Mr. Andersons node, assuming I don't have one:
(def the-one (first (neo/traverse (neo/walk (neo/root) :humans)
{:name "Thomas Anderson"}
@@ -349,7 +350,9 @@ You can contact Jozef Wagner through:
## License
-Disclaimer: Forked from [hgavin/clojure-neo4j](http://github.com/hgavin/clojure-neo4j)
+Disclaimer: Forked from
+[hgavin/clojure-neo4j](http://github.com/hgavin/clojure-neo4j) (no
+longer available)
Disclaimer: Small amount of comments and docs are based on official
Neo4j javadocs.
View
159 src/borneo/core.clj
@@ -1,6 +1,6 @@
;; Copyright (C) 2011, Jozef Wagner. All rights reserved.
;;
-;; Disclaimer: Forked from hgavin/clojure-neo4j
+;; Disclaimer: Forked from hgavin/clojure-neo4j (no longer available).
;;
;; Disclaimer: Small amount of comments and docs are based on official
;; Neo4j javadocs.
@@ -21,18 +21,18 @@
See project page (http://github.com/wagjo/borneo) for usage instructions,
documentation and examples.
- Code notes:
- - Using official Neo4j bindings
- - Not using Blueprints interface
+ Notes:
+ - Using official Neo4j bindings.
+ - Not using Blueprints interface.
- neo-db holds the current db instance, so that users do not have
- to supply db instance at each call to db operations. This
- approach has of course its drawbacks (e.g. only one connection at
- time), but I've found it suitable for my purposes.
+ to supply db instance at each call to db operations. This approach has
+ of course some drawbacks , but I've found it suitable for my purposes.
- All mutable functions are by default wrapped in transactions. That
means you don't have to explicitly put them in transactions. The Neo4j
transaction model allows for fast transaction nesting, so you can easily
have your own transaction if you have a group of mutable functions.
- In that case just wrap functions inside with-tx."
+ In that case just wrap your functions inside with-tx.
+ - NullPointerException is thrown if there is no open connection to the db."
(:import (org.neo4j.graphdb Direction
Node
PropertyContainer
@@ -43,29 +43,28 @@
Traverser$Order)
(org.neo4j.kernel EmbeddedGraphDatabase)))
-
;;;; Implementation details
-(defonce ^{:doc "Holds the current database instance"
+(defonce ^{:doc "Holds the current database instance."
:tag EmbeddedGraphDatabase
:dynamic true}
*neo-db* nil)
(defn- array?
- "Determine whether x is an array or not"
+ "Determines whether x is an array or not."
[x]
(when x
(-> x class .isArray)))
(defn- name-or-str
- "If x is keyword, returns its name. If not, stringify the value"
+ "If x is keyword, returns its name. If not, stringify the value."
[x]
(if (keyword? x)
(name x)
(str x)))
(defn- process-position
- "Translate TraversalPosition into a map"
+ "Translates TraversalPosition into a map."
[^TraversalPosition p]
{:pos p
:node (.currentNode p)
@@ -77,7 +76,7 @@
:count (.returnedNodesCount p)})
(defn- ^RelationshipType rel-type*
- "Create java class implementing RelationshipType. Used for interop.
+ "Creates java class implementing RelationshipType. Used for interop.
TODO: Should we cache these instances to save memory?
Or will they be GCd?"
[k]
@@ -86,8 +85,8 @@
(defn- ^Direction rel-dir
"Translates keyword to the respective relationship direction.
- Valid values are :out :in and :both
- See javadoc for Direction for more info on directions"
+ Valid values are :out :in and :both.
+ See javadoc for Direction for more info on directions."
[k]
(condp = k
:out Direction/OUTGOING
@@ -99,7 +98,7 @@
"Constructs an array or relation types and directions. Accepts
map consisting of relation type keywords as keys and
relation directions keywords (:in or :out) as values.
- r canalso be a single keyword; in that case, a default :out will
+ r can also be a single keyword; in that case, a default :out will
be added to the array."
[r]
(if (keyword? r)
@@ -121,11 +120,12 @@
(defprotocol StopEvaluator
"Protocol for stop evaluation. Used for graph traversing.
Functions:
- (stop-node? [this pos]) - should return true if at stop node
- pos will be current position map"
+ (stop-node? [this pos]) - Should return true if at stop node.
+ pos will be current position map."
(stop-node? [this pos]))
(extend-protocol StopEvaluator
+ ;; Implements StopEvaluator for simple functions
clojure.lang.Fn
(stop-node? [this pos] (this pos)))
@@ -145,7 +145,7 @@
(isStopNode [^TraversalPosition p] (f (process-position p)))))
(defn- depth-of
- "Return a StopEvaluator for the given traversal depth."
+ "Returns a StopEvaluator for the given traversal depth."
[d]
(if (== d 1)
org.neo4j.graphdb.StopEvaluator/DEPTH_ONE
@@ -158,7 +158,7 @@
- :1, :2, :X (X being any positive integer) - depth of X
- Custom function which takes one argument, current position
and should return true when at stop node.
- - anything extending StopEvaluator protocol
+ - Anything extending StopEvaluator protocol.
Examples: (stop-evaluator :8)
(stop-evaluator :1)
(stop-evaluator :end)
@@ -174,9 +174,9 @@
(defprotocol ReturnableEvaluator
"Protocol for return evaluation. Used for graph traversing.
Functions:
- (returnable-node? [this pos]) - should return true if node should
+ (returnable-node? [this pos]) - Should return true if node should
be returned. pos will be current
- position map"
+ position map."
(returnable-node? [this pos]))
(defn- returnable-by-props
@@ -188,8 +188,10 @@
(every? check-prop props)))
(extend-protocol ReturnableEvaluator
+ ;; Implements ReturnableEvaluator for simple functions
clojure.lang.Fn
(returnable-node? [this pos] (this pos))
+ ;; Implements ReturnableEvaluator for property map
clojure.lang.IPersistentMap
(returnable-node? [this pos] (returnable-by-props this pos)))
@@ -228,15 +230,15 @@
(defn start!
"Establish a connection to the database.
Uses *neo-db* Var to hold the connection.
- Do not use this function, use with-db! or with-local-db! instead"
+ Do not use this function, use with-db! or with-local-db! instead."
[path]
(io!)
(let [n (EmbeddedGraphDatabase. path)]
(alter-var-root #'*neo-db* (fn [_] n))))
(defn stop!
"Closes a connection stored in *neo-db*.
- Do not use this function, use with-db! or with-local-db! instead"
+ Do not use this function, use with-db! or with-local-db! instead."
[]
(io!)
(.shutdown *neo-db*))
@@ -286,25 +288,45 @@
(finally (.finish tx#)))))
(defn get-path
- "Returns path to where the database is stored"
+ "Returns path to where the database is stored."
[]
(.getStoreDir *neo-db*))
(defn read-only?
- "Returns true if database is read only"
+ "Returns true if database is read only."
[]
(.isReadOnly *neo-db*))
(defn index
- "Returns the IndexManager paired with this graph database service"
+ "Returns the IndexManager paired with this graph database service."
[]
(.index *neo-db*))
+(declare all-nodes)
+
+(declare rels)
+
+(declare delete!)
+
+(defn purge!
+ "Deletes all nodes from database together with all relationships."
+ []
+ (io!)
+ ;; first delete all relationships
+ (doseq [node (all-nodes)]
+ (with-tx
+ (doseq [r (rels node)]
+ (delete! r))))
+ (with-tx
+ ;; now delete nodes
+ (doseq [node (all-nodes)]
+ (delete! node))))
+
;;; Property Containers
(defn prop?
"Returns true if given node or relationship contains
- property with a given key"
+ property with a given key."
[^PropertyContainer c k]
(.hasProperty c (name-or-str k)))
@@ -321,7 +343,7 @@
;; has lazy values
(defn props
- "Return map of properties for a given node or relationship.
+ "Returns map of properties for a given node or relationship.
Fetches all properties and can be very resource consuming if node
contains many large properties. This is a convenience function."
[^PropertyContainer c]
@@ -387,7 +409,8 @@
;; javadoc)
(defn rel-nodes
- "Returns the two nodes attached to the given relationship."
+ "Returns the two nodes attached to the given relationship.
+ This is a convenience function."
[^Relationship r]
(.getNodes r))
@@ -402,7 +425,8 @@
(.getEndNode r))
(defn other-node
- "Returns other node for given relationship."
+ "Returns other node for given relationship.
+ This is a convenience function."
[^Relationship r ^Node node]
(.getOtherNode r node))
@@ -412,14 +436,14 @@
(keyword (.name (.getType r))))
(defn create-rel!
- "Create relationship of a supplied type between from and to nodes."
+ "Creates relationship of a supplied type between from and to nodes."
[^Node from type ^Node to]
(io!)
(with-tx
(.createRelationshipTo from to (rel-type* type))))
(defn all-rel-types
- "Returns lazy seq of all relationship types currently in database"
+ "Returns lazy seq of all relationship types currently in database."
[]
(lazy-seq
(.getRelationshipTypes *neo-db*)))
@@ -428,13 +452,13 @@
(defn rel?
"Returns true if there are relationships attached to this node. Syntax:
- [node] - All relationships
+ [node] - All relationships.
[node type-or-types] - Relationships of any of specified types with
- any direction
+ any direction.
[node type direction] - Relationships of specified type and
of specified direction. You can supply nil for
one of the arguments if you do not care for
- either direction of relationship type
+ either direction of relationship type.
Valid directions are :in :out and :both, parameter type can be any keyword.
Examples: (rel? node) ; All rels
(rel? node :foo) ; Rels of :foo type of any direction
@@ -457,13 +481,13 @@
(defn rels
"Returns relationships attached to this node. Syntax:
- [node] - All relationships
+ [node] - All relationships.
[node type-or-types] - Relationships of any of specified types with
- any direction
+ any direction.
[node type direction] - Relationships of specified type and
of specified direction. You can supply nil for
one of the arguments if you do not care for
- either direction of relationship type
+ either direction of relationship type.
Valid directions are :in :out and :both, parameter type can be any keyword.
Examples: (rels node) ; All rels
(rels node :foo) ; Rels of :foo type of any direction
@@ -487,7 +511,7 @@
(defn single-rel
"Returns the only relationship for the node of the given type and
direction.
- Valid directions are :in :out and :both, defaults to :out"
+ Valid directions are :in :out and :both, defaults to :out."
([^Node node type]
(single-rel node type :out))
([^Node node type direction]
@@ -509,7 +533,8 @@
(defn create-child!
"Creates a node that is a child of the specified parent node
(or root node) along the specified relationship.
- props is a map that defines the properties of the node."
+ props is a map that defines the properties of the node.
+ This is a convenience function."
([type props]
(create-child! (root) type props))
([node type props]
@@ -520,7 +545,8 @@
child))))
(defn delete-node!
- "Delete node and all its relationships."
+ "Delete node and all its relationships.
+ This is a convenience function."
[node]
(io!)
(with-tx
@@ -568,7 +594,7 @@
(.getReferenceNode *neo-db*))
(defn walk
- "Walk through the graph by following specified relations. Returns last node.
+ "Walks through the graph by following specified relations. Returns last node.
Throws NullPointerException if path is wrong.
Throws NotFoundException if path is ambiguous."
[^Node node & types]
@@ -577,25 +603,25 @@
(reduce next-node node types)))
(defn traverse
- "Traverse the graph. Starting at the given node, traverse the graph
+ "Traverses the graph. Starting at the given node, traverse the graph
in specified order, stopping based on stop-eval. The return-eval
decides which nodes make it into the result. The rel is used to
decide which edges to traverse.
order - :breadth, :depth. Will be :depth if nil supplied.
stop-eval accepts following values:
- - :end or nil - end of graph
- - :1, :2, :X (X being any positive integer) - depth of X
+ - :end or nil - End of graph.
+ - :1, :2, :X (X being any positive integer) - Depth of X.
- Custom function which takes one argument, current position
and should return true when at stop node.
return-eval accepts following values:
- - :all-but-start or nil - all but start nodes
- - :all - all nodes
+ - :all-but-start or nil - all but start nodes.
+ - :all - all nodes.
- Custom function which takes one argument, current position map
and should return true when node at current position should be returned.
- Map defining key-value pairs that will be matched against
properties of wanna-be returned nodes.
- rel - a keyword representing relation type or a map where keys are
- relation type keywords and values are directions (:in or :out)"
+ rel - Keyword representing relation type or a map where keys are
+ relation type keywords and values are directions (:in or :out)."
([^Node node rel]
(traverse node nil nil nil rel))
([^Node node return-eval rel]
@@ -616,35 +642,4 @@
;; See README for usage instructions, documentation and examples.
- (start! "neo-db")
-
- (stop!)
-
- (defn a [pos] true)
-
- (deftype X [depth]
- StopEvaluator
- (stop-node? [this pos] (println "ahoj" depth pos) false))
-
- (deftype Y [uid]
- ReturnableEvaluator
- (returnable-node? [this pos] (= uid (prop (:node pos) :uid))))
-
- (take 3 (traverse (root)
- :depth
- (X. 3)
- :all
- {:users :out :user :out :itests :out}))
-
- (map props (traverse (root)
- {:uid "jw817dk"}
- {:users :out :user :out}))
-
- (map props (traverse (root)
- (Y. "jw817dk")
- {:users :out :user :out}))
-
- (count (traverse (walk (root) :users)
- :user))
-
)

0 comments on commit 21930ea

Please sign in to comment.