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) > } -- ------------------------------------------------------------------- Jerven Bolleman Jerven.Bolleman@sib.swiss SIB Swiss Institute of Bioinformatics Tel: +41 (0)22 379 58 85 CMU, rue Michel Servet 1 Fax: +41 (0)22 379 58 58 1211 Geneve 4, Switzerland www.sib.swiss - www.uniprot.org Follow us at https://twitter.com/#!/uniprot ------------------------------------------------------------------- ------------------------------------------------------------------------------ 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