Skip to content

Package: StatementExecutor

StatementExecutor

Coverage

1: /**
2: * Copyright (C) 2020 Czech Technical University in Prague
3: *
4: * This program is free software: you can redistribute it and/or modify it under
5: * the terms of the GNU General Public License as published by the Free Software
6: * Foundation, either version 3 of the License, or (at your option) any
7: * later version.
8: *
9: * This program is distributed in the hope that it will be useful, but WITHOUT
10: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12: * details. You should have received a copy of the GNU General Public License
13: * along with this program. If not, see <http://www.gnu.org/licenses/>.
14: */
15: package cz.cvut.kbss.ontodriver.jena.connector;
16:
17: import cz.cvut.kbss.ontodriver.Statement;
18: import cz.cvut.kbss.ontodriver.jena.exception.JenaDriverException;
19: import cz.cvut.kbss.ontodriver.jena.query.AbstractResultSet;
20: import org.apache.jena.query.Query;
21:
22: public interface StatementExecutor {
23:
24: /**
25: * Executes the specified SPARQL SELECT query, returning the Jena ARQ result set.
26: * <p>
27: * The {@code target} specifies whether the query should be executed on the shared repository or whether the transactional
28: * snapshot will be used to evaluate the query. However, some implementations may ignore this parameter.
29: *
30: * @param query Query to execute
31: * @param target Dataset on which the query should be executed
32: * @return ARQ result set
33: * @throws JenaDriverException If query execution fails
34: */
35: AbstractResultSet executeSelectQuery(Query query, Statement.StatementOntology target) throws JenaDriverException;
36:
37: /**
38: * Executes the specified SPARQL ASK query.
39: * <p>
40: * The {@code target} specifies whether the query should be executed on the shared repository or whether the transactional
41: * snapshot will be used to evaluate the query. However, some implementations may ignore this parameter.
42: *
43: * @param query Query to execute
44: * @param target Dataset on which the query should be executed
45: * @return ASK result
46: * @throws JenaDriverException If query execution fails
47: */
48: AbstractResultSet executeAskQuery(Query query, Statement.StatementOntology target) throws JenaDriverException;
49:
50: /**
51: * Executes the specified SPARQL 1.1 Update query.
52: * <p>
53: * The {@code target} specifies whether the query should be executed on the shared repository or whether the transactional
54: * snapshot will be used to evaluate the query. However, some implementations may ignore this parameter.
55: *
56: * @param query Query to execute
57: * @param target Dataset on which the update should be executed
58: * @throws JenaDriverException If query execution fails
59: */
60: void executeUpdate(String query, Statement.StatementOntology target) throws JenaDriverException;
61: }