use of org.neo4j.driver.v1.Value in project cypher-for-gremlin by opencypher.
the class GremlinCypherValueConverter method toCypherPath.
@SuppressWarnings("unchecked")
private static Value toCypherPath(List p) {
boolean isNode = true;
Entity[] objects = new Entity[p.size()];
for (int i = 0; i < p.size(); i++) {
if (isNode) {
objects[i] = toCypherNode((Map<?, ?>) p.get(i));
} else {
objects[i] = toCypherRelationship((Map<?, ?>) p.get(i));
}
isNode = !isNode;
}
return new InternalPath(objects).asValue();
}
use of org.neo4j.driver.v1.Value in project neo4j-apoc-procedures by neo4j-contrib.
the class Bolt method toNode.
private Object toNode(Object value, boolean virtual, Map<Long, Object> nodesCache) {
Value internalValue = ((InternalEntity) value).asValue();
Node node = internalValue.asNode();
if (virtual) {
List<Label> labels = new ArrayList<>();
node.labels().forEach(l -> labels.add(Label.label(l)));
VirtualNode virtualNode = new VirtualNode(node.id(), labels.toArray(new Label[0]), node.asMap(), db);
nodesCache.put(node.id(), virtualNode);
return virtualNode;
} else
return Util.map("entityType", internalValue.type().name(), "labels", node.labels(), "id", node.id(), "properties", node.asMap());
}
Aggregations