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) 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: }