use of org.unipop.query.search.DeferredVertexQuery in project unipop by unipop-graph.
the class RestController method fetchProperties.
@Override
public void fetchProperties(DeferredVertexQuery uniQuery) {
RestCollector<RestVertexSchema, BaseRequest, Vertex> collector = new RestCollector<>(schema -> schema.getSearch(uniQuery), (schema, result) -> schema.parseResults(result, uniQuery));
Map<RestVertexSchema, BaseRequest> schemas = vertexSchemas.stream().filter(schema -> this.traversalFilter.filter(schema, uniQuery.getTraversal())).collect(collector);
Iterator<Vertex> iterator = search(uniQuery, schemas, collector);
Map<Object, DeferredVertex> vertexMap = uniQuery.getVertices().stream().collect(Collectors.toMap(UniElement::id, Function.identity(), (a, b) -> a));
iterator.forEachRemaining(newVertex -> {
DeferredVertex deferredVertex = vertexMap.get(newVertex.id());
if (deferredVertex != null)
deferredVertex.loadProperties(newVertex);
});
}
use of org.unipop.query.search.DeferredVertexQuery in project unipop by unipop-graph.
the class DeferredVertex method validateProperties.
private void validateProperties() {
if (deferred) {
DeferredVertexQuery query = new DeferredVertexQuery(Collections.singletonList(this), null, null, null, null);
this.graph.getControllerManager().getControllers(DeferredVertexQuery.DeferredVertexController.class).forEach(deferredController -> deferredController.fetchProperties(query));
}
}
Aggregations