private void insertSparql(final BigdataSailRepositoryConnection cxn) throws Exception { cxn.prepareUpdate(QueryLanguage.SPARQL, INSERT_SPARQL).execute(); }
cxn.prepareUpdate(QueryLanguage.SPARQL, queryStr);
private void executeUpdate(final BigdataSailRepository repo, final String update) throws UpdateExecutionException, RepositoryException, MalformedQueryException { final BigdataSailRepositoryConnection conn = repo.getConnection(); try { Update preparedUpdate = conn.prepareUpdate(QueryLanguage.SPARQL, update); preparedUpdate.execute(); // no exception should occur on execution, overwise test will fail } finally { conn.close(); } }
private void insertSparql(final BigdataSailRepositoryConnection cxn) throws Exception { cxn.prepareUpdate(QueryLanguage.SPARQL, INSERT_SPARQL).execute(); }
private void executeQuery(final BigdataSailRepository repo) throws UpdateExecutionException, RepositoryException, MalformedQueryException { try { repo.initialize(); final BigdataSailRepositoryConnection conn = repo.getConnection(); try { String update = "insert {" + "<http://dbpedia.org/resource/Jules_Verne> <http://dbpedia.org/property/period> \"\"^^<http://www.w3.org/2001/XMLSchema#int>\r\n" + "} where {}"; Update preparedUpdate = conn.prepareUpdate(QueryLanguage.SPARQL, update); preparedUpdate.execute(); // no exception should occur on execution, overwise test will fail } finally { conn.close(); } } finally { repo.shutDown(); } }
cxn.prepareUpdate(QueryLanguage.SPARQL, queryStr);
private void executeUpdate(final BigdataSailRepository repo, final String update) throws UpdateExecutionException, RepositoryException, MalformedQueryException { final BigdataSailRepositoryConnection conn = repo.getConnection(); try { Update preparedUpdate = conn.prepareUpdate(QueryLanguage.SPARQL, update); preparedUpdate.execute(); // no exception should occur on execution, overwise test will fail } finally { conn.close(); } }
" group by ?x having(?c < 500) } \r\n" + "}order by asc(?c) limit 20} }"; Update preparedUpdate = conn.prepareUpdate(QueryLanguage.SPARQL, update); preparedUpdate.execute();
/** * Test whether sparql update results in auto-commit. */ public void testCountCommits() throws Exception { BigdataSailRepositoryConnection cxn = null; final BigdataSail sail = getSail(getProperties()); try { sail.initialize(); final BigdataSailRepository repo = new BigdataSailRepository(sail); cxn = (BigdataSailRepositoryConnection) repo.getConnection(); final CommitCounter counter = new CommitCounter(); cxn.addChangeLog(counter); cxn.prepareUpdate(QueryLanguage.SPARQL, "insert data { <x:s> <x:p> \"foo\" . }").execute(); cxn.prepareUpdate(QueryLanguage.SPARQL, "insert data { <x:s> <x:p> \"bar\" . }").execute(); cxn.commit(); assertTrue(counter.n == 1); } finally { if (cxn != null) cxn.close(); sail.__tearDownUnitTest(); } }
" ?s h:p ?o .\r\n" + "}"; final Update q = conn.prepareUpdate(QueryLanguage.SPARQL, query); q.execute(); assertEquals(n * 2 + 4 /*4 inferred statements about predicates*/, conn.getTripleStore().getStatementCount(true));
private void executeQuery(final BigdataSailRepository repo) throws UpdateExecutionException, RepositoryException, MalformedQueryException { try { repo.initialize(); final BigdataSailRepositoryConnection conn = repo.getConnection(); try { String update = "insert {" + "<http://dbpedia.org/resource/Jules_Verne> <http://dbpedia.org/property/period> \"\"^^<http://www.w3.org/2001/XMLSchema#int>\r\n" + "} where {}"; Update preparedUpdate = conn.prepareUpdate(QueryLanguage.SPARQL, update); preparedUpdate.execute(); // no exception should occur on execution, overwise test will fail } finally { conn.close(); } } finally { repo.shutDown(); } }
" group by ?x having(?c < 500) } \r\n" + "}order by asc(?c) limit 20} }"; Update preparedUpdate = conn.prepareUpdate(QueryLanguage.SPARQL, update); preparedUpdate.execute();
"INSERT { <s:s1> <p:p1> <o:o1> . } where {}"; final Update q = cxn.prepareUpdate(QueryLanguage.SPARQL, update); try {
final Update q = cxn.prepareUpdate(QueryLanguage.SPARQL, update); try {
final Update q = cxn.prepareUpdate(QueryLanguage.SPARQL, update); try {
/** * Test whether sparql update results in auto-commit. */ public void testCountCommits() throws Exception { BigdataSailRepositoryConnection cxn = null; final BigdataSail sail = getSail(getProperties()); try { sail.initialize(); final BigdataSailRepository repo = new BigdataSailRepository(sail); cxn = (BigdataSailRepositoryConnection) repo.getConnection(); final CommitCounter counter = new CommitCounter(); cxn.addChangeLog(counter); cxn.prepareUpdate(QueryLanguage.SPARQL, "insert data { <x:s> <x:p> \"foo\" . }").execute(); cxn.prepareUpdate(QueryLanguage.SPARQL, "insert data { <x:s> <x:p> \"bar\" . }").execute(); cxn.commit(); assertTrue(counter.n == 1); } finally { if (cxn != null) cxn.close(); sail.__tearDownUnitTest(); } }
Update update = con.prepareUpdate(QueryLanguage.SPARQL, updateString, requestFileURL);
"INSERT { <s:s1> <p:p1> <o:o1> . } where {}"; final Update q = cxn.prepareUpdate(QueryLanguage.SPARQL, update); try {
final Update q = cxn.prepareUpdate(QueryLanguage.SPARQL, update); try {
final Update q = cxn.prepareUpdate(QueryLanguage.SPARQL, update); try {