Changeset 48:0e00bf8e27fb in AnnotationManagerN4J for src/main/java/de/mpiwg/itgroup/annotations/neo4j/AnnotationStore.java
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/de/mpiwg/itgroup/annotations/neo4j/AnnotationStore.java
r45 r48 488 488 String type = (String) target.getProperty("TYPE"); 489 489 if (type.equals("TARGET")) { 490 annot.setTarget BaseUri((String) target.getProperty("uri", null));490 annot.setTarget(new Target((String) target.getProperty("uri", null))); 491 491 } else if (type.equals("RESOURCE")) { 492 annot.setResource Uri((String) target.getProperty("uri", null));493 } 494 } 495 if (annot.getTarget BaseUri() == null) {492 annot.setResource(new Resource((String) target.getProperty("uri", null))); 493 } 494 } 495 if (annot.getTarget() == null) { 496 496 logger.error("annotation " + annotNode + " has no target node!"); 497 497 } … … 653 653 * the annotation target 654 654 */ 655 String targetBaseUri = annot.getTargetBaseUri();655 Target target = annot.getTarget(); 656 656 Node targetNode = null; 657 if (target BaseUri!= null) {658 targetNode = getOrCreate TargetNode(targetBaseUri, NodeTypes.TARGET);657 if (target != null) { 658 targetNode = getOrCreateUriNode(target.getUri(), NodeTypes.TARGET); 659 659 getOrCreateRelation(annotNode, RelationTypes.ANNOTATES, targetNode); 660 660 } … … 673 673 * the annotation resource 674 674 */ 675 String resourceUri = annot.getResourceUri();676 if (resource Uri!= null) {677 Node resource = getOrCreateTargetNode(resourceUri, NodeTypes.RESOURCE);678 getOrCreateRelation(annotNode, RelationTypes.ANNOTATES, resource );679 getOrCreateRelation(targetNode, RelationTypes.PART_OF, resource );675 Resource resource = annot.getResource(); 676 if (resource != null) { 677 Node resourceNode = getOrCreateUriNode(resource.getUri(), NodeTypes.RESOURCE); 678 getOrCreateRelation(annotNode, RelationTypes.ANNOTATES, resourceNode); 679 getOrCreateRelation(targetNode, RelationTypes.PART_OF, resourceNode); 680 680 } 681 681 … … 892 892 } 893 893 894 protected Node getOrCreate TargetNode(String uri, NodeTypes type) {894 protected Node getOrCreateUriNode(String uri, NodeTypes type) { 895 895 Index<Node> idx = getNodeIndex(type); 896 896 IndexHits<Node> targets = idx.get("uri", uri);
Note: See TracChangeset
for help on using the changeset viewer.