Hello Jürgen,

SERVICE is the only clause that have more or less predicted order of
calls. It's because Virtuoso's SERVICE have "input" and "output"
variables.

By default, variables that are bound "before" SERVICE in the text of the
query becomes inputs and their values are passes to the remote as part
of SPARQL protocol request. Thus triple patterns or group patterns or
subqueries that bind that variables are all making bindings of these
variables before the SERVICE makes an HTTP request.

Variables that are
1) used in both inside and outside SERVICE
and
2) not found in list of "input" variables
are treated as "output" variables, they form result-set returned via
HTTP and the join with them is possible only when SERVICE is finished.
So if an output variable is used in, e.g., a triple pattern placed
"after" SERVICE then it's quite probable that the triple pattern is used
only after SERVICE invocations. However, the optimizer can decide to
fill in temporary tables (or to prepare a hash join) somewhere at the
beginning of the query, then make SERVICE then complete a join with
previously prepared data.

It is possible to fix the order of execution by placing
define sql:select-option "ORDER"
at the very beginning of the SPARQL query. (The value of option can be
any string you wish to put in OPTION (...) at the end of the composed
SQL query.)
It is also possible to fine-tune the specific triple pattern with local
OPTION, that will be written in SQL unchanged as TRIPLE OPTION

E.g.,
sparql select * where { ?s <p> ?o1, ?o2 OPTION (TABLE_OPTION
"LOOP"), ?o3 } limit 10

will instruct the optimizer to use loop join for triple pattern ?s
<p> ?o2, but leave ?s <p> ?o1 and ?s <p> ?o3 default. Table-specific
options are placed right after object of the desired triple pattern (or
right after sub-SELECT)

Best Regards,

Ivan Mikhailov
OpenLink Software
http://virtuoso.openlinksw.com

On Tue, 2016-03-08 at 20:53 +0100, Jürgen Jakobitsch wrote:
> hi,
> 
> 
> i'd need a fixed order in which said two sparql keywords are
> evaluated.
> in virtuoso is the order fixed or "depends on..."
> 
> 
> any pointer greatly appreciated.
> 
> 
> wkrj
> 
> Jürgen Jakobitsch
> Innovation Director
> Semantic Web Company GmbH 
> 
> EU: +43-1-4021235-0
> Mobile: +43-676-6212710
> http://www.semantic-web.at 
> 
> http://www.poolparty.biz
> 
> 
> 
> 
> 
> 
> PERSONAL INFORMATION
> | web       : http://www.turnguard.com
> | foaf      : http://www.turnguard.com/turnguard
> | g+        : https://plus.google.com/111233759991616358206/posts
> | skype     : jakobitsch-punkt
> | xmlns:tg  = "http://www.turnguard.com/turnguard#";
> ------------------------------------------------------------------------------
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://makebettercode.com/inteldaal-eval
> _______________________________________________
> Virtuoso-users mailing list
> Virtuoso-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users



------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to