Of course to make it even stranger

sparql -v "select * where {BIND(substr(str("1234567890"), 0, 11) AS ?substr)}"

Does work as expected!

Regards,
Jerven

  1 SELECT  ?substr
  2 WHERE
  3   { BIND(substr(str(1234567890), 0, 11) AS ?substr) }

16:13:39 INFO  exec                 :: QUERY
  SELECT  ?substr
  WHERE
    { BIND(substr(str(1234567890), 0, 11) AS ?substr) }
16:13:39 INFO  exec                 :: ALGEBRA
  (project (?substr)
    (extend ((?substr "1234567890"))
      (table unit)))

On 11/06/2017 03:45 PM, Jerven Tjalling Bolleman wrote:
Dear Andy,

That makes it very strange because this is what I get

$ sparql --version
Jena:       VERSION: 3.4.0
Jena:       BUILD_DATE: 2017-07-17T11:43:07+0000
ARQ:        VERSION: 3.4.0
ARQ:        BUILD_DATE: 2017-07-17T11:43:07+0000
RIOT:       VERSION: 3.4.0
RIOT:       BUILD_DATE: 2017-07-17T11:43:07+0000

$ sparql -v "select ?substr where {BIND(substr("1234567890", 0, 11) AS ?substr)}"
   1 SELECT  ?substr
   2 WHERE
   3   { BIND(substr(1234567890, 0, 11) AS ?substr) }

15:43:31 INFO  exec                 :: QUERY
   SELECT  ?substr
   WHERE
     { BIND(substr(1234567890, 0, 11) AS ?substr) }
15:43:31 INFO  exec                 :: ALGEBRA
   (project (?substr)
     (extend ((?substr (substr 1234567890 0 11)))
       (table unit)))
----------
| substr |
==========
|        |
----------

Regards,
Jerven

On 11/06/2017 03:34 PM, Andy Seaborne wrote:
I get "1234567890" (jena v 3.5.0)

sparql -v 'select ?substr where {BIND(substr("1234567890", 0, 11) AS ?substr)}'

   1 SELECT  ?substr
   2 WHERE
   3   { BIND(substr("1234567890", 0, 11) AS ?substr) }

----------------
| substr       |
================
| "1234567890" |
----------------

I get this for versions back to 2.10.0.

     Andy

On 06/11/17 14:22, Jerven Tjalling Bolleman wrote:
Dear Jena-Devs,

I believe that the following query

select ?substr where {BIND(substr("1234567890", 0, 11) AS ?substr)}

should return


| substr       |
================
| "1234567890" |

instead of the current

| substr |
==========
|        |


I take this from reading the spec here.
https://www.w3.org/TR/xpath-functions/#func-substring

If people agree with my reading I will be happy to submit a patch.

Regards,
Jerven




--
-------------------------------------------------------------------
Jerven Bolleman                        [email protected]
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
-------------------------------------------------------------------

Reply via email to