Skip to content

Instantly share code, notes, and snippets.

View amcp's full-sized avatar

Alexander Patrikalakis amcp

  • Chiba, Japan
View GitHub Profile
@amcp
amcp / classmethod-titan-storage-backend.groovy
Last active March 31, 2016 01:00
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")
:load ml.groovy
MovieLensParser.load(graph, "ml-1m")
g = graph.traversal()
clockWithResult(1){ g.E().count().tryNext().get() }
clockWithResult(1){ g.V().count().tryNext().get() }
@amcp
amcp / downloadAndWrite.sh
Last active April 27, 2018 17:56
This groovy script loads the Enron email graph and performs a traversal for the shortest path between two nodes
#!/bin/bash
wget https://snap.stanford.edu/data/email-Enron.txt.gz
gunzip email-Enron.txt.gz
bin/gremlin.sh #and then :load enron.groovy