Package: DummyInferredStorageConnector
DummyInferredStorageConnector
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DummyInferredStorageConnector(StorageConnector) |
|
|
|
|
|
||||||||||||||||||||
containsWithInference(Resource, Property, RDFNode, Collection) |
|
|
|
|
|
||||||||||||||||||||
executeAskQuery(Query, Statement.StatementOntology) |
|
|
|
|
|
||||||||||||||||||||
executeSelectQuery(Query, Statement.StatementOntology) |
|
|
|
|
|
||||||||||||||||||||
executeUpdate(String, Statement.StatementOntology) |
|
|
|
|
|
||||||||||||||||||||
findWithInference(Resource, Property, RDFNode, Collection) |
|
|
|
|
|
||||||||||||||||||||
isConsistent(String) |
|
|
|
|
|
Coverage
1: /**
2: * Copyright (C) 2022 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.jena.exception.JenaDriverException;
18: import cz.cvut.kbss.ontodriver.jena.query.AbstractResultSet;
19: import org.apache.jena.query.Query;
20: import org.apache.jena.rdf.model.Property;
21: import org.apache.jena.rdf.model.RDFNode;
22: import org.apache.jena.rdf.model.Resource;
23: import org.apache.jena.rdf.model.Statement;
24:
25: import java.util.Collection;
26:
27: /**
28: * This connector does not support inference, it wraps a regular {@link StorageConnector} and calls its regular methods
29: * instead of performing any inference, e.g. {@link StorageConnector#contains(Resource, Property, RDFNode, Collection)}
30: * for {@link #containsWithInference(Resource, Property, RDFNode, Collection)}.
31: * <p>
32: * Thus, inference-based methods give the same results as regular connector methods.
33: */
34: class DummyInferredStorageConnector implements InferredStorageConnector {
35:
36: private final StorageConnector connector;
37:
38: DummyInferredStorageConnector(StorageConnector connector) {
39: this.connector = connector;
40: }
41:
42: @Override
43: public Collection<Statement> findWithInference(Resource subject, Property property, RDFNode value,
44: Collection<String> contexts) {
45: return connector.find(subject, property, value, contexts);
46: }
47:
48: @Override
49: public boolean containsWithInference(Resource subject, Property property, RDFNode value,
50: Collection<String> context) {
51: return connector.contains(subject, property, value, context);
52: }
53:
54: @Override
55: public boolean isConsistent(String context) {
56: return true;
57: }
58:
59: @Override
60: public AbstractResultSet executeSelectQuery(Query query,
61: cz.cvut.kbss.ontodriver.Statement.StatementOntology target) throws
62: JenaDriverException {
63: return connector.executeSelectQuery(query, target);
64: }
65:
66: @Override
67: public AbstractResultSet executeAskQuery(Query query,
68: cz.cvut.kbss.ontodriver.Statement.StatementOntology target) throws
69: JenaDriverException {
70: return connector.executeAskQuery(query, target);
71: }
72:
73: @Override
74: public void executeUpdate(String query, cz.cvut.kbss.ontodriver.Statement.StatementOntology target) throws
75: JenaDriverException {
76: connector.executeUpdate(query, target);
77: }
78: }