@Test public void testCollect() throws ProvenanceCollectionException, RepositoryException, MalformedQueryException, QueryEvaluationException { Sail ms = new MemoryStore(); SailRepository repo = new SailRepository(ms); repo.initialize(); TriplestoreProvenanceCollector coll = new TriplestoreProvenanceCollector(repo, "fakeUser", "SPARQL"); coll.recordQuery("fakeQuery"); String queryString = "SELECT ?x ?y WHERE { ?x ?p ?y } "; TupleQuery tupleQuery = repo.getConnection().prepareTupleQuery(QueryLanguage.SPARQL, queryString); TupleQueryResult result = tupleQuery.evaluate(); assertTrue(result.hasNext()); }
public void recordQuery(String query) throws ProvenanceCollectionException { List<Statement> provenanceTriples = provenanceModel.getStatementsForQuery(query, user, queryType); try { provenanceRepo.getConnection().add(provenanceTriples); } catch (RepositoryException e) { throw new ProvenanceCollectionException(e); } }
TriplestoreProvenanceCollector implements ProvenanceCollector { public void recordQuery(String query) throws ProvenanceCollectionException { List<Statement> provenanceTriples = provenanceModel.getStatementsForQuery(query, user, queryType); try { provenanceRepo.getConnection().add(provenanceTriples); } catch (RepositoryException e) { throw new ProvenanceCollectionException(e); } } }
TriplestoreProvenanceCollector implements ProvenanceCollector { public void recordQuery(String query) throws ProvenanceCollectionException { List<Statement> provenanceTriples = provenanceModel.getStatementsForQuery(query, user, queryType); try { provenanceRepo.getConnection().add(provenanceTriples); } catch (RepositoryException e) { throw new ProvenanceCollectionException(e); } } TriplestoreProvenanceCollector(SailRepository repo, String user, String queryType); }
TriplestoreProvenanceCollector implements ProvenanceCollector { public void recordQuery(String query) throws ProvenanceCollectionException { List<Statement> provenanceTriples = provenanceModel.getStatementsForQuery(query, user, queryType); try { provenanceRepo.getConnection().add(provenanceTriples); } catch (RepositoryException e) { throw new ProvenanceCollectionException(e); } } TriplestoreProvenanceCollector(SailRepository repo, String user, String queryType); void recordQuery(String query); }
TriplestoreProvenanceCollector implements ProvenanceCollector { public void recordQuery(String query) throws ProvenanceCollectionException { List<Statement> provenanceTriples = provenanceModel.getStatementsForQuery(query, user, queryType); try { provenanceRepo.getConnection().add(provenanceTriples); } catch (RepositoryException e) { throw new ProvenanceCollectionException(e); } } TriplestoreProvenanceCollector(SailRepository repo, String user, String queryType); void recordQuery(String query);  }