- https://jamesthornton.com#EXIWlRrkjKE
- https://twitter.com/Rangers/status/1641554510605611011
- https://twitter.com/astros/status/1641996751618940936
- https://www.youtube.com/watch?v=S7c3lzpDkvQ#7SlILk2WMTI
- https://gist.github.com/espeed/dd3026536ec3d38afea1072941670f52#3ch6eXkQWU8-C5TDc46E1G4-trIjpVH8h88-UcW056B9jeQ-LvG_M_fAkXU
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ 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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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))) |