Mercurial > hg > Members > nobuyasu > Consensus
comparison app/init/InitialData.java @ 120:5ee0a70ab968 draft
modifie viewr
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 18 Apr 2013 06:20:51 +0900 |
parents | 3440be06e501 |
children | 5cc8c9689fec |
comparison
equal
deleted
inserted
replaced
119:aa5daf38f3e9 | 120:5ee0a70ab968 |
---|---|
67 , String relation) { | 67 , String relation) { |
68 tpGraph.setLabelMention(getLatestClaim(tpGraph, fromClaim), getLatestClaim(tpGraph, toClaim), relation); | 68 tpGraph.setLabelMention(getLatestClaim(tpGraph, fromClaim), getLatestClaim(tpGraph, toClaim), relation); |
69 } | 69 } |
70 | 70 |
71 public static void copyConsensusTree(TPGraph tpGraph, ClaimModel claim) { | 71 public static void copyConsensusTree(TPGraph tpGraph, ClaimModel claim) { |
72 /* | |
73 String timestamp = Long.toString(System.currentTimeMillis()); | 72 String timestamp = Long.toString(System.currentTimeMillis()); |
74 ClaimModel latest = getLatestClaim(tpGraph, claim); | 73 ClaimModel latest = getLatestClaim(tpGraph, claim); |
75 System.out.println("latestClaim = "+latest.getId()); | |
76 tpGraph.copyConsensusTree(latest, timestamp); | 74 tpGraph.copyConsensusTree(latest, timestamp); |
77 */ | |
78 } | 75 } |
79 | 76 |
80 public void enterDataDemo1() { | 77 public void enterDataDemo1() { |
81 TPGraph tpGraph = TPGraph.getInstance(); | 78 TPGraph tpGraph = TPGraph.getInstance(); |
82 Graph graph = tpGraph.getGraph(); | 79 Graph graph = tpGraph.getGraph(); |
88 | 85 |
89 ClaimModel claimModel2 = new ClaimModel(graph.addVertex(null)); | 86 ClaimModel claimModel2 = new ClaimModel(graph.addVertex(null)); |
90 ObjectNode t2 = createToulmin("RDBを利用すべきである。"); | 87 ObjectNode t2 = createToulmin("RDBを利用すべきである。"); |
91 String[] usersClaim2 = { takaaki }; | 88 String[] usersClaim2 = { takaaki }; |
92 createClaimForMention(tpGraph, claimModel2, t2, akifumi, usersClaim2, | 89 createClaimForMention(tpGraph, claimModel2, t2, akifumi, usersClaim2, |
93 NodeModel.DENIED); | 90 NodeModel.DENIED); |
91 // createClaimForMention(tpGraph, claimModel2, t2, akifumi, usersClaim2, | |
92 // NodeModel.UNKNOWN); | |
94 setMentionLabelLatestClaim(tpGraph, claimModel1, claimModel2, | 93 setMentionLabelLatestClaim(tpGraph, claimModel1, claimModel2, |
95 NodeModel.L_REFUTATION); | 94 NodeModel.L_REFUTATION); |
96 | 95 /* */ |
96 claimModel1.computeAndUpdateStatus(); | |
97 copyConsensusTree(tpGraph, claimModel1); | 97 copyConsensusTree(tpGraph, claimModel1); |
98 | 98 |
99 ClaimModel claimModel3 = new ClaimModel(graph.addVertex(null)); | 99 ClaimModel claimModel3 = new ClaimModel(graph.addVertex(null)); |
100 ObjectNode t3 = createToulmin("データ構造はGraphDBに向いている。"); | 100 ObjectNode t3 = createToulmin("データ構造はGraphDBに向いている。"); |
101 String[] usersClaim3 = { akifumi }; | 101 String[] usersClaim3 = { akifumi }; |
102 createClaimForMention(tpGraph,claimModel3, t3, takaaki, usersClaim3, | 102 createClaimForMention(tpGraph,claimModel3, t3, takaaki, usersClaim3, |
103 NodeModel.UNKNOWN); | 103 NodeModel.UNKNOWN); |
104 setMentionLabelLatestClaim(tpGraph, claimModel2, claimModel3, | 104 setMentionLabelLatestClaim(tpGraph, claimModel2, claimModel3, |
105 NodeModel.L_REFUTATION); | 105 NodeModel.L_REFUTATION); |
106 | 106 claimModel2.computeAndUpdateStatus(); |
107 copyConsensusTree(tpGraph, claimModel1); | 107 copyConsensusTree(tpGraph, claimModel1); |
108 | 108 |
109 ClaimModel claimModel4 = new ClaimModel(graph.addVertex(null)); | 109 ClaimModel claimModel4 = new ClaimModel(graph.addVertex(null)); |
110 ObjectNode t4 = createToulmin("どのGraphDBを利用するのか。"); | 110 ObjectNode t4 = createToulmin("どのGraphDBを利用するのか。"); |
111 createClaimForMention(tpGraph, claimModel4, t4, yosiaki, usersClaim2, | 111 createClaimForMention(tpGraph, claimModel4, t4, yosiaki, usersClaim2, |
124 | 124 |
125 copyConsensusTree(tpGraph, claimModel1); | 125 copyConsensusTree(tpGraph, claimModel1); |
126 | 126 |
127 claimModel3.computeAndUpdateStatus(); | 127 claimModel3.computeAndUpdateStatus(); |
128 claimModel2.computeAndUpdateStatus(); | 128 claimModel2.computeAndUpdateStatus(); |
129 | |
129 tpGraph.setLabelStatusToUsers(claimModel1, usersClaim3, NodeModel.L_REQUEST, NodeModel.AGREED); | 130 tpGraph.setLabelStatusToUsers(claimModel1, usersClaim3, NodeModel.L_REQUEST, NodeModel.AGREED); |
130 | 131 |
131 } | 132 } |
132 | 133 |
133 public static ClaimModel getLatestClaim(TPGraph tpGraph, ClaimModel claim) { | 134 public static ClaimModel getLatestClaim(TPGraph tpGraph, ClaimModel claim) { |
186 | 187 |
187 } | 188 } |
188 | 189 |
189 public static void createClaimForMention(TPGraph tpGraph, ClaimModel claim, ObjectNode t, | 190 public static void createClaimForMention(TPGraph tpGraph, ClaimModel claim, ObjectNode t, |
190 String author, String[] users, String type) { | 191 String author, String[] users, String type) { |
191 //createClaimSetToulmin(claim, t, author, users, type); | |
192 createClaimSetToulmin(getLatestClaim(tpGraph, claim), t, author, users, type); | 192 createClaimSetToulmin(getLatestClaim(tpGraph, claim), t, author, users, type); |
193 } | 193 } |
194 | 194 |
195 public static void createFirstClaim(ClaimModel claim, ObjectNode t, | 195 public static void createFirstClaim(ClaimModel claim, ObjectNode t, |
196 String author, String[] users, String type) { | 196 String author, String[] users, String type) { |