Skip to content

Instantly share code, notes, and snippets.

@amcp
Last active March 31, 2016 01:00
Show Gist options
  • Save amcp/f83a422fec48c2adf7a6 to your computer and use it in GitHub Desktop.
Save amcp/f83a422fec48c2adf7a6 to your computer and use it in GitHub Desktop.
Titan Tupl Dependency Graph
//Configure and open an in-memory titan-tupl graph
conf = new BaseConfiguration()
conf.setProperty("storage.backend", "jp.classmethod.titan.diskstorage.tupl.TuplStoreManager")
g = com.thinkaurelius.titan.core.TitanFactory.open(conf)
//Create the vertices
titan = g.addVertex("name", "Titan")
structure = g.addVertex("name", "Gremlin Structure")
graphtraversal = g.addVertex("name", "GraphTraversal")
gremlin = g.addVertex("name", "Gremlin")
traversal = g.addVertex("name", "Traversal")
graphcomputer = g.addVertex("name", "GraphComputer and VertexProgram")
gremlinserver = g.addVertex("name", "GremlinServer")
classmethodStorageBackend = g.addVertex("name", "Classmethod Tupl Storage Backend for Titan")
tupl = g.addVertex("name", "Tupl")
//Create the edges
titan.addEdge("implements", structure)
graphtraversal.addEdge("builds-on", structure)
gremlin.addEdge("builds-on", structure)
traversal.addEdge("builds-on", structure)
graphcomputer.addEdge("builds-on", structure)
gremlinserver.addEdge("builds-on", structure)
titan.addEdge("backed-by", classmethodStorageBackend)
classmethodStorageBackend.addEdge("uses", tupl)
//Commit the changes to the backend
g.tx().commit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment