Re: [Virtuoso-users] Substring implementation difference between jena, rdf4j and virtuoso

2019-03-24 Thread Jerven Tjalling Bolleman

Hi James, All,

I didn't see an example with startingLoc less than 1.

However, one document down in the xpath-functions one there is clarity.
https://www.w3.org/TR/xpath-functions/#func-substring
And I should have looked at that first.

I think this means edge case non conformance bugs in rdf4j and virtuoso.

I will propose a fix for it in rdf4j and file a bug for it for virtuoso.

i.e. SUBSTR("ABC", 0, 2)
should return "A" because only for position 1
does fn:round(0) <= 1 and 1 < fn:round(0) + fn:round(2) hold

Regards,
Jerven


On 2019-03-24 17:38, james anderson wrote:
On 2019-03-24, at 15:34:55, Jerven Tjalling Bolleman 
 wrote:


Hi All,

Cross posting as this seems to be a question of spec implementation 
and I am not sure what the correct answer is supposed to be.


look at the examples in the document which you referenced.

best regards, from berlin,
---
james anderson | ja...@dydra.com | http://dydra.com


--
Jerven Tjalling Bolleman
SIB | Swiss Institute of Bioinformatics
CMU - 1, rue Michel Servet - 1211 Geneva 4
t: +41 22 379 58 85 - f: +41 22 379 58 58
Jerven.Bolleman@sib.swiss - http://www.sib.swiss



___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] Substring implementation difference between jena, rdf4j and virtuoso

2019-03-24 Thread Jerven Tjalling Bolleman

Hi All,

Cross posting as this seems to be a question of spec implementation and 
I am not sure what the correct answer is supposed to be.


SELECT *
WHERE {
  BIND("ABCDEFGHIJK" AS ?s2)
  BIND(SUBSTR(?s2, 0, 1) AS ?sub)
}


This gives "" in jena but "A" in rdf4j and virtuoso.
Seems to be some ambiguity in 
https://www.w3.org/TR/sparql11-query/#func-substr
I think it is because while 1 is given as the index of the first 
character for susbtring. the way that virtuoso and rdf4j seem to deal 
with it is to take for the first value at least 1. While jena actually 
uses the given value in the calculation.


e.g.

SELECT *
WHERE {
  BIND("ABCDEFGHIJK" AS ?s2)
  BIND(SUBSTR(?s2, 0, 2) AS ?sub)
}

Gives "A" in jena but "AB" in virtuoso

Regards,
Jerven


--
Jerven Tjalling Bolleman
SIB | Swiss Institute of Bioinformatics
CMU - 1, rue Michel Servet - 1211 Geneva 4
t: +41 22 379 58 85 - f: +41 22 379 58 58
Jerven.Bolleman@sib.swiss - http://www.sib.swiss



___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users