Hi,
When running a transitive sparql query from a stored procedure, I get this
error:
"Virtuoso 37000 Error SP031: SPARQL compiler: Variable '_::trans_subj_23_4'
is used in subexpressions of the query but not assigned"
Running the same query in conductor/isql doesn't get the error.
The difference appears to be the pragmas added to such compiled queries by
Virtuoso. Adding them manually reproduced the error and allowed me to
narrow it down to: "sql:signal-void-variables".
The query that produced it (with some slight anonymisation) is below, it's
a little clunky because it's generated from a lot of optional clauses:
===============================
sparql { define sql:big-data-const 0
#output-format:text/html
define sql:signal-void-variables 1
select distinct ?G ?S ?P ?O Datatype(?O) as ?ObjectType
where { GRAPH ?G {filter ( ?G in (<
http://example.com/dataset/demoapp/OntologyDefault/>, <
http://example.com/dataset/demoapp/12553670352e474e/>, <http:/
/example.com/dataset/demoapp/1275367035362f2c/>, <
http://example.com/dataset/demoapp/12953670ae30d4ec/>))
{
{ select distinct ?S as ?anchor {
GRAPH ?G {filter ( ?G in (<
http://example.com/dataset/demoapp/OntologyDefault/>, <
http://example.com/dataset/demoapp/12553670352e474e/>, <
http://example.com/dataset/demoapp/1275367035362f2c/>, <
http://example.com/dataset/demoapp/12953670ae30d4ec/>))
?S a ?class .
filter ( ?class in (<http://app.example.com/ontology/DemoApp/DemoEntity>))
filter ( ?S in (<http://example.com/data/demoapp/DemoEntity_46453a449a2b9c93
>))
}}
}?anchor ?anchorPred ?S
OPTION ( TRANSITIVE,
t_min (0),
t_max (1),
t_in (?anchor),
t_out (?S),
t_no_cycles,
t_distinct ) .
?S ?P ?O .
}
UNION {
select ?G ?S ?P ?O Datatype(?O) as ?ObjectType {
GRAPH ?G {filter ( ?G in (<
http://example.com/dataset/demoapp/OntologyDefault/>, <
http://example.com/dataset/demoapp/12553670352e474e/>, <
http://example.com/dataset/demoapp/1275367035362f2c/>, <
http://example.com/dataset/demoapp/12953670ae30d4ec/>))
?S a ?class .
filter ( ?class in (<http://app.example.com/ontology/DemoApp/DemoEntity>))
filter ( ?S in (<http://example.com/data/demoapp/DemoEntity_46453a449a2b9c93
>))
?S ?P ?O .
}}}}}
}
===============================
Virtuoso is:
$ ./virtuoso-t -?
Virtuoso Open Source Edition (Column Store) (multi threaded)
Version 7.1.0.3207-pthreads as of Mar 19 2014
Compiled for Linux (x86_64-unknown-linux-gnu)
Copyright (C) 1998-2014 OpenLink Software
Can I get some information on what this pragma does?
I assume it's something specific to the data that causes this, the query
doesn't error in an environment that is an identical build of Virtuoso but
has different data.
--
Quentin | Clear Blue Water Pty Ltd
quent...@clearbluewater.com.au
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users