Skip to content

Package: InferredStorageConnector

InferredStorageConnector

Coverage

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