Hello Jerven,
good catch. Now, I'm wondering whether BIND has to be evaluated after
the FILTER or if this isn't specified in the SPARQL standard. Or does
the order in the SPARQL query matters in that case like it does for
OPTIONAL clauses?
Kind regards,
Lorenz
> Hi All,
>
> I think it is an issue in the way that the xpath spec is included in the
> SPARQL 1.1 spec, in an unclear manner.
>
> e.g.
>
> SELECT *
> WHERE
> {
> VALUES ?s { "abc" "abcd" "abd" "AB" "" UNDEF "ACCCCCCCCA" }
> BIND(substr(str(?s), 3, 1) AS ?lastChar)
>
>
> }
>
> Gives an error as described. But I think that it should give
> ---------------------------
> | s | lastChar |
> ===========================
> | "abc" | "c" |
> | "abcd" | "c" |
> | "abd" | "d" |
> | "AB" | "" |
> | "" | "" |
> | | |
> | "ACCCCCCCCA" | "C" |
> ---------------------------
>
> As results.
>
>
> This example
>
> * fn:substring("12345", 5, -3) returns "".
>
> Characters at positions greater than or equal to 5 and less than 2 are
> selected.
>
> from https://www.w3.org/TR/xpath-functions/#func-substring
> supports that interpretation.
>
> The filter being discarded is probably a query optimization
> that allows this bug to be triggered. But the underlying problem
> is that the function should (I think) return an "" instead of an error.
>
> Regards,
> Jerven
>
>
> On 02/11/16 10:29, Jindřich Mynarz wrote:
>> SELECT *
>> WHERE
>> { { SELECT *
>> WHERE
>> { VALUES ?s { "abc" "abcd" "abd" } }
>> }
>> FILTER ( strlen(str(?s)) = 3 )
>> BIND(substr(str(?s), 3, 1) AS ?lastChar)
>> }
--
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users