diff --git a/blueprints-graph-sail/src/main/java/com/tinkerpop/blueprints/oupls/sail/pg/PropertyGraphSailConnection.java b/blueprints-graph-sail/src/main/java/com/tinkerpop/blueprints/oupls/sail/pg/PropertyGraphSailConnection.java index a2ee2c04..2b9db865 100644 --- a/blueprints-graph-sail/src/main/java/com/tinkerpop/blueprints/oupls/sail/pg/PropertyGraphSailConnection.java +++ b/blueprints-graph-sail/src/main/java/com/tinkerpop/blueprints/oupls/sail/pg/PropertyGraphSailConnection.java @@ -812,14 +812,13 @@ private CloseableIteration getStatements_xPO(final URI if (null == value) { return new StatementIteration(); } else { - // TODO: lookup matching vertices and edges faster using indices String key = keyFromPredicate(predicate); Source vertices = new Source( - context.graph.getVertices().iterator(), + context.graph.getVertices(key, value).iterator(), vertexPropertiesWithKeyAndValue(key, predicate, value, (Literal) object)); if (firstClassEdges) { Source edges = new Source( - context.graph.getEdges().iterator(), + context.graph.getEdges(key, value).iterator(), edgePropertiesWithKeyAndValue(key, predicate, value, (Literal) object)); return new StatementIteration(vertices, edges); } else { @@ -887,14 +886,13 @@ private CloseableIteration getStatements_xPx(final URI Source edges = new Source(edgeIterator, tails); return new StatementIteration(edges); } else if (isPropertyPredicate(predicate)) { - // TODO: find elements faster using indices String key = keyFromPredicate(predicate); Source vertices = new Source( - context.graph.getVertices().iterator(), + context.graph.query().has(key).vertices().iterator(), vertexPropertiesWithKey(key, predicate)); if (firstClassEdges) { Source edges = new Source( - context.graph.getEdges().iterator(), + context.graph.query().has(key).edges().iterator(), edgePropertiesWithKey(key, predicate)); return new StatementIteration(vertices, edges); } else {