As a query language, SPARQL can be used to add, remove and retrieve data from RDF-style graph databases. SPARQL queries can not only match patterns of subject-predicate-object triples, but can also use mathematical operations and a wide range of utility functions to create filters and new variable bindings. They can test for the absence of a pattern (negation), contain optional sections and even entire sub-queries. The results can be freely ordered, grouped and those groups can be aggregated over.
A basic SELECT query can look like this:
This query returns the names of all people in the database. But we could make it more complex:
This would give us an alphabetical list of all the people in the database who were born before the year 2000.