Skip to content

Package: InferredStorageConnector

InferredStorageConnector

Coverage

1: /**
2: * Copyright (C) 2019 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 context} is also optional, its 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 context Named graph URI, optional
37: * @return Collection of matching statements, including inferred ones
38: */
39: Collection<Statement> findWithInference(Resource subject, Property property, RDFNode value, String context);
40:
41: /**
42: * Checks whether the specified context (named graph) contains any statements matching the specified criteria, 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 context Named graph IRI, optional
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, String context);
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: }