return vertex.getProperty(Properties.value.name());
}
public Edge createEdgeFor(Vertex fromVertex, Vertex toVertex, Property property) {
String edgeNameFor = GraphUtils.getEdgeNameFor(property);
Edge edge = database.addEdge(getEdgeId(fromVertex, toVertex, property), fromVertex, toVertex, edgeNameFor);
String predicateProperty = GraphUtils.asSailProperty(GraphUtils.getEdgeNameFor(property));
edge.setProperty(GraphSail.PREDICATE_PROP, predicateProperty);
Collection<String> contexts = getLens();
StringBuilder contextPropertyBuilder = new StringBuilder();
if (contexts.size() == 0) {
contextPropertyBuilder.append(GraphUtils.asSailProperty(GraphSail.NULL_CONTEXT_NATIVE));
} else {
for (String context : contexts) {
if (contextPropertyBuilder.length() > 0)
contextPropertyBuilder.append(" ");
contextPropertyBuilder.append(GraphUtils.asSailProperty(context));
}
}
String contextProperty = contextPropertyBuilder.toString();
edge.setProperty(GraphSail.CONTEXT_PROP, contextProperty);
// Finally build the context-predicate property by concatenating both
edge.setProperty(GraphSail.CONTEXT_PROP + GraphSail.PREDICATE_PROP, contextProperty + " " + predicateProperty);
return edge;
}