Skip to content

Package: InferredStorageConnector

InferredStorageConnector

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 org.apache.jena.rdf.model.Property;
16: import org.apache.jena.rdf.model.RDFNode;
17: import org.apache.jena.rdf.model.Resource;
18: import org.apache.jena.rdf.model.Statement;
19:
20: import java.util.Collection;
21:
22: public interface InferredStorageConnector extends StatementExecutor {
23:
24: /**
25: * Retrieves statements corresponding to the specified criteria from the specified named graph.
26: * <p>
27: * The first three parameters are optional, their absence signifies that any value in that position is acceptable.
28: * <p>
29: * {@code contexts} are also optional, their absence means that the default graph should be used.
30: *
31: * @param subject Statement subject, optional
32: * @param property Property, optional
33: * @param value Value, optional
34: * @param contexts Named graph URIs, optional. Empty collection indicates the default graph should be used
35: * @return Collection of matching statements, including inferred ones
36: */
37: Collection<Statement> findWithInference(Resource subject, Property property, RDFNode value,
38: Collection<String> contexts);
39:
40: /**
41: * Checks whether the specified context (named graph) contains any statements matching the specified criteria,
42: * either asserted or inferred.
43: * <p>
44: * The first three parameters are optional, their absence signifies that any value in that position is acceptable.
45: * <p>
46: * {@code context} is also optional, its absence means that the default graph should be used.
47: *
48: * @param subject Subject, optional
49: * @param property Property, optional
50: * @param value Value, optional
51: * @param contexts Named graph IRIs, optional. Empty collection indicates the default graph should be used
52: * @return {@code true} if at least one statement matches the criteria, {@code false} otherwise
53: */
54: boolean containsWithInference(Resource subject, Property property, RDFNode value, Collection<String> contexts);
55:
56: /**
57: * Checks whether named graph with the specified IRI is consistent.
58: *
59: * @param context Named graph IRI, optional
60: * @return Whether the graph is consistent
61: */
62: boolean isConsistent(String context);
63: }