GraphDB System Statements¶
What’s in this document?
System statements are used as SPARQL pragmas specific to GraphDB. They are ways to alter the behavior of SPARQL queries in specific ways. The IDs of system statements are not present in the repository in any way.
GraphDB System Statements can be recognized by their identifiers which begin either with the onto
or the sys
prefix. Those stand for <https://www.ontotext.com/>
and <http://www.ontotext.com/owlim/system#>
, respectively.
System graphs¶
System graphs modify the result or change the dataset on which the query operates. The semantics used are identical to standard graphs - the FROM
keyword. An example of graph usage would be:
PREFIX onto: <http://www.ontotext.com/>
SELECT * FROM onto:readwrite WHERE {
?s ?p ?o
}
System graph |
Description |
---|---|
|
The graph contains statements inferred via the repository’s ruleset, located in the default graph. |
|
The graph contains statements inserted in the database by the user, located in the default graph. |
|
The graph contains schematic statements, i.e., the statements which define the repository’s ruleset. |
|
The graph contains non-schematic statements - i.e., all statements beside the ones in the ruleset. |
|
A pseudo graph that forces a count of the results of the query and returns it as the result. |
|
A pseudo graph that disables the default behavior of expanding the sameAs nodes of the query result. |
|
A pseudo graph that makes the query behave as if the |
|
A pseudo graph that forces a check if a statement is already explicitly present in the result set and does not return implicit (inferred) versions of the same triple. |
|
Specifies that for the given triple pattern merge join should be used. Should be used with a |
|
Specifies that for the given triple pattern hash join should be used. Should be used with a |
|
A pseudo graph that returns the query optimization plan. |
|
If enabled, logs commit statistics every 30 seconds. |
|
A pseudo graph that forces the usage of the repository statistics in COUNT queries, instead of properly counting the results when the WHERE clause consists of only one statement pattern. This speeds up the counting operation for simple queries, but it can produce wrong counts where results are manipulated, for example, by |
|
Does not allow |
System predicates¶
System predicates are used to change the way in which the repository behaves. An example of system predicate usage would be:
PREFIX sys: <http://www.ontotext.com/owlim/system#>
INSERT DATA {
[] sys:addRuleset "owl-horst-optimized" .
[] sys:defaultRuleset "owl-horst-optimized" .
[] sys:reinfer [] .
}
System predicate |
Description |
---|---|
|
Allows for axiom insertion and removal, changing the ruleset. |
|
Forces full inference re-computation. |
|
Enables inferences. |
|
Disables inference. This will not remove previously inferred statements. |
|
Adds a ruleset. |
|
Removes a ruleset. |
|
Refers to the default ruleset. Can be used to fetch it or change it. |
|
Refers to the current ruleset. Can be used to fetch it or change it. |
|
Lists the currently installed rulesets. |
|
Renames a ruleset. |
|
Retrieves a ruleset’s text, if any. |
|
Checks data consistency against a given ruleset. |
|
Sets a replacement graph. The content of that graph will be replaced with the incoming update. Multiple graphs may be provided by multiple calls with this predicate. |
|
Sets a prefix for replacement graphs. All graphs whose IRIs start with the prefix will be replaced with the incoming update. Multiple prefixes may be provided by multiple calls with this predicate. |