SPARQL—Query Language for RDF

The syntax of SPARQL actually looks like Turtle. So these examples really look more like this:

image

Before we go further, let’s talk a bit about the syntax of a SPARQL query. We’ll start with a simple form, the SELECT query. Readers familiar with SQL will notice a lot of overlap with SPARQL syntax (e.g., keywords like SELECT and WHERE). This is not coincidental; SPARQL was designed to be easily learned by SQL users.

A SPARQL SELECT query has two parts; a set of question words, and a question pattern. The keyword WHERE indicates the selection pattern, written in braces. We have already seen some question patterns, e.g., ...

Get Semantic Web for the Working Ontologist, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.