Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit a37a5273832b44ef92b6704aa8d809bd60ced0a9 Darrick Wiebe committed Aug 26, 2012
Binary file not shown.
@@ -0,0 +1,8 @@
+(defproject pacer "0.0.1-SNAPSHOT"
+ :description "Awesome Graph Traversals"
+ :url "http://github.com/pangloss/pacer-clj"
+ :dependencies [[org.clojure/clojure "1.4.0"]
+ [com.tinkerpop.blueprints/blueprints-core "2.1.0"]
+ [com.tinkerpop/pipes "2.1.0"]
+ [com.tinkerpop.gremlin/gremlin-java "2.1.0"]]
+ :plugins [[lein-swank "1.4.4"]])
Binary file not shown.
@@ -0,0 +1,39 @@
+(ns pacer
+ (:import
+ (com.tinkerpop.blueprints Graph Element Vertex Edge TransactionalGraph IndexableGraph Index)
+ (com.tinkerpop.blueprints.impls.tg TinkerGraph))
+ )
+
+(defn simple-encoder [] { :encode nil :decode nil })
+(defn tg []
+ { :type :graph
+ :raw-graph (com.tinkerpop.blueprints.impls.tg.TinkerGraph.)
+ :encoder (simple-encoder)})
+
+(defn v
+ ([]
+ [{ :source-type :graph
+ :type :vertex
+ :name "GraphV"
+ :iterator (fn [source] (doto (:graph source) (.getVertices) (.iterator))) }])
+ ([graph]
+ (concat [graph] (v))))
+
+(defn- pipe-from-step [source step]
+ (prn step)
+ (cond
+ (:pipe step) (doto (:pipe step)
+ (.setStarts source))
+ (:build-pipe step) (throw (Exception. "Not Implemented"))
+ (:iterator step) ((:iterator step) source)
+ :else (throw (Exception. "Don't know how to build step"))))
+
+(defn pipe
+ ([[source step & route]]
+ (if route
+ (pipe (pipe-from-step source step) route)
+ (pipe-from-step source step)))
+ ([iter [step & route]]
+ (if route
+ (recur (pipe-from-step iter step) route)
+ (pipe-from-step iter step))))
@@ -0,0 +1 @@
+58812
@@ -0,0 +1 @@
+([:dependencies [[org.clojure/clojure "1.4.0"] [com.tinkerpop.blueprints/blueprints-core "2.1.0"] [com.tinkerpop/pipes "2.1.0"] [com.tinkerpop.gremlin/gremlin-java "2.1.0"] [swank-clojure "1.4.0"]]])

0 comments on commit a37a527

Please sign in to comment.