Mercurial > hg > AnnotationManagerN4J
comparison src/main/java/de/mpiwg/itgroup/annotations/neo4j/AnnotationStore.java @ 9:b2bfc3bc9ba8
new internal actor class for creator.
author | casties |
---|---|
date | Thu, 12 Jul 2012 12:54:46 +0200 |
parents | c3cc6a41dd1c |
children | 90911b2da322 |
comparison
equal
deleted
inserted
replaced
8:c3cc6a41dd1c | 9:b2bfc3bc9ba8 |
---|---|
15 import org.neo4j.graphdb.RelationshipType; | 15 import org.neo4j.graphdb.RelationshipType; |
16 import org.neo4j.graphdb.Transaction; | 16 import org.neo4j.graphdb.Transaction; |
17 import org.neo4j.graphdb.index.Index; | 17 import org.neo4j.graphdb.index.Index; |
18 import org.neo4j.graphdb.index.IndexHits; | 18 import org.neo4j.graphdb.index.IndexHits; |
19 | 19 |
20 import de.mpiwg.itgroup.annotations.Actor; | |
20 import de.mpiwg.itgroup.annotations.Annotation; | 21 import de.mpiwg.itgroup.annotations.Annotation; |
21 import de.mpiwg.itgroup.annotations.Annotation.FragmentTypes; | 22 import de.mpiwg.itgroup.annotations.Annotation.FragmentTypes; |
22 | 23 |
23 /** | 24 /** |
24 * @author casties | 25 * @author casties |
92 "targetFragment", null)); | 93 "targetFragment", null)); |
93 String ft = (String) annotNode.getProperty("fragmentType", null); | 94 String ft = (String) annotNode.getProperty("fragmentType", null); |
94 if (ft != null) { | 95 if (ft != null) { |
95 annot.setFragmentType(FragmentTypes.valueOf(ft)); | 96 annot.setFragmentType(FragmentTypes.valueOf(ft)); |
96 } | 97 } |
97 // get creator form relation | 98 // get creator from relation |
98 Iterable<Relationship> creatorRels = annotNode | 99 Iterable<Relationship> creatorRels = annotNode |
99 .getRelationships(RelationTypes.CREATED); | 100 .getRelationships(RelationTypes.CREATED); |
100 for (Relationship creatorRel : creatorRels) { | 101 for (Relationship creatorRel : creatorRels) { |
101 Node creator = creatorRel.getStartNode(); | 102 Node creatorNode = creatorRel.getStartNode(); |
102 annot.setCreatorUri((String) creator.getProperty("uri", null)); | 103 String uri = (String) creatorNode.getProperty("uri", null); |
103 annot.setCreatorName((String) creator.getProperty("name", null)); | 104 String name = (String) creatorNode.getProperty("name", null); |
105 Actor creator = new Actor(false, uri, name); | |
106 annot.setCreator(creator); | |
104 // just the first one | 107 // just the first one |
105 break; | 108 break; |
106 } | 109 } |
107 annot.setCreated((String) annotNode.getProperty("created", null)); | 110 annot.setCreated((String) annotNode.getProperty("created", null)); |
108 return annot; | 111 return annot; |