+ public static RouteImpl getRoute(ReadGraph graph, Resource model, Resource route) throws DatabaseException {
+ Layer0 L0 = Layer0.getInstance(graph);
+ RouteImpl ri = new RouteImpl(graph.getRelatedValue(route, L0.HasLabel, Bindings.STRING))
+ .backend(route)
+ .modelEntity(model)
+ .waypoints(toWaypoints(graph, ListUtils.toList(graph, route)));
+ return ri;
+ }
+
+ public static class RouteRequest extends ResourceRead<RouteImpl> {
+ public RouteRequest(Resource resource) {
+ super(resource);
+ }
+
+ @Override
+ public RouteImpl perform(ReadGraph graph) throws DatabaseException {
+ Resource model = graph.syncRequest(new PossibleModel(resource));
+ return model != null ? getRoute(graph, model, resource) : null;
+ }
+ }
+