Mercurial > hg > AnnotationManagerN4J
comparison src/main/java/de/mpiwg/itgroup/annotations/neo4j/AnnotationStore.java @ 31:9f653697437e
annotationbrowser
author | dwinter |
---|---|
date | Tue, 25 Sep 2012 21:47:58 +0200 |
parents | 3be0ebb6d5ad |
children | 8427930c5f88 |
comparison
equal
deleted
inserted
replaced
30:05b631a084d0 | 31:9f653697437e |
---|---|
82 if (tagUri == null) return null; | 82 if (tagUri == null) return null; |
83 Node person = getNodeIndex(NodeTypes.TAG).get("uri", tagUri).getSingle(); | 83 Node person = getNodeIndex(NodeTypes.TAG).get("uri", tagUri).getSingle(); |
84 return person; | 84 return person; |
85 } | 85 } |
86 | 86 |
87 | |
88 | |
87 public List<Actor> getActors(String key, String query, NodeTypes type) { | 89 public List<Actor> getActors(String key, String query, NodeTypes type) { |
88 ArrayList<Actor> actors = new ArrayList<Actor>(); | 90 ArrayList<Actor> actors = new ArrayList<Actor>(); |
89 Index<Node> idx = getNodeIndex(type); | 91 Index<Node> idx = getNodeIndex(type); |
90 if (key == null) { | 92 if (key == null) { |
91 key = "uri"; | 93 key = "uri"; |
120 groups.add((Group) group); | 122 groups.add((Group) group); |
121 } | 123 } |
122 return groups; | 124 return groups; |
123 } | 125 } |
124 | 126 |
127 | |
128 /** | |
129 * Returns List of Annotations. | |
130 * Key has to be indexed. | |
131 * | |
132 * @param key | |
133 * @param query | |
134 * @return | |
135 */ | |
136 public List<Annotation> getAnnotations(String key, String query) { | |
137 ArrayList<Annotation> annotations = new ArrayList<Annotation>(); | |
138 Index<Node> idx = getNodeIndex(NodeTypes.ANNOTATION); | |
139 if (key == null) { | |
140 key = "id"; | |
141 query = "*"; | |
142 } | |
143 IndexHits<Node> annotNodes = idx.query(key, query); | |
144 for (Node annotNode : annotNodes) { | |
145 Annotation annotation = createAnnotationFromNode(annotNode); | |
146 annotations.add(annotation); | |
147 } | |
148 return annotations; | |
149 } | |
150 | |
151 | |
125 | 152 |
126 /** | 153 /** |
127 * Returns List of Tags. | 154 * Returns List of Tags. |
128 * Key has to be indexed. | 155 * Key has to be indexed. |
129 * | 156 * |