Re: SPARQL Evaluation Model

if you want to understand evaluation order, sparql.org is your friend:

    http://www.sparql.org/query-validator.html

select the "SPARQL algebra" output and approach the output as if it were written in something like lisp.



> On 27. Mar 2023, at 16:10, Tim McIver <tim@timmciver.com> wrote:
> 
> Miguel,
> Yes, I have not read through the spec but I will try to do that.  Ideally, I'd love to see a book that describes the behavior with examples.
> Thanks,
> Tim
> On 3/27/23 08:45, Miguel wrote:
>> Hello Tim, 
>> the reference document is the W3C recommendation [1].
>> The semantics of SPARQL are formally defined in two steps: first transforming a textual SPARQL query to a "SPARQL algebra expression", then applying the operational semantics defined on the SPARQL algebra.
>> From the transformation step (specifically the part in [2]) comes the fact, often surprising to newcomers, that the order in which clauses are used in a query is indeed important and that some operators are applied incrementally on the pattern defined "above" them.
>> 
>> Cheers,
>> Miguel
>> 
>> [1] https://www.w3.org/TR/sparql11-query/
>> [2] https://www.w3.org/TR/sparql11-query/#sparqlTranslateGraphPatterns
>> 
>> On Mon, Mar 27, 2023 at 1:51 PM Tim McIver <tim@timmciver.com> wrote:
>> Hello,
>> Where can I find information about SPARQL's evaluation model?  I've read most of "Learning SPARQL" but I've encountered several surprising results from queries that I've written from what I've learned there.  One of these surprises prompted this question on this mailing list which made me realize that I actually don't understand SPARQL's evaluation model at all and I can't seem to find anything written about it.  I don't believe "Learning SPARQL" discussed the effect that, for example, moving a BIND call would have on the results (if I'm mistaken, please let me know where the book discusses this).
>> Thanks,
>> Tim

---
james anderson | james@dydra.com | https://dydra.com

Received on Monday, 27 March 2023 16:30:04 UTC