Skip to content

Instantly share code, notes, and snippets.

@espeed
espeed / gist:3711518
Created September 13, 2012 02:48
Titan Build Errors
Testing testCompetingThreads...
Encountered error in testCompetingThreads
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.thinkaurelius.titan.blueprints.LocalBlueprintsTest.doTestSuite(LocalBlueprintsTest.java:125)
at com.thinkaurelius.titan.blueprints.LocalBlueprintsTest.doTestSuite(LocalBlueprintsTest.java:98)
at com.thinkaurelius.titan.blueprints.LocalBlueprintsTest.testTransactionalGraphTestSuite(LocalBlueprintsTest.java:62)
@espeed
espeed / test.clj
Created August 5, 2012 06:05
Titan Not Working with Clojure SLIME
(ns blueprints.test
(:refer-clojure :exclude [remove])
(:require [blueprints.core :as b])
(:require [blueprints.utils :as utils])
(:import (com.thinkaurelius.titan.core TitanFactory)))
(defn open
[config-or-dir]
(TitanFactory/open config-or-dir))
@espeed
espeed / pick.py
Created July 19, 2012 23:52
Pickle Bulbs Elements and Models
# Example of how to pickle Bulbs elements and models
# by James Thornton, http://jamesthornton.com
import pickle
from bulbs.neo4jserver import Graph
from bulbs.model import Node
from bulbs.property import String, Integer
class Person(Node):
@espeed
espeed / gist:3091843
Created July 11, 2012 17:21
Titan Build Error 2
Testing testCompetingThreads...
Encountered error in testCompetingThreads
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.thinkaurelius.titan.blueprints.LocalBlueprintsTest.doTestSuite(LocalBlueprintsTest.java:118)
at com.thinkaurelius.titan.blueprints.LocalBlueprintsTest.doTestSuite(LocalBlueprintsTest.java:91)
at com.thinkaurelius.titan.blueprints.LocalBlueprintsTest.testTransactionalGraphTestSuite(LocalBlueprintsTest.java:61)
@espeed
espeed / gist:3091669
Created July 11, 2012 16:53
Titan Build Error
$ mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Titan: A Highly Scalable, Distributed Graph Database 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ titan ---
[INFO] Deleting /home/james/projects/titan/target
[INFO]
@espeed
espeed / fulltext.py
Created June 30, 2012 20:44
Bulbs Neo4j Fulltext Index Example
from bulbs.neo4jserver import Graph, Config, NEO4J_URI, FulltextIndex
Graph.default_index = FulltextIndex
config = Config(NEO4J_URI)
config.vertex_index = "fulltext_vertex"
config.edge_index = "fulltext_edge"
g = Graph(config)
a = g.vertices.create(title="The Matrix")
@espeed
espeed / neo4jserver-graph.clj
Created May 26, 2012 03:57
Bulbs Clojure Neo4j Server Graph
(ns bulbs.neo4jserver.graph
(:use [bulbs.neo4jserver.client :only [create-client]]))
(defn graph
"Returns a function that takes a function and its args."
[& [config]]
(use '[bulbs.element :only (vertex edge)])
(alias 'bulbs 'bulbs.element)
(let [client (create-client config)]
(fn [func element & args]
@espeed
espeed / bulbs.py
Created May 26, 2012 03:47
Bulbs/Python Example
# Bulbs/Python example
>>> from bulbs.neo4jserver import Graph
>>> g = Graph()
>>> james = g.vertices.create(name="James")
>>> julie = g.vertices.create(name="Julie")
>>> g.edges.create(james, "knows", julie)
@espeed
espeed / bulbs.clj
Created May 26, 2012 03:41
Bulbs Clojure
;; Bulbs/Clojure example
user> (use '[bulbs.neo4jserver.graph :only (graph)])
user> (def g (graph))
user> (def james (g bulbs/create vertex {:name "James"}))
user> (def julie (g bulbs/create vertex {:name "Julie"}))
user> (g bulbs/create edge james :knows julie)
@espeed
espeed / ov.clj
Created May 17, 2012 23:47
Overloading Clojure Protocol Error
(deftype Neo4jClient [ns config]
ClientProtocol
(create-edge
[this outV label inV data]
(let [inV-uri (utils/normalize-uri (build-path neo4j-uri vertex-path inV))
path (build-path vertex-path, outV, "relationships")
params {:to inV-uri, :type label, :data (first data)}]
(post config path params)))