Hi Lourens,
Unfortunately it is not possible to specify variables limit and offset in
sparql+vsp.
Even if we re-write the procedure to sth like:
create procedure test (in _uri varchar)
{
declare res varchar;
result_names (res);
declare _lm, _offset int;
_lm := 10;
_offset := 20;
FOR (SELECT TOP _limit U_NAME from SYS_USERS)
do { result (U_NAME); } }
again it will raise error as the query from above means should be compiled with
TOP <variable>,
but TOP accepts only constants.
Another variant however is you to use exec instead, where you can set limit and
offset as variables. See here: http://docs.openlinksw.com/virtuoso/fn_exec.html
Best Regards,
Rumi
----- Original Message -----
From: Lourens van der Meij
To: [email protected]
Sent: Thursday, December 10, 2009 10:17 PM
Subject: [Virtuoso-users] vsp sparql variable offset and limit?
I want to specify variable limit and offset values in sparql queries in
vsp pages.
I tried:
declare _lm int;
_lm := 10;
FOR (sparql select ?v1_lab
where {`iri(?:_uri)` skos:prefLabel ?v1_lab} limit $:_lm)
DO {
...
and some less probable guesses, but I only get syntax errors
Is it possible to specify variable limit and offset in sparql+vsp?
Thanks,
Lourens
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Virtuoso-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/virtuoso-users