SPARQL Reference

OPTIONAL:

  "PREFIX foaf: <http://xmlns.com/foaf/0.1/> " +
                         "SELECT ?name ?title " +
                         "WHERE {" +
                         "?Person foaf:name ?name." +
                         "OPTIONAL{?Person foaf:title ?title.}" +
                          "      }";

UNION:

SELECT ?x
{
   { :IndividualOne rdfs:label ?x } UNION { :IndividualTwo rdfs:label ?x }
}

http://delicious.com/kidehen/virtuoso_sparql_tutorial - a collection of SPARQL queries (3 part series from basic to advanced with extensions)

http://lod.openlinksw.com/b3s/ - short cut to some of the advanced and extension queries showcased at the 2008 Billion Triples Challenge.

Endpoint: http://lod.openlinksw.com/sparql (over 4.5 Billion Triples at your disposal and counting).
Note, whenever you get an incomplete result set by way of error (e.g. some of the Billion Triples queries, simply re-query as this is the Anytime Query Feature in action).

"HCLS/HCLSIG Demo QueryScratch" http://esw.w3.org/topic/HCLS/HCLSIG_Demo_QueryScratch

SPARQL Query on Parsed RDFa

The following query can be run using the Sparql End Point http://demo.openlinksw.com/sparql/

PREFIX dc: <http://purl.org/dc/elements/1.1/>
SELECT ?creator_of_post
FROM <http://www.w3.org/2007/08/pyRdfa/extract?uri=http://www.w3.org/2006/07/SWD/RDFa/primer/alice-example.html>
WHERE {
?post dc:title ?post_title ;
dc:creator ?creator_of_post .
FILTER regex(?post_title, "The trouble with Bob", "i")
}