@Test public void testReplaceQueryPatternsWithEmptyResults() { final String expectedQueryPlan = "Projection\n" + " ProjectionElemList\n" + " ProjectionElem \"toUri\"\n" + " ProjectionElem \"to\"\n" + " EmptySet\n"; final ParsedQuery query = parseQuery(QUERY); final List<SearchQueryEvaluator> queries = new ArrayList<>(); new DistanceQuerySpecBuilder(new SearchIndexImpl()) .process(query.getTupleExpr(), EmptyBindingSet.getInstance(), queries); assertEquals(1, queries.size()); final DistanceQuerySpec querySpec = (DistanceQuerySpec) queries.get(0); querySpec.replaceQueryPatternsWithResults(new BindingSetAssignment()); assertEquals( expectedQueryPlan, querySpec.getParentQueryModelNode().getParentNode().toString()); }
@Override public QueryModelNode getParentQueryModelNode() { return filter; }
DistanceQuerySpec extends AbstractSearchQueryEvaluator { @Override public QueryModelNode getParentQueryModelNode() { return filter; } }
DistanceQuerySpec extends AbstractSearchQueryEvaluator { @Override public QueryModelNode getParentQueryModelNode() { return filter; } DistanceQuerySpec(FunctionCall distanceFunction, ValueExpr distanceExpr, String distVar, Filter filter);  DistanceQuerySpec(Literal from, IRI units, double dist, String distVar, IRI geoProperty, String geoVar,
			String subjectVar, Var contextVar); }
DistanceQuerySpec extends AbstractSearchQueryEvaluator { @Override public QueryModelNode getParentQueryModelNode() { return filter; } DistanceQuerySpec(FunctionCall distanceFunction, ValueExpr distanceExpr, String distVar, Filter filter);  DistanceQuerySpec(Literal from, IRI units, double dist, String distVar, IRI geoProperty, String geoVar,
			String subjectVar, Var contextVar); void setFrom(Literal from); Literal getFrom(); void setUnits(IRI units); IRI getUnits(); void setDistance(double d); double getDistance(); void setDistanceVar(String varName); String getDistanceVar(); void setGeometryPattern(StatementPattern sp); String getSubjectVar(); Var getContextVar(); IRI getGeoProperty(); String getGeoVar(); void setDistanceFunctionCall(FunctionCall distanceFunction); FunctionCall getDistanceFunctionCall(); ValueExpr getDistanceExpr(); void setFilter(Filter f); Filter getFilter(); @Override QueryModelNode getParentQueryModelNode(); @Override QueryModelNode removeQueryPatterns(); boolean isEvaluable(); }
DistanceQuerySpec extends AbstractSearchQueryEvaluator { @Override public QueryModelNode getParentQueryModelNode() { return filter; } DistanceQuerySpec(FunctionCall distanceFunction, ValueExpr distanceExpr, String distVar, Filter filter);  DistanceQuerySpec(Literal from, IRI units, double dist, String distVar, IRI geoProperty, String geoVar,
			String subjectVar, Var contextVar); void setFrom(Literal from); Literal getFrom(); void setUnits(IRI units); IRI getUnits(); void setDistance(double d); double getDistance(); void setDistanceVar(String varName); String getDistanceVar(); void setGeometryPattern(StatementPattern sp); String getSubjectVar(); Var getContextVar(); IRI getGeoProperty(); String getGeoVar(); void setDistanceFunctionCall(FunctionCall distanceFunction); FunctionCall getDistanceFunctionCall(); ValueExpr getDistanceExpr(); void setFilter(Filter f); Filter getFilter(); @Override QueryModelNode getParentQueryModelNode(); @Override QueryModelNode removeQueryPatterns(); boolean isEvaluable();  }