returned.loadInitialPath(path);
returned.push(source);
while(returned.hasPath()) {
Property currentProperty = returned.nextInPath();
Vertex currentVertex = returned.vertex();
Iterable<Edge> outEdges = strategy.getOutEdgesFor(currentVertex, currentProperty);
Iterator<Edge> edges = outEdges.iterator();
returned.push(currentProperty);
if(edges.hasNext()) {
returned.push(edges.next().getVertex(Direction.IN));
} else {
/*
* maybe that property can contain literal value.
* This literal value can be stored either as a direct literal (type is a literal one) or using the infamous
* TUples.serializables, in which case further analysis must be performed ...
*/
Class<?> propertyType = currentProperty.getType();
if(driver.getRepository().containsKey(propertyType)) {
returned.setNavigationSuccessfull(false);
} else {
Object value = currentVertex.getProperty(GraphUtils.getEdgeNameFor(currentProperty));
if(Literals.containsKey(propertyType)) {
returned.setNavigationSuccessfull(endNavigationForLiteral(value));
} else if(Tuples.containsKey(propertyType)) {
returned.setNavigationSuccessfull(endNavigationForTuple(currentProperty, currentVertex, propertyType, value));
}