@Test public void accumuloIndexSetTestWithTwoDirectProductBindingSetsWithMapping() throws RepositoryException, PcjException, TableNotFoundException, RyaTypeResolverException, MalformedQueryException, SailException, QueryEvaluationException, AccumuloException, AccumuloSecurityException { final Set<Statement> triples = new HashSet<>(); triples.add( VF.createStatement(VF.createIRI("http: triples.add( VF.createStatement(VF.createIRI("http: triples.add( VF.createStatement(VF.createIRI("http: triples.add( VF.createStatement(VF.createIRI("http: triples.add( VF.createStatement(VF.createIRI("http: triples.add( VF.createStatement(VF.createIRI("http: triples.add( VF.createStatement(VF.createIRI("http: triples.add( VF.createStatement(VF.createIRI("http: for(final Statement triple : triples) { ryaConn.add(triple); } final String sparql = "SELECT ?name ?age " + "{" + "FILTER(?age < 30) ." + "?name <http: "?name <http: "}"; final String pcjTableName = new PcjTableNameFactory().makeTableName(prefix, "testPcj"); PcjIntegrationTestingUtil.createAndPopulatePcj(ryaConn, accumuloConn, pcjTableName, sparql, new String[]{"name", "age"}, Optional.absent()); final String sparql2 = "SELECT ?x ?y " + "{" + "FILTER(?y < 30) ." + "?x <http: "?x <http: "}"; final SPARQLParser p = new SPARQLParser(); final ParsedQuery pq = p.parseQuery(sparql2, null); final Map<String,String> map = new HashMap<>(); map.put("x", "name"); map.put("y", "age"); final AccumuloIndexSet ais = new AccumuloIndexSet(conf, pcjTableName); ais.setProjectionExpr((Projection) pq.getTupleExpr()); ais.setTableVarMap(map); ais.setSupportedVariableOrderMap(Lists.newArrayList("x;y","y;x")); final QueryBindingSet bs = new QueryBindingSet(); bs.addBinding("birthDate",VF.createLiteral("1983-03-17",VF.createIRI("http: bs.addBinding("x",VF.createIRI("http: final QueryBindingSet bs2 = new QueryBindingSet(); bs2.addBinding("birthDate",VF.createLiteral("1983-04-18",VF.createIRI("http: bs2.addBinding("x",VF.createIRI("http: final Set<BindingSet> bSets = Sets.newHashSet(bs,bs2); final CloseableIteration<BindingSet, QueryEvaluationException> results = ais.evaluate(bSets); final QueryBindingSet alice = new QueryBindingSet(); alice.addBinding("x", VF.createIRI("http: alice.addBinding("y", VF.createLiteral(BigInteger.valueOf(14))); alice.addBinding("birthDate", VF.createLiteral("1983-03-17",VF.createIRI("http: final QueryBindingSet bob = new QueryBindingSet(); bob.addBinding("x", VF.createIRI("http: bob.addBinding("y", VF.createLiteral(BigInteger.valueOf(16))); bob.addBinding("birthDate", VF.createLiteral("1983-04-18",VF.createIRI("http: final Set<BindingSet> fetchedResults = new HashSet<>(); while(results.hasNext()) { final BindingSet next = results.next(); System.out.println(next); fetchedResults.add(next); } Assert.assertEquals(Sets.<BindingSet>newHashSet(alice,bob), fetchedResults); }
@Override public CloseableIteration<BindingSet, QueryEvaluationException> evaluate( final BindingSet bindingset) throws QueryEvaluationException { return this.evaluate(Collections.singleton(bindingset)); }
AccumuloIndexSet extends ExternalTupleSet implements
		ExternalBatchingIterator { @Override public CloseableIteration<BindingSet, QueryEvaluationException> evaluate( final BindingSet bindingset) throws QueryEvaluationException { return this.evaluate(Collections.singleton(bindingset)); } }
AccumuloIndexSet extends ExternalTupleSet implements
		ExternalBatchingIterator { @Override public CloseableIteration<BindingSet, QueryEvaluationException> evaluate( final BindingSet bindingset) throws QueryEvaluationException { return this.evaluate(Collections.singleton(bindingset)); } AccumuloIndexSet(final String sparql, final Configuration conf,
			final String tablename);  AccumuloIndexSet(final Configuration conf, final String tablename); }
AccumuloIndexSet extends ExternalTupleSet implements
		ExternalBatchingIterator { @Override public CloseableIteration<BindingSet, QueryEvaluationException> evaluate( final BindingSet bindingset) throws QueryEvaluationException { return this.evaluate(Collections.singleton(bindingset)); } AccumuloIndexSet(final String sparql, final Configuration conf,
			final String tablename);  AccumuloIndexSet(final Configuration conf, final String tablename); @Override Map<String, Set<String>> getSupportedVariableOrders(); @Override String getSignature(); @Override double cardinality(); @Override CloseableIteration<BindingSet, QueryEvaluationException> evaluate(
			final BindingSet bindingset); @Override CloseableIteration<BindingSet, QueryEvaluationException> evaluate(
			final Collection<BindingSet> bindingset); }
AccumuloIndexSet extends ExternalTupleSet implements
		ExternalBatchingIterator { @Override public CloseableIteration<BindingSet, QueryEvaluationException> evaluate( final BindingSet bindingset) throws QueryEvaluationException { return this.evaluate(Collections.singleton(bindingset)); } AccumuloIndexSet(final String sparql, final Configuration conf,
			final String tablename);  AccumuloIndexSet(final Configuration conf, final String tablename); @Override Map<String, Set<String>> getSupportedVariableOrders(); @Override String getSignature(); @Override double cardinality(); @Override CloseableIteration<BindingSet, QueryEvaluationException> evaluate(
			final BindingSet bindingset); @Override CloseableIteration<BindingSet, QueryEvaluationException> evaluate(
			final Collection<BindingSet> bindingset);  }