本文整理了Java中org.eclipse.rdf4j.query.Update.execute()
方法的一些代码示例,展示了Update.execute()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Update.execute()
方法的具体详情如下:
包路径:org.eclipse.rdf4j.query.Update
类名称:Update
方法名:execute
[英]Execute this update on the repository.
[中]在存储库上执行此更新。
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client
public void execute()
throws UpdateExecutionException
{
delegate.execute();
if (activated) {
for (RepositoryConnectionListener listener : listeners) {
listener.execute(conn, ql, update, baseURI, delegate);
}
}
}
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-repository-event
public void execute()
throws UpdateExecutionException
{
delegate.execute();
if (activated) {
for (RepositoryConnectionListener listener : listeners) {
listener.execute(conn, ql, update, baseURI, delegate);
}
}
}
代码示例来源:origin: eclipse/rdf4j
@Override
public void execute()
throws UpdateExecutionException
{
delegate.execute();
if (activated) {
for (RepositoryConnectionListener listener : listeners) {
listener.execute(conn, ql, update, baseURI, delegate);
}
}
}
代码示例来源:origin: joshsh/sesametools
/**
* Executes the given SPARQL Update queries against the given repository.
*/
private static void executeSparqlUpdateQueries(RepositoryConnection repositoryConnection, List<String> nextQueries)
throws RepositoryException, MalformedQueryException, UpdateExecutionException {
for (String nextQuery : nextQueries) {
logger.info("nextQuery=" + nextQuery);
Update preparedUpdate = repositoryConnection.prepareUpdate(QueryLanguage.SPARQL, nextQuery);
preparedUpdate.execute();
}
}
}
代码示例来源:origin: org.streampipes/streampipes-storage-rdf4j
public void executeUpdate(String sparqlUpdate) throws UpdateExecutionException, RepositoryException, MalformedQueryException {
RepositoryConnection connection = repository.getConnection();
Update tupleQuery;
tupleQuery = connection.prepareUpdate(QueryLanguage.SPARQL, sparqlUpdate);
tupleQuery.execute();
connection.close();
}
代码示例来源:origin: streampipes/streampipes-ce
public void executeUpdate(String sparqlUpdate) throws UpdateExecutionException, RepositoryException, MalformedQueryException {
RepositoryConnection connection = repository.getConnection();
Update tupleQuery;
tupleQuery = connection.prepareUpdate(QueryLanguage.SPARQL, sparqlUpdate);
tupleQuery.execute();
connection.close();
}
代码示例来源:origin: franzinc/agraph-java-client
@Test
public void testInsertNonMatchingWhere()
throws Exception {
logger.debug("executing test testInsertNonMatchingWhere");
StringBuilder update = new StringBuilder();
update.append(getNamespaceDeclarations());
update.append("INSERT { ?x rdfs:label ?y . } WHERE { ?x rdfs:comment ?y }");
Update operation = con.prepareUpdate(QueryLanguage.SPARQL, update.toString());
assertFalse(con.hasStatement(bob, RDFS.LABEL, null, true));
operation.execute();
assertFalse(con.hasStatement(bob, RDFS.LABEL, null, true));
}
代码示例来源:origin: franzinc/agraph-java-client
@Test
public void testCopyToNewNamed()
throws Exception {
logger.debug("executing testCopyToNewNamed");
StringBuilder update = new StringBuilder();
update.append(getNamespaceDeclarations());
update.append("COPY GRAPH ex:graph1 TO ex:graph3");
Update operation = con.prepareUpdate(QueryLanguage.SPARQL, update.toString());
operation.execute();
assertTrue(con.hasStatement(bob, FOAF.NAME, null, false, f.createIRI(EX_NS, "graph3")));
assertTrue(con.hasStatement(bob, FOAF.NAME, null, false, graph1));
}
代码示例来源:origin: franzinc/agraph-java-client
@Test
public void testDropAll()
throws Exception {
logger.debug("executing testDropAll");
String update = "DROP ALL";
Update operation = con.prepareUpdate(QueryLanguage.SPARQL, update);
operation.execute();
assertFalse(con.hasStatement(null, null, null, false));
}
代码示例来源:origin: franzinc/agraph-java-client
@Test
public void testClearAll()
throws Exception {
logger.debug("executing testClearAll");
String update = "CLEAR ALL";
Update operation = con.prepareUpdate(QueryLanguage.SPARQL, update);
operation.execute();
assertFalse(con.hasStatement(null, null, null, false));
}
代码示例来源:origin: franzinc/agraph-java-client
@Test
public void testAddToNewNamed()
throws Exception {
logger.debug("executing testAddToNewNamed");
StringBuilder update = new StringBuilder();
update.append(getNamespaceDeclarations());
update.append("ADD GRAPH ex:graph1 TO ex:graph3");
Update operation = con.prepareUpdate(QueryLanguage.SPARQL, update.toString());
operation.execute();
assertTrue(con.hasStatement(bob, FOAF.NAME, null, false, f.createIRI(EX_NS, "graph3")));
assertTrue(con.hasStatement(bob, FOAF.NAME, null, false, graph1));
}
代码示例来源:origin: franzinc/agraph-java-client
@Test
public void testMoveToNewNamed()
throws Exception {
logger.debug("executing testMoveToNewNamed");
StringBuilder update = new StringBuilder();
update.append(getNamespaceDeclarations());
update.append("MOVE GRAPH ex:graph1 TO ex:graph3");
Update operation = con.prepareUpdate(QueryLanguage.SPARQL, update.toString());
operation.execute();
assertTrue(con.hasStatement(bob, FOAF.NAME, null, false, f.createIRI(EX_NS, "graph3")));
assertFalse(con.hasStatement(null, null, null, false, graph1));
}
代码示例来源:origin: franzinc/agraph-java-client
@Test
public void testInsertEmptyWhere()
throws Exception {
logger.debug("executing test testInsertEmptyWhere");
StringBuilder update = new StringBuilder();
update.append(getNamespaceDeclarations());
update.append("INSERT { <" + bob + "> rdfs:label \"Bob\" . } WHERE { }");
Update operation = con.prepareUpdate(QueryLanguage.SPARQL, update.toString());
assertFalse(con.hasStatement(bob, RDFS.LABEL, f.createLiteral("Bob"), true));
operation.execute();
assertTrue(con.hasStatement(bob, RDFS.LABEL, f.createLiteral("Bob"), true));
}
代码示例来源:origin: franzinc/agraph-java-client
@Test
public void testCopyToExistingNamed()
throws Exception {
logger.debug("executing testCopyToExistingNamed");
StringBuilder update = new StringBuilder();
update.append(getNamespaceDeclarations());
update.append("COPY GRAPH ex:graph1 TO ex:graph2");
Update operation = con.prepareUpdate(QueryLanguage.SPARQL, update.toString());
operation.execute();
assertTrue(con.hasStatement(bob, FOAF.NAME, null, false, graph2));
assertFalse(con.hasStatement(alice, FOAF.NAME, null, false, graph2));
assertTrue(con.hasStatement(bob, FOAF.NAME, null, false, graph1));
}
代码示例来源:origin: franzinc/agraph-java-client
@Test
public void testAddToExistingNamed()
throws Exception {
logger.debug("executing testAddToExistingNamed");
StringBuilder update = new StringBuilder();
update.append(getNamespaceDeclarations());
update.append("ADD GRAPH ex:graph1 TO ex:graph2");
Update operation = con.prepareUpdate(QueryLanguage.SPARQL, update.toString());
operation.execute();
assertTrue(con.hasStatement(bob, FOAF.NAME, null, false, graph2));
assertTrue(con.hasStatement(alice, FOAF.NAME, null, false, graph2));
assertTrue(con.hasStatement(bob, FOAF.NAME, null, false, graph1));
}
代码示例来源:origin: franzinc/agraph-java-client
@Test
public void testDropGraph()
throws Exception {
logger.debug("executing testDropGraph");
StringBuilder update = new StringBuilder();
update.append(getNamespaceDeclarations());
update.append("DROP GRAPH <" + graph1.stringValue() + "> ");
Update operation = con.prepareUpdate(QueryLanguage.SPARQL, update.toString());
operation.execute();
assertFalse(con.hasStatement(null, null, null, false, graph1));
assertTrue(con.hasStatement(null, null, null, false, graph2));
assertTrue(con.hasStatement(null, null, null, false));
}
代码示例来源:origin: franzinc/agraph-java-client
@Test
public void testClearGraph()
throws Exception {
logger.debug("executing testClearGraph");
StringBuilder update = new StringBuilder();
update.append(getNamespaceDeclarations());
update.append("CLEAR GRAPH <" + graph1.stringValue() + "> ");
Update operation = con.prepareUpdate(QueryLanguage.SPARQL, update.toString());
operation.execute();
assertFalse(con.hasStatement(null, null, null, false, graph1));
assertTrue(con.hasStatement(null, null, null, false, graph2));
assertTrue(con.hasStatement(null, null, null, false));
}
代码示例来源:origin: franzinc/agraph-java-client
@Test
public void testInsertNonMatchingWhereWithBindings()
throws Exception {
logger.debug("executing test testInsertNonMatchingWhereWithBindings");
StringBuilder update = new StringBuilder();
update.append(getNamespaceDeclarations());
update.append("INSERT { ?x rdfs:label ?y . } WHERE { ?x rdfs:comment ?y }");
Update operation = con.prepareUpdate(QueryLanguage.SPARQL, update.toString());
operation.setBinding("x", bob);
operation.setBinding("y", f.createLiteral("Bob"));
assertFalse(con.hasStatement(bob, RDFS.LABEL, null, true));
operation.execute();
assertFalse(con.hasStatement(bob, RDFS.LABEL, null, true));
}
代码示例来源:origin: franzinc/agraph-java-client
@Test
public void testClearNamed()
throws Exception {
logger.debug("executing testClearNamed");
String update = "CLEAR NAMED";
Update operation = con.prepareUpdate(QueryLanguage.SPARQL, update);
operation.execute();
assertFalse(con.hasStatement(null, null, null, false, graph1));
assertFalse(con.hasStatement(null, null, null, false, graph2));
assertTrue(con.hasStatement(null, null, null, false));
}
代码示例来源:origin: franzinc/agraph-java-client
@Test
public void testDropNamed()
throws Exception {
logger.debug("executing testDropNamed");
String update = "DROP NAMED";
Update operation = con.prepareUpdate(QueryLanguage.SPARQL, update);
operation.execute();
assertFalse(con.hasStatement(null, null, null, false, graph1));
assertFalse(con.hasStatement(null, null, null, false, graph2));
assertTrue(con.hasStatement(null, null, null, false));
}
内容来源于网络,如有侵权,请联系作者删除!