The regexp is only built once, because it's a fixed string.
Note that REGEX (?object, "", "i") is not necessary true. ?object must
be defined and be a string.
Andy
On 15/05/17 10:17, Rob Vesse wrote:
No, the given filter expression will not be optimised.
Most filter expressions apply in value space not term space i.e. We are
interested in the values expressed not the exact terms e.g.
FILTER(“01”^^xsd:integer = “1”^^xsd:integer) is true because they represent the
same value, however they are distinct terms so would not match in term space.
Pattern matching is in term space so typically cannot be used in place of value space
expressions. There are some exceptions to this, e.g. SAMETERM() which is a function
that explicitly operates in term space. Also there are some cases where value and the
term space are equivalent e.g. URI values so FILTER(?x = <urn:example>) can
and will be optimised.
For your specific example we are unlikely to ever be able to optimise it, we
can only optimise it in the case when the pattern match is it for a fixed
pattern that also matches the start and end boundaries e.g. “^example$” and no
modifier flags are used. This is such a narrow case of the capability of the
expression that it likely isn’t worth the effort of even looking for the
possibility of this optimisation because if such a pattern is used the query
writer should really know to express it directly as a pattern matching instead
Rob.
On 15/05/2017 08:41, "Laura Morales" <[email protected]> wrote:
If I have something like this in a query
FILTER REGEX (?object, "", "i")
does Jena optimize the query, in this case by removing such FILTER?