# HG changeset patch # User one # Date 1346879124 -32400 # Node ID 7e38484474f4cb39cd7ffb9dad9b50d08ce4ba64 # Parent 8e3bb1843bebcd5f719fe3a484d638e102bbb6f5 commit diff -r 8e3bb1843beb -r 7e38484474f4 src/sample/CreateTinkerGraph.java --- a/src/sample/CreateTinkerGraph.java Wed Sep 05 19:12:20 2012 +0900 +++ b/src/sample/CreateTinkerGraph.java Thu Sep 06 06:05:24 2012 +0900 @@ -11,28 +11,32 @@ import com.tinkerpop.blueprints.Edge; import com.tinkerpop.blueprints.Graph; import com.tinkerpop.blueprints.Vertex; -import com.tinkerpop.blueprints.impls.tg.TinkerGraph; import com.tinkerpop.blueprints.util.io.graphml.GraphMLReader; import com.tinkerpop.blueprints.util.io.graphml.GraphMLWriter; public class CreateTinkerGraph { - public static final String filename = "./resources/testTinkerpopDB"; + public static final String filename = "./resources/tinkerDB"; public static void main(String[] args) { - try { + TinkerGraph graph = new TinkerGraph("/db"); + Vertex a = graph.addVertex(null); + Vertex b = graph.addVertex(null); + a.setProperty("name", "maro"); + b.setProperty("name", "Peter"); + Edge e = graph.addEdge(null, a, b, "knows"); + System.out.println(e.getVertex(Direction.OUT).getProperty("name") + + "--" + e.getLabel() + "-->" + + e.getVertex(Direction.IN).getProperty("name")); + graph.shutdown(); -// outputGraph(); -// readGraph(); - readPageRankDB(); - - } catch (IOException e) { - e.printStackTrace(); - } } + public static void createGraph() { + } + public static void outputGraph() throws IOException { Graph graph = new TinkerGraph(); FileOutputStream out = new FileOutputStream(new File(filename));