W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > December 2004

Use case for optional clauses

From: Bob MacGregor <bmacgregor@siderean.com>
Date: Thu, 02 Dec 2004 08:46:15 -0800
Message-ID: <41AF46D7.7010607@siderean.com>
To: public-rdf-dawg-comments@w3.org
VIVID is a visualization tool that generates densely-packed displays of 
instance data.
It produces machine-generated SPARQL queries to retrieve the data it 
needs.  These
queries always contain optional clauses, and the larger ones contain 
multiple levels
of nested optionals.  Below is a sample of a relatively small query 
generated by VIVID.

My guess is that any GUI tool that retrieves batch quantities of RDF data
will have a similar need for optional clauses.

Cheers, Bob

SELECT ?Book, ?title, ?coverage, ?title2, ?isPartOf, ?description, 
?date, ?creator, ?title3, ?nationality
WHERE (?Book, 
    AND (OPTIONAL (?Book, <http://purl.org/dc/elements/1.1/title>, ?title))
    AND (OPTIONAL ((?Book, <http://purl.org/dc/elements/1.1/coverage>, 
                   AND (OPTIONAL (?coverage, 
<http://purl.org/dc/elements/1.1/title>, ?title2))
                   AND (OPTIONAL (?coverage, 
<http://purl.org/dc/terms/isPartOf>, ?isPartOf))))
    AND (OPTIONAL (?Book, <http://purl.org/dc/elements/1.1/description>, 
    AND (OPTIONAL (?Book, <http://purl.org/dc/elements/1.1/date>, ?date))
    AND (OPTIONAL ((?Book, <http://purl.org/dc/elements/1.1/creator>, 
                   AND (OPTIONAL (?creator, 
<http://purl.org/dc/elements/1.1/title>, ?title3))
                   AND (OPTIONAL (?creator, 
<http://www.siderean.com/bookdemo#nationality>,     ?nationality))))
Received on Thursday, 2 December 2004 16:46:46 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:52:05 UTC