// test snapshot connection for date2 (i.e. after base import and before updates)
RepositoryConnection snapshot1 = repository.getSnapshot(date2);
// query all triples for http://marmotta.incubator.apache.org/testing/ns1/R1, should be exactly 3
BooleanQuery query1_1 = snapshot1.prepareBooleanQuery(QueryLanguage.SPARQL, "ASK { <http://marmotta.incubator.apache.org/testing/ns1/R1> ?p ?o }");
Assert.assertTrue("SPARQL query for R1 did not return true", query1_1.evaluate());
// query all triples for http://marmotta.incubator.apache.org/testing/ns1/R2, should be zero
BooleanQuery query1_2 = snapshot1.prepareBooleanQuery(QueryLanguage.SPARQL, "ASK { <http://marmotta.incubator.apache.org/testing/ns1/R2> ?p ?o }");
Assert.assertFalse("SPARQL query for R2 did not return false", query1_2.evaluate());
snapshot1.commit();
snapshot1.close();
// test snapshot connection for date3 (i.e. after first update)
RepositoryConnection snapshot2 = repository.getSnapshot(date3);
// query all triples for http://marmotta.incubator.apache.org/testing/ns1/R1, should be exactly 3
BooleanQuery query2_1 = snapshot2.prepareBooleanQuery(QueryLanguage.SPARQL, "ASK { <http://marmotta.incubator.apache.org/testing/ns1/R1> ?p ?o }");
Assert.assertTrue("SPARQL query for R1 did not return true", query2_1.evaluate());
// query all triples for http://marmotta.incubator.apache.org/testing/ns1/R2, should be 3
BooleanQuery query2_2 = snapshot2.prepareBooleanQuery(QueryLanguage.SPARQL, "ASK { <http://marmotta.incubator.apache.org/testing/ns1/R2> ?p ?o }");
Assert.assertTrue("SPARQL query for R2 did not return true", query2_2.evaluate());
snapshot2.commit();
snapshot2.close();