@Override public Map<String,Object> getRelationshipProperties( long relId ) { return delegate.getRelationshipProperties( relId ); }
private Map<String,Object> getRelationshipProperties( BatchInserter inserter, long relId ) { return inserter.getRelationshipProperties( relId ); } }
@Test public void createEntitiesWithEmptyPropertiesMap() { BatchInserter inserter = globalInserter; // Assert for node long nodeId = inserter.createNode( map() ); getNodeProperties( inserter, nodeId ); //cp=N U http://www.w3.org/1999/02/22-rdf-syntax-ns#type, c=N // Assert for relationship long anotherNodeId = inserter.createNode( null ); long relId = inserter.createRelationship( nodeId, anotherNodeId, RelTypes.BATCH_TEST, map() ); inserter.getRelationshipProperties( relId ); }
@Override public Map<String,Object> getRelationshipProperties( long relId ) { return delegate.getRelationshipProperties( relId ); }
/** * {@inheritDoc} */ @Override public Iterable<String> getPropertyKeys() { return batchInserter.getRelationshipProperties(id).keySet(); }
/** * {@inheritDoc} */ @Override @Deprecated public Iterable<Object> getPropertyValues() { return batchInserter.getRelationshipProperties(id).values(); } }
@Override public <T> Optional<T> getRelationshipProperty(long relationship, String property, Class<T> type) { Map<String, Object> propertyMap; synchronized (graphLock) { propertyMap = inserter.getRelationshipProperties(relationship); } if (propertyMap.containsKey(property)) { return Optional.<T> of(type.cast(propertyMap.get(property))); } else { return Optional.empty(); } }
@Override public <T> Collection<T> getRelationshipProperties(long relationship, String property, Class<T> type) { Map<String, Object> propertyMap; synchronized (graphLock) { propertyMap = inserter.getRelationshipProperties(relationship); } if (propertyMap.containsKey(property)) { return GraphUtil.getPropertiesAsSet(propertyMap.get(property), type); } else { return emptyList(); } }
public Map<String, Object> getPropertyMap() { return this.graph.getRawGraph().getRelationshipProperties(this.id); }
public Map<String, Object> getPropertyMap() { return this.graph.getRawGraph().getRelationshipProperties(this.id); }
/** * {@inheritDoc} */ @Override public Object getProperty(String key) { if (!hasProperty(key)) { throw new NotFoundException(); } return batchInserter.getRelationshipProperties(id).get(key); }
@Override public void addRelationshipProperty(long relationship, String property, Object value) { if (GraphUtil.ignoreProperty(value)) { return; } synchronized(graphLock) { Map<String, Object> propertyMap = inserter.getRelationshipProperties(relationship); if (propertyMap.containsKey(property)) { Object originalValue = propertyMap.get(property); Object newValue = GraphUtil.getNewPropertyValue(originalValue, value); Map<String, Object> properties = Maps.newHashMap(propertyMap); properties.put(property, newValue); synchronized (graphLock) { inserter.setRelationshipProperties(relationship, properties); } } else { setRelationshipProperty(relationship, property, value); } } }
private static boolean createRelationship(BatchInserter targetDb, BatchInserter sourceDb, BatchRelationship rel, Set<String> ignoreProperties, PrimitiveLongLongMap copiedNodeIds) { long startNodeId = copiedNodeIds.get(rel.getStartNode()); long endNodeId = copiedNodeIds.get(rel.getEndNode()); if (startNodeId == -1L || endNodeId == -1L) return false; final RelationshipType type = rel.getType(); try { Map<String, Object> props = getProperties(sourceDb.getRelationshipProperties(rel.getId()), ignoreProperties); // if (props.isEmpty()) props = Collections.<String,Object>singletonMap("old_id",rel.getId()); else props.put("old_id",rel.getId()); targetDb.createRelationship(startNodeId, endNodeId, type, props); return true; } catch (Exception e) { addLog(rel, "create Relationship: " + startNodeId + "-[:" + type + "]" + "->" + endNodeId, e.getMessage()); return false; } }