RDF - SPARQL
- Lesson title: RDF - SPARQL
- Keywords: SPARQL, Query language, endpoint
- Objective/Description: In this lesson we will query the Semantic Web with SPARQL, we will show some examples and explain the different query elements
- Learning outcomes:
- Naming the elements part of a SPARQL query
- Explaining the relation between SPARQL and RDF / RDF-Schema
- Using SPARQL queries to retrieve data from RDF graphs
- Comparing SPARQL queries as different possibilities can be used to answer the same question
Resources
Questions and answers
These Q&A aim to validate a basic understanding of concepts discussed during the lecture. The use of such concepts is beyond the scope of this Q&Astudy set as it is addressed via projects and hands-on for those enrolled in the corresponding university course.
What is a triple store?
A triple store is a non-SQL graph-based database for the storage and retrieval of RDF triples. Commonly supporting all (or at least a couple) of the RDF available formats/syntaxes (i.e. RDF/XML, JSON-LD, Turtle, N3).
What is SPARQL?
SPARQL Protocol And RDF Query Language is a query language for RDF data.
What are the main parts of a SPARQL query?
SELECT and then optional the elements we want to retrieve. WHERE and then the conditions of the retrieval. Example: SELECT ?ingredient WHERE { ?pizza pizza:hasIngredient ?ingredient . } A Wikidata example: SELECT ?protein ?proteinLabel WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } ?protein wdt:P31 wd:Q8054. }
Name some SPARQL endpoints in the biomedical domain
What is Wikidata?
Wikidata is a free and open knowledge base that can be read and edited by both humans and machines (Wikidata). Wikidata acts as central storage for the structured data of its Wikimedia sister projects including Wikipedia, Wikivoyage, Wiktionary, Wikisource, and others (Wikidata).