Re: Comments on "SPARQL Query Language for RDF"

Enrico Franconi wrote:
> Hi all.
> We would like to submit some comments on the "SPARQL Query Language  
> for RDF" document, to be found in [1].
> 
> Our main goal is to be able to work on a future document about the  
> semantics of (various parts of) SPARQL.
> We would like to identify fragments of SPARQL from a "core" language  
> to a "full" language, and to work on formalising the semantics of the  
> core language first and then extend it to cover the more complex  
> languages.
> With the exception of the last comment in [1], our comments are not  
> revealing any major impediment for the definition of a well founded  
> model theoretic semantics for SPARQL.
> As a first exercise, in [2] we already worked out the formal  
> semantics for core SPARQL and we also give some complexity result.
> We have a major concern on the possibility of giving any clear  
> semantics to the querying provenance part, which we probably would  
> prefer to leave out of the normative document.
> 
> cheers
> --e.
> 
> [1] <http://www.inf.unibz.it/krdb/w3c/sparql-notes-fub.pdf>
> [2] <http://www.inf.unibz.it/krdb/w3c/rdf-sparql-semantics.pdf>
> 
> Enrico Franconi                  - franconi@inf.unibz.it
> Free University of Bozen-Bolzano - http://www.inf.unibz.it/~franconi/
> Faculty of Computer Science      - Phone: (+39) 0471-016-120
> I-39100 Bozen-Bolzano BZ, Italy  - Fax:   (+39) 0471-016-129
> 
> 

Enrico,

Re: UNION and OPTIONAL equivalence.


Taking an example from rq23:

==== Data
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
@prefix rdf:        <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:       <http://www.w3.org/2000/01/rdf-schema#> .

_:a  rdf:type        foaf:Person .
_:a  foaf:name       "Alice" .
_:a  foaf:mbox       <mailto:alice@example.com> .

_:b  rdf:type        foaf:Person .
_:b  foaf:name       "Bob" .

==== Query1:
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?mbox
WHERE  { ?x foaf:name  ?name .
          OPTIONAL { ?x  foaf:mbox  ?mbox }
        }

==== Results1:
----------------------------------------
| name    | mbox                       |
========================================
| "Alice" | <mailto:alice@example.com> |
| "Bob"   |                            |
----------------------------------------

using your transformation:

==== Query2:

PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?mbox
WHERE  {
     { ?x foaf:name  ?name }
     UNION
     { ?x foaf:name  ?name . ?x  foaf:mbox  ?mbox }
   }

==== Results2:

----------------------------------------
| name    | mbox                       |
========================================
| "Alice" |                            |
| "Bob"   |                            |
| "Alice" | <mailto:alice@example.com> |
----------------------------------------






[[There was a discussion on the DAWG comments with Bob MacGreggor and Geoff 
Chappell about different ways of formulating OPTIONAL that woudl give additional 
context here.]]

	Andy

Received on Friday, 2 September 2005 13:26:09 UTC