Filters
All Builders of different types (SELECT, INSERT and DELETE, CONSTRUCT) have their conditions (the WHERE part...), which can be chained to the Builder itself with a set of dedicated methods.
Show generated query
|
The most common condition: the predicate is applied to the implicit OwnSubject of the query. By default, the first parameter is wrapped within a Iri term, the second in a Plain (assumes it is a string). |
Show generated query
|
Passing Term objects as parameters, you can enforce their meaning and the way those will be appended into the query. This is true for every conditional function of the Builder. |
Show generated query
|
The value of the condition can be a sub-query: a new random Variable will be used for further comparison an evaluations. |
Show generated query
|
When three parameters are passed to where() , they become a complete Triple.
|
Show generated query
|
An OPTIONAL condition is to filter entities having a given predicate with a given value, or not that predicate at all. To optionally select a given predicate into a SELECT query it is more convenient to use the Optional term. |
Show generated query
Show generated query
Show generated query
|
Basic evaluation functions are built into the where() function, which generates proper FILTER conditions.Supported operators:
|
Show generated query
|
Many different values can be matched at once. |
Show generated query
|
To reverse the operands of the Triple, and use the implicit OwnSubject as object instead of subject. |
Show generated query
|
Also reverted relations can be extended with sub-queries, in which the subject will be inherited from the parent one. |
Show generated query
|
An arbitrary expression can be appended to the query. |
Show generated query
|
Reverts the filter, matching entities for which the given sub query produces no results. |
Show generated query
|
Part of the entities matching a query can be excluded from the final result if they match some other condition, using the MINUS operator. |
Show generated query
|
The entities may match a set of conditions or another, using the UNION operator. Note that the or() function only accepts a callable function, where a (more or less complex) sub query can be expressed.
|