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