Hi Ivan,

thank you for a very comprehensive answer. My problem was with unbound
temporary variables introduced by Virtuoso for transitive property paths
(e.g., _::trans_obj_11_1). I wasn't sure if this is a bug of Virtuoso or
lack of my understanding of the "Strict checking of void variables" option.
For instance, if I run the following query on our endpoint
http://lod2-dev.vse.cz:8890/sparql (running Virtuoso 07.10.3211) with the
"Strict checking of void variables" on, there's no problem:

###

PREFIX skos: <http://www.w3.org/2004/02/skos/core#>

SELECT ?broader
WHERE {
  GRAPH <http://linked.opendata.cz/resource/dataset/cpv-2008> {
    <http://linked.opendata.cz/resource/cpv-2008/concept/72212461>
skos:broaderTransitive{1,3} ?broader .
  }
}

###

However, when I wrap it in a sub-query and leave the "Strict checking of
void variables" on, then it raises the "Virtuoso 37000 Error SP031: SPARQL
compiler: Variable '_::trans_obj_11_1' is used in subexpressions of the
query but not assigned":

###

PREFIX skos: <http://www.w3.org/2004/02/skos/core#> SELECT ?broader WHERE {
{ SELECT ?broader WHERE { GRAPH <
http://linked.opendata.cz/resource/dataset/cpv-2008> { <
http://linked.opendata.cz/resource/cpv-2008/concept/72212461>
skos:broaderTransitive{1,3} ?broader . } } } }

###

With the "Strict checking of void variables" switched off, this query
executes without error. This still leaves me wondering whether it is a bug
of Virtuoso.

Best,

Jindřich

-- 
Jindřich Mynarz
http://mynarz.net/#jindrich

On Tue, Dec 9, 2014 at 3:49 AM, Ivan Mikhailov <imikhai...@openlinksw.com>
wrote:

> Hello Jindřich,
>
> A variable is void if no one combination of data in the database can
> result in some binding for this variable. In most cases void variable is
> not what query author intended to write, but the error may be subtle,
> hence the need for a debugging tool. The most popular origin of void
> variables is typos in names. "Number two" is a variable that appears in
> a subquery and referred to in the select list or filters of the outer
> pert of query, but is missing in the select list of a subquery. The
> least evident case is a query with parts that contains logical
> contradictions, such as equality filter between a predicate and a
> literal. The SPARQL optimizer can detect various contradictions and wipe
> out query fragments with them: if it's proven that a query fragment can
> not produce any single binding then there's no need to execute or
> further compile it. If a variable was set only in fragments that cease
> to exist but still referred to in select lists etc., it is reported as
> void.
>
> The feature is not documented because it may evolve in any time, as the
> SPARQL optimizer evolves. E.g., in addition to "define
> sql:signal-void-variables 1" pragma we want to add "define
> sql:signal-weird-variables 1" for the "opposite" case of variables bound
> with no effect on the environment.
>
> Best Regards,
>
> Ivan Mikhailov
> OpenLink Software
> http://virtuoso.openlinksw.com
>
> On Mon, 2014-11-24 at 10:23 +0100, Jindřich Mynarz wrote:
> > Hi,
> >
> >
> > every Virtuoso SPARQL endpoint now includes a checkbox called "Strict
> > checking of void variables". Unfortunately, I haven't been able to
> > find documentation describing what exactly this checkbox (or debug=on
> > GET parameter) does. Can you please point me to its authoritative
> > description?
> >
> >
> > My motivation: As others in the past (e.g.,
> > http://boards.openlinksw.com/support/viewtopic.php?f=12&t=1381) I have
> > on numerous occasions encountered the "Virtuoso 37000 Error SP031:
> > SPARQL compiler: Variable '_::trans_subj_XYZ is used in subexpressions
> > of the query but not assigned" error when using SPARQL 1.1 property
> > paths. With "Strict checking of void variables" turned off, this error
> > goes away. I'd like to know what exactly is changed.
> >
> >
> > Best,
> >
> >
> > Jindřich
> >
> >
> > --
> > Jindřich Mynarz
> > http://mynarz.net/#jindrich
> >
> ------------------------------------------------------------------------------
> > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> > from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> > with Interactivity, Sharing, Native Excel Exports, App Integration & more
> > Get technology previously reserved for billion-dollar corporations, FREE
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
> > _______________________________________________ Virtuoso-users mailing
> list Virtuoso-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
>
>
>
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to