Hello Timo,
I'm not an JDBC maintainer, but inequality "1<n<0" in the error message
looks weird, I can't imagine such a value of n that would satisfy it :)
OTOH even if the parameter were passed correctly, the result would be
empty because ?s is constantly unbound and hence no one triple will ever
be produced.
I'd write it as either
sparql define output:format '_JAVA_'
CONSTRUCT { `iri(?::0)` ?p ?o }
WHERE
{ `iri(?::0)` ?p ?o }
LIMIT 1
or
sparql define output:format '_JAVA_'
CONSTRUCT { ?s ?p ?o }
WHERE
{ ?s ?p ?o . filter (?s = iri(?::0)) }
LIMIT 1
Best Regards,
Ivan Mikhailov
OpenLink Software
http://virtuoso.openlinksw.com
On Thu, 2011-02-24 at 19:32 +0200, Timo Westkämper wrote:
> Hi.
>
> I am having troubles using CONSTRUCT queries with PreparedStatements.
>
> e.g.
>
> sparql define output:format '_JAVA_'
> CONSTRUCT { ?s ?p ?o }
> WHERE
> { `iri(??)` ?p ?o }
> LIMIT 1
>
>
> throws
>
> Caused by: virtuoso.jdbc4.VirtuosoException: Index 1 is not 1<n<0
> at virtuoso.jdbc4.VirtuosoPreparedStatement.setString(Unknown Source)
> at virtuoso.jdbc4.PreparedStatementWrapper.setString(Unknown Source)
>
> when I try to bind the parameter. What did I do wrong?
>
> Br,
> Timo Westkämper
>
>
> ------------------------------------------------------------------------------
> Free Software Download: Index, Search & Analyze Logs and other IT data in
> Real-Time with Splunk. Collect, index and harness all the fast moving IT data
> generated by your applications, servers and devices whether physical, virtual
> or in the cloud. Deliver compliance at lower cost and gain new business
> insights. http://p.sf.net/sfu/splunk-dev2dev
> _______________________________________________
> Virtuoso-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users