Mercurial > hg > Members > nobuyasu > Consensus
comparison app/models/TPGraph.java @ 16:7cdc9d19834f
modified createClaim
author | one |
---|---|
date | Tue, 02 Oct 2012 13:52:31 +0900 |
parents | 9b677755cb93 |
children | a134edaebf6f |
comparison
equal
deleted
inserted
replaced
15:0adbec4c7091 | 16:7cdc9d19834f |
---|---|
1 package models; | 1 package models; |
2 | |
3 import org.codehaus.jackson.JsonNode; | |
2 | 4 |
3 import scala.reflect.generic.Trees.This; | 5 import scala.reflect.generic.Trees.This; |
4 | 6 |
5 import com.tinkerpop.blueprints.Graph; | 7 import com.tinkerpop.blueprints.Graph; |
6 import com.tinkerpop.blueprints.Vertex; | 8 import com.tinkerpop.blueprints.Vertex; |
82 public void setLabelToRootClaim(ClaimModel claim) { | 84 public void setLabelToRootClaim(ClaimModel claim) { |
83 Vertex rootClaim = getClaimRootVertex(); | 85 Vertex rootClaim = getClaimRootVertex(); |
84 /* | 86 /* |
85 * rootUser ---child---> newUser | 87 * rootUser ---child---> newUser |
86 */ | 88 */ |
87 graph.addEdge(null, rootUser, user.getVertex(), CHILD); | 89 graph.addEdge(null, rootClaim, claim.getVertex(), CHILD); |
88 } | 90 } |
89 | 91 |
92 public void setLabelToAuthor(String author, ClaimModel claim) { | |
93 Vertex authorVertex = graph.getVertex(author); | |
94 | |
95 /* | |
96 * claim ---author---> authorVertex(userVertex) | |
97 */ | |
98 graph.addEdge(null, claim.getVertex(), authorVertex, NodeModel.AUTHOR); | |
99 | |
100 } | |
101 | |
102 public Boolean updateUserVertex(Vertex claim, JsonNode usersJson) { | |
103 | |
104 | |
105 return true; | |
106 } | |
90 | 107 |
91 | 108 |
92 public void shutdownGraph() { | 109 public void shutdownGraph() { |
93 graph.shutdown(); | 110 graph.shutdown(); |
94 } | 111 } |