Skip to content

Package: Rdf4jOntoDriverProperties

Rdf4jOntoDriverProperties

nameinstructionbranchcomplexitylinemethod
Rdf4jOntoDriverProperties()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /**
2: * Copyright (C) 2022 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.rdf4j.config;
14:
15: public abstract class Rdf4jOntoDriverProperties {
16:
17: /**
18: * Specifies whether a in-memory storage should be used for local RDF4J repositories.
19: * <p>
20: * When set to true, any local RDF4J repositories that are created by the driver are created as only MemoryStores
21: * without any persistent backend. Repositories accessed over the Internet or already existing locally are not
22: * affected by this setting.
23: * <p>
24: * {@code Boolean} value expected, default is false.
25: */
26: public static final String USE_VOLATILE_STORAGE = "cz.cvut.kbss.ontodriver.rdf4j.use-volatile-storage";
27:
28: /**
29: * Specifies whether RDF4J inference (RDFS, forward chaining) should be used.
30: * <p>
31: * Note that this setting applies only to local storages (in memory or native), remote storages use their own
32: * inference settings.
33: * <p>
34: * {@code Boolean} value expected, default is false.
35: */
36: public static final String USE_INFERENCE = "cz.cvut.kbss.ontodriver.rdf4j.use-inference";
37:
38: /**
39: * Specifies how many requested assertions suffice to perform load all.
40: * <p>
41: * More specifically, if the number of assertions requested by an {@link cz.cvut.kbss.ontodriver.descriptor.AxiomDescriptor}
42: * is low enough, the statements for them will be loaded by asking RDF4J for statements with subject and property
43: * bound.
44: * <p>
45: * Otherwise, statements will be loaded using only subject bound and will be filtered according to the assertions.
46: * This will in most cases have better performance than loading with bound property.
47: */
48: public static final String LOAD_ALL_THRESHOLD = "cz.cvut.kbss.ontodriver.rdf4j.load-all-threshold";
49:
50: /**
51: * Path to repository configuration file.
52: * <p>
53: * The configuration file is a Turtle file corresponding to the repository config file schema defined by RDF4J. See
54: * for example <a href="http://docs.rdf4j.org/server-workbench-console/#_repository_configuration_templates_advanced">
55: * http://docs.rdf4j.org/server-workbench-console/#_repository_configuration_templates_advanced</a>
56: * <p>
57: * Sample configuration files are available in the RDF4J GitHub repo:
58: * <a href="https://github.com/eclipse/rdf4j/tree/master/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config">
59: * https://github.com/eclipse/rdf4j/tree/master/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config</a>
60: * <p>
61: * The config file can be present on the classpath (if the value starts with the {@code classpath:} prefix) or can
62: * be loaded using the value as file path. The loaded configuration supersedes relevant properties passed to the
63: * driver, e.g., {@link #USE_VOLATILE_STORAGE} or {@link #USE_INFERENCE}.
64: * <p>
65: * Note that the config applies only to embedded repositories created by the driver, repositories on a RDF4J
66: * server to which the driver just connects must preexist and the configuration does not apply to them. The physical
67: * URI specified in configuration must correspond to the URI of the repository in the config file, i.e., for memory
68: * store, the repository ID must be the same. For a native store, the physical URI must be in the form {@code
69: * /local-path/repositories/repository-id}, where {@code local-path} will be used for initialization of a local
70: * {@link org.eclipse.rdf4j.repository.manager.RepositoryManager} and {@code repository-id} must again correspond to
71: * the repository ID in the configuration file.
72: */
73: public static final String REPOSITORY_CONFIG = "cz.cvut.kbss.ontodriver.rdf4j.repository-config";
74:
75: /**
76: * Number of attempts to reconnect to the repository in case of connection issues.
77: * <p>
78: * This setting applies only when using a remote rdf4j-server repository (including GraphDB). Applies also when
79: * initial connection on startup is attempted.
80: * <p>
81: * Note that once connection is successful, the counter of failed attempts is reset.
82: */
83: public static final String RECONNECT_ATTEMPTS = "cz.cvut.kbss.ontodriver.rdf4j.reconnect-attempts";
84:
85: /**
86: * Whether inferred assertion values are expected to exist in the default repository context.
87: * <p>
88: * Normally, RDF4J stores inferred statements in the context of the statement from which they were inferred.
89: * However, if one uses SPIN rules or custom inference rules
90: * <a href="https://rdf4j.org/documentation/programming/repository/#custom-inferencing">https://rdf4j.org/documentation/programming/repository/#custom-inferencing</a>,
91: * their results will be stored in the default context. Setting this parameter to {@code true} will cause the
92: * statement loading to use the default context for loading inferred assertions.
93: * <p>
94: * Note that GraphDB inference is handled automatically and does not need this parameter. However, setting it will
95: * override the default automatic inference context resolution for GraphDB.
96: * <p>
97: * Defaults to {@code false}, i.e., inferred statements are expected in the same context as their causes.
98: */
99: public static final String INFERENCE_IN_DEFAULT_CONTEXT =
100: "cz.cvut.kbss.ontodriver.rdf4j.inference-in-default-context";
101:
102: private Rdf4jOntoDriverProperties() {
103: throw new AssertionError();
104: }
105: }