Chapter 3. SPARQL Queries: A Deeper Dive
Chapter 1 gave you your first taste of writing and running SPARQL queries. In this chapter, weâll dig into more powerful features of the SPARQL query language:
- More Readable Query Results
URIs are important for identifying and linking things, but when itâs time to display query results in an application, users want to see information they can read, not something that looks like a bunch of web addresses.
- Data That Might Not Be There
In Chapter 1, we started learning how to request data that matches certain patterns. When you can ask for data that may or may not match certain patterns, it makes your queries more flexible, which is especially useful when exploring data youâre unfamiliar with.
- Finding Data That Doesnât Meet Certain Conditions
Much of SPARQL is about retrieving data that fits certain patterns. What if you want the data that doesnât fit a particular patternâfor example, to clean it up?
- Searching Further in the Data
SPARQL offers some simple ways to ask for a set of triples and additional triples that may be connected to them.
- Eliminating Redundant Output
If youâre looking for triples that fit some pattern, and a SPARQL query engine finds multiple instances of certain values, it will show you all of themâunless you tell it not to.
- Combining Different Search Conditions
SPARQL lets you ask, in one query, for data that fits certain patterns and other data that fits other patterns; you can also ask for data that meets either ...
Get Learning SPARQL, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.