@Test public void accumuloIndexSetTestWithTwoDirectProductBindingSet() 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 AccumuloIndexSet ais = new AccumuloIndexSet(conf, pcjTableName); final QueryBindingSet bs = new QueryBindingSet(); bs.addBinding("birthDate",VF.createLiteral("1983-03-17",VF.createIRI("http: bs.addBinding("location",VF.createIRI("http: final QueryBindingSet bs2 = new QueryBindingSet(); bs2.addBinding("birthDate",VF.createLiteral("1983-04-18",VF.createIRI("http: bs2.addBinding("location",VF.createIRI("http: final Set<BindingSet> bSets = Sets.newHashSet(bs,bs2); final CloseableIteration<BindingSet, QueryEvaluationException> results = ais.evaluate(bSets); final QueryBindingSet alice1 = new QueryBindingSet(); alice1.addBinding("name", VF.createIRI("http: alice1.addBinding("age", VF.createLiteral(BigInteger.valueOf(14))); alice1.addAll(bs); final QueryBindingSet bob1 = new QueryBindingSet(); bob1.addBinding("name", VF.createIRI("http: bob1.addBinding("age", VF.createLiteral(BigInteger.valueOf(16))); bob1.addAll(bs); final QueryBindingSet charlie1 = new QueryBindingSet(); charlie1.addBinding("name", VF.createIRI("http: charlie1.addBinding("age", VF.createLiteral(BigInteger.valueOf(12))); charlie1.addAll(bs); final QueryBindingSet alice2 = new QueryBindingSet(); alice2.addBinding("name", VF.createIRI("http: alice2.addBinding("age", VF.createLiteral(BigInteger.valueOf(14))); alice2.addAll(bs2); final QueryBindingSet bob2 = new QueryBindingSet(); bob2.addBinding("name", VF.createIRI("http: bob2.addBinding("age", VF.createLiteral(BigInteger.valueOf(16))); bob2.addAll(bs2); final QueryBindingSet charlie2 = new QueryBindingSet(); charlie2.addBinding("name", VF.createIRI("http: charlie2.addBinding("age", VF.createLiteral(BigInteger.valueOf(12))); charlie2.addAll(bs2); 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(alice1,bob1,charlie1,alice2,bob2,charlie2), 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);  }