3.
What is SPARQL?
• SPARQL is a query language for RDF data
– http://www.w3.org/TR/rdf-sparql-query/
• It is also a protocol
• It is designed around graph patterns
– Graph patterns use Turtle syntax
• SPARQL 1.0 is query only
– SPARQL 1.1 (covered next, not yet a recommendation) includes
syntax for updates
Introduction to SPARQL
#3

12.
Optionals
• Parts of the matching graph can be optional
• Use OPTIONAL {} to enclose the optional parts
• Can test in filter expressions if variable are bound
• Using logical NOT '!' it is possible to filter out
solutions for the optional part
Introduction to SPARQL
#12

16.
Common Problems
• Spelling mistakes in identifiers are not noticed
– It is simply a different URI
– URIs are LONG, are case-sensitive, have '#' or '/' for local part
• Easy to use the right local name with the wrong
namespace
• Literals are compared on type, language and value
– "Steve Hillage"@EN is not the same as "Steve Hillage"
– "3" is not the same as "3"^^xsd:integer
Introduction to SPARQL
#16