changeset 12:7e38484474f4 draft

commit
author one
date Thu, 06 Sep 2012 06:05:24 +0900
parents 8e3bb1843beb
children 0ef7268bbbac
files src/sample/CreateTinkerGraph.java
diffstat 1 files changed, 14 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- 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));