Retain BIND position special graph

Skip to end of metadata
Go to start of metadata
This documentation is NOT for the latest version of GraphDB.

Latest version - GraphDB 7.1

GraphDB Documentation

Next versions

GraphDB 6.6
GraphDB 7.0
GraphDB 7.1

Previous versions

GraphDB 6.4
GraphDB 6.3
GraphDB 6.2
GraphDB 6.0 & 6.1

OWLIM 5.4
OWLIM 5.3
OWLIM 5.2
OWLIM 5.1
OWLIM 5.0
OWLIM 4.4
OWLIM 4.3
OWLIM 4.2
OWLIM 4.1
OWLIM 4.0

The default behavior of the GraphDB query optimiser is to try and reposition BIND clauses so that all the variables within its EXPR part (on the left side of 'AS') are bound to have valid bindings for all of the variables referred within it.

If we look at following data:

and try to evaluate a SPARQL query such as the one below (without any rearrangement of the statement patterns):

the 'correct' result would be:

because the expression that sums several variables will not produce any valid bindings for ?R.

But if we rearrange the statement patterns in the same query so that we have bindings for all of the variables used within the sum expression of the BIND clause:

the query would return a single result and now the value bound to ?r will be "6":

By default, the GraphDB query optimiser will try to move the BIND after the last statement pattern, so that all the variables referred internally have a binding. However, that behavior can be modified by using a special 'system' graph within the dataset section of the query (e.g. as 'FROM' clause) that has the following IRI:

In this case, the optimiser will retain the relative position of the BIND operator within the group in which it appears, so that if we evaluate the following query against the GraphDB repository:

we will get the following result:

Still, the default evaluation without the special 'system' graph will provide a more useful result:

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.