W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > October 2010

[COMMENT] Behavior of SPARQL Update INSERT on default graphs

From: Michael Schneider <schneid@fzi.de>
Date: Mon, 25 Oct 2010 11:03:12 +0200
Message-ID: <0EF30CAA69519C4CB91D01481AEA06A0022524C4@judith.fzi.de>
To: <public-rdf-dawg-comments@w3.org>
Dear working group!

I was trying to answer a pretty basic question from reading the SPARQL 1.1
Update working draft (14 October 2010) but was not able to. So either this
topic has not been addressed, or I may have missed something, but in the
latter case I suggest to clarify the text.

My question is as follows: If the default graph is updated by means of an
INSERT operation, does the update operation happen in a "recursive" way?
What I mean is, if the graph pattern in the WHERE clause is matched, are the
result triples inserted immediately into the graph, and do the following
matches depend on the inserted results of the first match? Or does the
update of the graph happen only after all matches have been performed?

I give an example to make the difference clear. Let the original graph be as
follows:

    { 
      :A :p :B .
      :B :p :C .
      :C :p :D .
    }

The update expression is defined as follows:

    INSERT { ?x :p ?z }
    WHERE { 
        ?x :p ?y .
        ?y :p ?z . 
    }

Now, in the case of a non-recursive (non-immediate) update, there would be
exactly two matches, namely

    ?x = :A , ?y = :B , ?z = :C
    ?x = :B , ?y = :C , ?z = :D

This would lead to the following result graph:

    {
      :A :p :B .
      :B :p :C .
      :C :p :D .
      :A :p :C .
      :B :p :D .
    }

However, with a recursive update, there would be four matches, namely

    ?x = :A , ?y = :B , ?z = :C
    ?x = :B , ?y = :C , ?z = :D
    ?x = :A , ?y = :B , ?z = :D (*)
    ?x = :A , ?y = :C , ?z = :D (*)

The two matches marked by (*) would happen due to the triples that have been
inserted into the graph stemming from the first two matches.

The result graph would then be

    {
      :A :p :B .
      :B :p :C .
      :C :p :D .
      :A :p :C .
      :B :p :D .
      :A :p :D . (*)
    }

The triple (*) in the graph would be the difference.

So, how is INSERT supposed to behave?

Cheers,
Michael

--
Dipl.-Inform. Michael Schneider
Research Scientist, Information Process Engineering (IPE)
Tel  : +49-721-9654-726
Fax  : +49-721-9654-727
Email: michael.schneider@fzi.de
WWW  : http://www.fzi.de/michael.schneider

=======================================================================
FZI Forschungszentrum Informatik an der Universität Karlsruhe
Haid-und-Neu-Str. 10-14, D-76131 Karlsruhe
Tel.: +49-721-9654-0, Fax: +49-721-9654-959
Stiftung des bürgerlichen Rechts, Az 14-0563.1, RP Karlsruhe
Vorstand: Prof. Dr.-Ing. Rüdiger Dillmann, Dipl. Wi.-Ing. Michael Flor,
Prof. Dr. Dr. h.c. Wolffried Stucky, Prof. Dr. Rudi Studer
Vorsitzender des Kuratoriums: Ministerialdirigent Günther Leßnerkraus
=======================================================================

Received on Monday, 25 October 2010 09:03:49 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 25 October 2010 09:03:50 GMT