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