Hello Jindřich,

How do you know that FILTER (STRLEN(?literal) = 8) is executed before
SUBSTR(?literal, 8, 1) ? What's the full text of the query?

Virtuoso translates SPARQL to SQL and uses all allowed term rewritings
and other tricks trying to get highest possible speed. As a side effect,
the order of execution may be non-linear. So the simplest step of
debugging is an additional test: what if
SUBSTR(?literal, 8, 1)
is replaced with
IF (STRLEN(?literal) = 8), SUBSTR(?literal, 8, 1), "some fallback
value")
?

Best Regards,

Ivan Mikhailov
OpenLink Software
http://virtuoso.openlinksw.com

On Tue, 2016-11-01 at 14:22 +0100, Jindřich Mynarz wrote:
> Hi,
> 
> 
> I have a query that first filters literals of given length:
> 
> 
> FILTER (STRLEN(?literal) = 8)
> 
> 
> And then it extracts a substring via SUBSTR():
> 
> 
> SUBSTR(?literal, 8, 1)
> 
> 
> 
> However, Virtuoso throws Virtuoso 22011 Error SR026: SPARQL substr:
> Bad string subrange: from=8, len=1.
> 
> 
> How is that possible?
> 
> 
> I'm using the develop version of Virtuoso
> (https://github.com/openlink/virtuoso-opensource/commit/377438ac6beefa9373cf0500c7edf4077f687d0c).
> 
> 
> - Jindřich
> 
> 
> -- 
> Jindřich Mynarz
> http://mynarz.net/#jindrich
> ------------------------------------------------------------------------------
> 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



------------------------------------------------------------------------------
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

Reply via email to