Configuring a repository¶
Before you start adding or changing the parameter values, we recommend planning your repository configuration and familiarizing yourself with what each of the parameters does, what data structures GraphDB supports, and what configuration values are optimal for your setup.
What’s in this document?
Plan a repository configuration¶
The following sections will help you plan your repository configuration:
Configure a repository through the GraphDB Workbench¶
This section describes the fields on the configuration form that you use to create a new repository and to edit the settings of an existing repository. To edit the settings of an existing one, click the Edit repository icon on the Repositories screen.
Repository ID: Unique identifier for the repository. The ID must contain only letters (a-z, A-Z), numbers (0-9), and the characters ‘-‘ and ‘_’. This is a required field when creating a new repository. When editing the configuration of an existing one, click the edit icon
shown with this field to change the repository ID value. )
Repository description: Human readable description of the repository.
Read-only: Prevents any edits to the repository’s data.
Encrypted: Makes the repository data encrypted using the Encryption at rest mechanism.
Warning
To create an encrypted repository, you must first provide GraphDB with a Master Key.
You cannot change whether a repository is encrypted or not. Once a repository has been created encrypted, the encryption cannot be removed, and vice versa — an unencrypted repository cannot be encrypted.
This may also affect the Backup and restore procedures.
Inference and Validation
Ruleset: Sets of axiomatic triples, consistency checks and entailment rules, that determine the applied semantics with a PIE file. When creating a repository, a Custom ruleset button with this field lets you upload a custom ruleset.
Disable owl:sameAs: GraphDB uses a non-rule implementation of
owl:sameAsthat can be enabled or disabled independently of the ruleset.Enable consistency checks: Enables Consistency checks with the ruleset.
Enable SHACL validation: Enables support for SHACL validation in this repository. If selected, a SHACL options link displays additional options, described at Creating and configuring a SHACL repository, that let you customize GraphDB’s use of SHACL.
Indexing
Entity ID size: Select 32-bit or 40-bit to define the bit size of internal IDs used to index entities such as URIs, blank nodes, literals, and RDF* embedded triples. Use 40-bit ID only if you expect more than 2 billion unique RDF values.
Note
Using 40-bit entity IDs requires a GraphDB Enterprise or Standard license.
Enable context index: Builds an additional Context-Predicate-Subject-Object index to boost the SPARQL query performance of queries with
GRAPH,FROM, andFROM NAMEDclauses.Enable predicate list index: Enables the mappings from an entity (subject or object) to its predicates; this can significantly speed up queries that use wildcard predicate patterns.
Enable full-text search (FTS) index: Enables the use of Full-text search with this repository.
FTS indexes to build (comma delimited): List of languages that should have a specific index with appropriate analyzer for full-text search. Possible values: default, iri, ar, bg, bn, br, ca, ja, ko, zh, ku, cz, da, de, el, en, es, et, eu, fa, fi, fr, ga, gl, hi, hu, hy, id, it, lt, lv, ne, nl, no, pt, ro, ru, sr, sv, ta, te, th, tr.
FTS index for xsd:string literals: The index in which the string literals (
xsd:string) are indexed. Possible values are: none, default or a two-letter language code.FTS index for full-text indexing of IRIs: The index in which the IRIs are indexed for full-text search. Possible values are: none, default or a two-letter language code.
Queries and Updates
Query timeout (seconds): Sets the number of seconds after which the evaluation of a query will be terminated; values less than or equal to zero mean no limit. The Throw exception on query timeout checkbox with this field sets the repository to throw a
QueryEvaluationExceptionwhen the duration of a query execution exceeds the timeout parameter.Limit query results: Sets the number of seconds after which the evaluation of a query will be terminated. Values less than or equal to zero mean no limit.
Restart repository: (Only displayed when editing an existing repository’s configuration) checking this indicates that when you click the form’s Save button you want the repository restarted with the new settings applied.
Note
If you need a repository with SHACL validation enabled , you must enable this option at configuration time. SHACL validation cannot be enabled after the repository has been created.
Edit a repository configuration using Workbench¶
Some of the parameters you specify at repository creation time can be changed at any point.
On the Repositories screen, click the Edit icon
next to a repository to display the form that lets you edit the repository’s parameters. The documentation page Configure a repository through the GraphDB Workbench describes the fields on this form.
Restart the repository for the changes to take effect.
Configure a repository programmatically¶
Tip
GraphDB uses an RDF4J configuration template to configure its repositories. RDF4J keeps the repository configurations with their parameters modeled in RDF. Therefore, in order to create a new repository, RDF4J needs such an RDF file.
To configure a new repository programmatically:
Fill in the
graphdb.ttlconfiguration template that can be found in the/configs/templatesdirectory of the GraphDB distribution. The parameters are described in the Configuration parameters section. Here is an example:# Example RDF4J configuration template for a GraphDB repository named "wines" @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix rep: <http://www.openrdf.org/config/repository#> . @prefix sail: <http://www.openrdf.org/config/sail#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . <#wines> a rep:Repository; rep:repositoryID "wines"; rep:repositoryImpl [ rep:repositoryType "graphdb:SailRepository"; <http://www.openrdf.org/config/repository/sail#sailImpl> [ <http://www.ontotext.com/config/graphdb#base-URL> "http://example.org/owlim#"; <http://www.ontotext.com/config/graphdb#check-for-inconsistencies> "false"; <http://www.ontotext.com/config/graphdb#defaultNS> ""; <http://www.ontotext.com/config/graphdb#disable-sameAs> "true"; <http://www.ontotext.com/config/graphdb#enable-context-index> "false"; <http://www.ontotext.com/config/graphdb#enable-fts-index> "false"; <http://www.ontotext.com/config/graphdb#enable-literal-index> "true"; <http://www.ontotext.com/config/graphdb#enablePredicateList> "true"; <http://www.ontotext.com/config/graphdb#entity-id-size> "32"; <http://www.ontotext.com/config/graphdb#entity-index-size> "10000000"; <http://www.ontotext.com/config/graphdb#fts-indexes> ("default" "iri"); <http://www.ontotext.com/config/graphdb#fts-iris-index> "none"; <http://www.ontotext.com/config/graphdb#fts-string-literals-index> "default"; <http://www.ontotext.com/config/graphdb#imports> ""; <http://www.ontotext.com/config/graphdb#in-memory-literal-properties> "true"; <http://www.ontotext.com/config/graphdb#query-limit-results> "0"; <http://www.ontotext.com/config/graphdb#query-timeout> "0"; <http://www.ontotext.com/config/graphdb#read-only> "false"; <http://www.ontotext.com/config/graphdb#repository-type> "file-repository"; <http://www.ontotext.com/config/graphdb#ruleset> "rdfsplus-optimized"; <http://www.ontotext.com/config/graphdb#storage-folder> "storage"; <http://www.ontotext.com/config/graphdb#throw-QueryEvaluationException-on-timeout> "false"; sail:sailType "graphdb:Sail" ] ]; rdfs:label "" .Use the RDF4J API to load the configuration. See Create a repository for more information.
Configuration parameters¶
This is a list of all repository configuration parameters. Some of the parameters can be changed (effective after a restart), some cannot be changed (the change has no effect) and others need special attention once a repository has been created, as changing them will likely lead to inconsistent data (for example, unsupported inferred statements, missing inferred statements, or inferred statements that cannot be deleted).
Parameter name |
Description |
Default value |
|---|---|---|
|
Specifies the default namespace for the main persistence file. Non-empty namespaces are recommended, because their use guarantees the uniqueness of the anonymous nodes that may appear within the repository. |
noneCan be changed.
|
check-for-inconsistencies |
Enables or disables the mechanism for consistency checking.
If this parameter is |
falseCan be changed.
|
|
Default namespaces corresponding to each imported schema file,
separated by semicolons. The number of namespaces must be equal to the
number of schema files from the imports parameter described below. Example:
Warning: This parameter cannot be set via a command line argument.
|
<empty>Cannot be changed.
|
disable-sameAs |
Enables or disables the |
trueCan change in the UI depending
|
enable-context-index |
Possible value: |
falseCan be changed.
|
enable-literal-index |
Enables or disables the use of a literal index. The literal index is always built as data is loaded or modified. This parameter only affects whether the index is used during query answering. See Literal index for more information. |
trueCan be changed.
|
enablePredicateList |
Enables or disables mappings from an entity (subject or object) to its predicates; enabling it can significantly speed up queries that use wildcard predicate patterns. See Predicate lists for more information. |
trueCan be changed.
|
enable-fts-index |
Enables or disables the full-text search index. In general, searching is performed via SPARQL queries that use a pattern like this:
See Simple full-text search index for more information. |
falseCan be changed.
|
fts-indexes |
Comma-delimited list of languages that should have a specific index with an appropriate analyzer for full-text search. See Simple full-text search index for more information. Possible values:
default, iri, ar, bg, bn, br, ca, ja, ko, zh, ku, cz,
da, de, el, en, es, et, eu, fa, fi, fr, ga, gl, hi, hu, hy, id, it, lt,
lv, ne, nl, no, pt, ro, ru, sr, sv, ta, te, th, tr |
default, iriCan be changed.
|
fts-string-literals-index |
The index in which the string literals ( Possible values: |
defaultCan be changed.
|
fts-iris-index |
The index in which the IRIs are indexed for full-text search. See Simple full-text search index for more information. Possible values: |
noneCan be changed.
|
entity-id-size |
Defines the bit size of internal IDs used to index entities. This
parameter can be left at its default value. However, if you are using very
large datasets containing over 2 31 entities,
set this parameter to Using 40-bit entity IDs requires a GraphDB Enterprise or Standard license. Possible values:
32 and 40. |
32Cannot be changed.
|
entity-index-size |
Defines the initial size of the entity hash table index entries. The bigger the size, the fewer the collisions in the hash table, and the faster the entity retrieval. The entity hash table will adapt to the number of stored entities once the number of collisions passes a critical threshold. See Sample memory configuration for more information. Warning The |
|
importsTip: Schema files can be either a local path
name, e.g.,
./ontology/myfile.rdf or a URL,
e.g., http://www.w3.org/2002/07/owl.rdf.
If this parameter is used, the default
namespace for each imported schema file
must be provided using the
defaultNS parameter. |
A list of schema files that will be imported at startup. All statements found in these files will be loaded in the repository and will be treated as read-only. The serialization format is determined by the file extension:
Example:
graphdb:imports "./ont/owl.rdfs;./ont/ex.rdfs" |
noneCannot be changed.
|
in-memory-literal-properties |
Enables or disables caching of the literal languages and data types. If the caching is on and the entity pool is restored from persistence, but there is no such cache available on disk, it is created after the entity pool initialization. See Caching literal language tags for more information. |
trueCan be changed.
|
|
Semicolon-separated list of predicates (full URLs) that GraphDB will not try to process with the registered GraphDB plugins. (Predicates processed by registered plugins are often called “Magic” predicates.) This optimization will speed up the data loading by providing a hint that these predicates are not magic. |
http://www.w3.org/2000/01/rdf-
schema#label;http://www.w3.org/
1999/02/22-rdf-syntax-ns#type;
http://www.ontotext.com/owlim/
ces#gazetteerConfig;http:
//www.ontotext.com/owlim/ces
#metadataConfig
|
|
Sets the maximum number of results returned from a query after which the evaluation of a query will be terminated; values less than or equal to zero mean no limit. |
0; (no limit)Can be changed.
|
query-timeout |
Sets the number of seconds after which the evaluation of a query will be terminated; values less than or equal to zero mean no limit. See Automatically prevent long running queries for more information. |
0; (no limit)Can be changed.
|
|
In this mode, no modifications to the data or namespaces are allowed. Possible value:
true, puts the repository in read-only mode. |
falseCan be changed.
|
|
In this mode, no modifications to the data or namespaces are allowed. Possible values:
file-repository, weighted-file-repository. |
file-repositoryCannot be changed.
|
ruleset |
Sets of axiomatic triples, consistency checks and entailment rules, which determine the applied semantics. See Rulesets for more information. Possible values:
empty, rdfs, owl-horst, owl-max, and
owl2-rl, and their optimized counterparts rdfs-optimized,
owl-horst-optimized, owl-max-optimized, and owl2-rl-optimized.
A custom ruleset is chosen by setting the path to its rule file .pie.Warning: This parameter needs special attention.
|
|
storage-folder |
Specifies the folder where the index files will be stored. See Data storage for more information. |
noneCan be changed.
|
|
Controls whether GraphDB returns only partial results, or an error and no results upon reaching a timeout. Possible values: |
falseCan be changed.
|
Namespaces defined for the repository¶
Under in the GraphDB Workbench you can view and manipulate the RDF namespaces and prefixes for the active repository. Each GraphDB repository contains the following predefined prefixes:
Prefix |
IRI |
Description |
|---|---|---|
|
|
The GeoNames Ontology makes it possible to add geospatial semantic information to the Word Wide Web. Over 11 million geonames toponyms have a unique URL with a corresponding RDF web service. |
|
|
As with RDFS, properties in OWL are used to link things together. OWL provides a rich and complex vocabulary for saying things about these links. It allows you to construct some fairly complex, but useful, relationships among classes. |
|
|
GraphDB extends SPARQL with the Graph Path Search features that allow you to not only find complex relationships between resources but also explore them and use them as filters to identify graph patterns. |
|
|
The RDF Schema for the RDF vocabulary terms in the RDF Namespace, defined in RDF 1.1 Concepts and Abstract Syntax. |
|
|
A general-purpose language for representing simple RDF vocabularies on the Web, RDF Schema is a semantic extension of RDF. It provides mechanisms for describing groups of related resources and the relationships between these resources. |
|
|
GraphDB provides support for two-dimensional geospatial data that uses the WGS84 Geo Positioning RDF vocabulary (World Geodetic System 1984). |
|
|
The standard set of datatypes available to RDF. |
|
|
XPATH functions on datatypes. |
|
|
Beside the standard SPARQL functions operating on numbers, GraphDB offers several additional functions, allowing users to do more mathematical operations. |
|
|
SPIN provides meta-modeling capabilities that allow users to define their own SPARQL functions and query templates. SPIN makes a library of common functions available. |
|
|
GraphDB supports Jena simple functions analogs. |
|
|
GraphDB supports Jena list functions analogs. |
|
|
GraphDB supports Jena aggregate functions analogs. |
|
|
GraphDB supports Jena property functions analogs. |
|
|
GeoSPARQL defines a vocabulary for representing geospatial data in RDF, and it defines an extension to the SPARQL query language for processing geospatial data. |
|
|
On top of the standard GeoSPARQL functions, GraphDB adds a few useful extensions based on the USeekM library. |
|
|
Used by an Ontotext geospatial extension. |
|
|
XPATH namespace used for some mathematical functions. |
|
|
XPATH namespace used for some functions that manipulate maps. |
|
|
XPATH namespace used for some functions that manipulate arrays. |
|
|
Parameter namespace for an RDF4J repository configuration consisting of a single RDF subject of type |
|
|
Parameter namespace for an RDF4J |
|
|
Parameter namespace for the Sail configuration. |
|
|
Reserved GraphDB repository configuration namespace. |
Reconfigure a repository¶
Once a repository is created, you can change some parameters, either by editing it in the Workbench or by setting a global override for a given property.
Note
When you change a repository parameter, you need to restart GraphDB for the changes to take effect.
Using Workbench¶
To edit a repository parameter in the GraphDB Workbench, go to and click the Edit icon for the repository whose parameters you want to edit.
Global overrides¶
It is also possible to override a repository parameter for all repositories by setting a configuration or system property. See Engine properties for more details.
Rename a repository¶
Using Workbench¶
You can rename a repository on the screen where you edit the repository configuration. This will update all locations in the Workbench where the repository name is used.
Change location settings¶
You can enable or disable the sending of anonymous statistics to Graphwise. The default setting depends on the GraphDB license that you are using. With GraphDB Free, it is enabled by default, and with GraphDB Standard and Enterprise, it is disabled by default.
To enable or disable it manually, click the Repository screen’s gear icon that has the tooltip Edit common settings for these repositories.
This displays the Settings dialog box, which includes a “more info” link that adds additional information to the dialog box as shown here:
Repository Caching Mechanism¶
You can also automatically limit the number of active repositories in your GraphDB instance through the Repository Caching Mechanism. The Repository Caching Mechanism will automatically shut down repositories based on an LRU (least-recently-used) policy. The mechanism can be configured on a timeout basis (time elapsed since last access to the repository) or a quantity basis (limiting the number of active repositories). Both of those can be enabled and configured individually of each other.
Once a repository has been shut down, it can be activated again as usual.
Note
The Repository Caching Mechanism is defined on a system level and is the same for all repositories. For more information, see the System properties documentation.
The mechanism will never shut down repositories with active repository connections. If more repositories are active than the caching size permits it will wait until a repository with 0 active connections becomes available to be shut down.
Limiting the number of active repositories¶
You can control the number of active repositories using the graphdb.max.active.repositories system property. By default, GraphDB has a cache limit of 100 active repositories. Once the limit is reached, the Repository Caching Mechanism will start shutting down the least recently used repositories until all of them can fit in the cache.
To disable this policy, set the value of graphdb.max.active.repositories to 0.
Set a timeout for active repositories¶
The Repository Caching Mechanism can start shutting down repositories that have not been accessed in a defined timeout period. By default the time policy is disabled with a default value of 0.
The timeout can be defined through the graphdb.repository.expiry.after.minutes system property, which takes a value in minutes.