Skip to content

Package: DummyInferredStorageConnector

DummyInferredStorageConnector

nameinstructionbranchcomplexitylinemethod
DummyInferredStorageConnector(StorageConnector)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
containsWithInference(Resource, Property, RDFNode, Collection)
M: 0 C: 8
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
executeAskQuery(Query, Statement.StatementOntology)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
executeSelectQuery(Query, Statement.StatementOntology)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
executeUpdate(String, Statement.StatementOntology)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
findWithInference(Resource, Property, RDFNode, Collection)
M: 0 C: 8
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
isConsistent(String)
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (C) 2020 Czech Technical University in Prague
3: * <p>
4: * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
5: * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
6: * version.
7: * <p>
8: * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
9: * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
10: * details. You should have received a copy of the GNU General Public License along with this program. If not, see
11: * <http://www.gnu.org/licenses/>.
12: */
13: package cz.cvut.kbss.ontodriver.jena.connector;
14:
15: import cz.cvut.kbss.ontodriver.jena.exception.JenaDriverException;
16: import cz.cvut.kbss.ontodriver.jena.query.AbstractResultSet;
17: import org.apache.jena.query.Query;
18: import org.apache.jena.rdf.model.Property;
19: import org.apache.jena.rdf.model.RDFNode;
20: import org.apache.jena.rdf.model.Resource;
21: import org.apache.jena.rdf.model.Statement;
22:
23: import java.util.Collection;
24:
25: /**
26: * This connector does not support inference, it wraps a regular {@link StorageConnector} and calls its regular methods
27: * instead of performing any inference, e.g. {@link StorageConnector#contains(Resource, Property, RDFNode, Collection)}
28: * for {@link #containsWithInference(Resource, Property, RDFNode, Collection)}.
29: * <p>
30: * Thus, inference-based methods give the same results as regular connector methods.
31: */
32: class DummyInferredStorageConnector implements InferredStorageConnector {
33:
34: private final StorageConnector connector;
35:
36: DummyInferredStorageConnector(StorageConnector connector) {
37: this.connector = connector;
38: }
39:
40: @Override
41: public Collection<Statement> findWithInference(Resource subject, Property property, RDFNode value,
42: Collection<String> contexts) {
43: return connector.find(subject, property, value, contexts);
44: }
45:
46: @Override
47: public boolean containsWithInference(Resource subject, Property property, RDFNode value,
48: Collection<String> context) {
49: return connector.contains(subject, property, value, context);
50: }
51:
52: @Override
53: public boolean isConsistent(String context) {
54: return true;
55: }
56:
57: @Override
58: public AbstractResultSet executeSelectQuery(Query query,
59: cz.cvut.kbss.ontodriver.Statement.StatementOntology target) throws
60: JenaDriverException {
61: return connector.executeSelectQuery(query, target);
62: }
63:
64: @Override
65: public AbstractResultSet executeAskQuery(Query query,
66: cz.cvut.kbss.ontodriver.Statement.StatementOntology target) throws
67: JenaDriverException {
68: return connector.executeAskQuery(query, target);
69: }
70:
71: @Override
72: public void executeUpdate(String query, cz.cvut.kbss.ontodriver.Statement.StatementOntology target) throws
73: JenaDriverException {
74: connector.executeUpdate(query, target);
75: }
76: }