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