3
|
1 package models;
|
|
2
|
|
3 import java.util.HashMap;
|
|
4
|
|
5 import com.tinkerpop.blueprints.Vertex;
|
|
6
|
|
7 public class NodeModel {
|
|
8
|
7
|
9 protected Vertex vertex;
|
|
10 protected Object id;
|
3
|
11
|
13
|
12 protected HashMap<Object,Object> properties = new HashMap<Object,Object>();
|
|
13
|
|
14 public static final String ID = "id";
|
|
15
|
|
16
|
|
17 public static final String AUTHOR = "author";
|
|
18 public static final String TYPE = "type";
|
|
19 public static final String MENTIONS = "mentions";
|
|
20
|
|
21
|
|
22 public static final String QUESTION = "question";
|
|
23 public static final String REFUTATION = "refutation";
|
3
|
24
|
13
|
25 public static final String MAJORITY = "majority";
|
|
26 public static final String UNANIMOUSLY = "unanimously";
|
|
27
|
|
28 /*
|
|
29 * User property
|
|
30 */
|
|
31 public static final String CONSENSUS = "consensus";
|
|
32 public static final String CLAIMS = "claims";
|
|
33 public static final String REQUESTS = "requests";
|
3
|
34
|
13
|
35 /*
|
|
36 * Claim property
|
|
37 */
|
|
38 public static final String TOULMIN = "toulmin";
|
|
39 public static final String TITLE = "title";
|
|
40 public static final String CONTENTS = "contents";
|
|
41 public static final String QUALIFIER = "q";
|
|
42 public static final String DATA = "d";
|
|
43 public static final String WARRANT = "w";
|
|
44 public static final String BACKING = "b";
|
|
45 public static final String REBUTTLE = "r";
|
|
46 public static final String USERS = "users";
|
|
47 public static final String STATUS = "status";
|
|
48 // Status statement
|
|
49 public static final String PASS = "pass";
|
|
50 public static final String FAIL = "fail";
|
|
51 public static final String AGREED = "agreed";
|
|
52 public static final String DENIED = "denied";
|
|
53
|
3
|
54
|
|
55 public NodeModel(Vertex vertex) {
|
|
56 this.vertex = vertex;
|
|
57 this.id = vertex.getId();
|
|
58 }
|
7
|
59
|
3
|
60 public void setId(Object id) {
|
|
61 this.id = id;
|
|
62 }
|
|
63
|
|
64 public Object getId() {
|
|
65 return this.id;
|
|
66 }
|
|
67
|
|
68 public Vertex getVertex() {
|
|
69 return this.vertex;
|
|
70 }
|
13
|
71
|
|
72 public void setProperty(String key, Object value) {
|
|
73 this.vertex.setProperty(key, value);
|
|
74 }
|
|
75
|
|
76 public HashMap<Object,Object> getAllProperty() {
|
|
77 for (String key : vertex.getPropertyKeys()) {
|
|
78 properties.put(key, vertex.getProperty(key));
|
|
79 }
|
|
80 return properties;
|
|
81 }
|
|
82
|
7
|
83
|
12
|
84
|
3
|
85 }
|