Study Vault Search notes, aliases and full text
Graph
LectureADISAI-written · not yet proofread

VL01 Overview, RDF & SPARQL, more SPARQL

Slide set 01, the course overview, a quick recap of RDF and SPARQL from DBIS, and further SPARQL constructs by example (FILTER with language tags, property paths, OPTIONAL, ORDER BY/LIMIT, GROUP BY with aggregation, sub-SELECT, BIND, spatial join), plus hints for exercise sheet 1 and the course organisation.

Chapters ch. Slide set 01Pages 2–40Held Source lecture-01

Course Overview#

lecture-01, PDF page 2
lecture-01, PDF page 2

Two demos: QLever implements the RDF and SPARQL standards (the subject of Lectures 1–3), and GRASP is an LLM-driven agent that explores a graph database interactively. The planned blocks are knowledge graphs (intro, indexing, query planning), efficiency (merge joins, compression), embeddings (LSI, word embeddings, vector databases), NLP learning (logistic regression to language models) and question answering (question to query) (Slides 3–6).

Intro to RDF and SPARQL#

lecture-01, PDF page 7
lecture-01, PDF page 7

A quick recap of DBIS Lecture 7: the RDF data model, basic SPARQL and Reification. If it goes too fast, rewatch DBIS Lecture 7 before working on Exercise Sheet 1 (Slide 7).

RDF and the Graph View#

All data is a set of subject predicate object . triples (RDF Triple). Each distinct entity is a node and each triple a directed edge from subject to object, so a knowledge graph is a directed graph (Slides 8–9).

IRIs and Large Knowledge Graphs#

Entities and predicates are named by globally unique IRIs, usually ID-like (wd:Q37459 for Nicole Kidman), with names attached by rdfs:label triples and literals carrying language tags or datatypes (Wikidata Prefix System). The three KGs used in ES1 are Wikidata (18 B triples, 66 k predicates), OpenStreetMap (217 B, 115 k) and DBLP (1.6 B, 121) (Slides 10–11).

SPARQL Queries as Graph Patterns#

A SPARQL query is a set of triples with variables. Its result is a table with one row per assignment to the variables such that all query triples exist, i.e. one row per match of the small query graph in the large KG (Slides 12–13).

Interoperability#

Two datasets are combined by a few triples linking their IDs (wd:Q183 wdtn:P402 osmrel:51477), which enables federated queries across Wikidata and OpenStreetMap. For relational databases, combining datasets is hard because of different schemas and identifiers (Slide 14).

More SPARQL by Example#

lecture-01, PDF page 15
lecture-01, PDF page 15

SPARQL 1.1 is a W3C standard that fixes syntax and semantics. The following constructs are shown by example on Wikidata, DBLP and OpenStreetMap. They are far from complete but cover everything needed for ES1 (Slide 15).

FILTER and Language Tags#

FILTER (LANG(?person_name) = "en") keeps only English labels of people born in Honolulu (SPARQL Query Structure) (Slide 16).

Property Paths#

?city wdt:P31/wdt:P279* wd:Q515 matches one “instance of” edge followed by zero or more “subclass of” edges, which finds all German cities. There is one result per path, so the query needs DISTINCT (Property Path) (Slide 17).

OPTIONAL#

OPTIONAL { … } adds the Hindi name of a city if one exists and keeps the city otherwise. A second OPTIONAL for the Arabic name acts as a fallback (Optional Graph Pattern) (Slides 18–19).

ORDER BY and LIMIT#

ORDER BY DESC(?population) LIMIT 10 gives the ten most populous German cities (Ordering) (Slide 20).

GROUP BY and Aggregation#

GROUP BY ?venue ?name with (COUNT(?paper) AS ?num_papers) counts the papers per DBLP venue (SPARQL Aggregation) (Slide 21).

Sub-SELECT#

The same result, computed more efficiently: aggregate per venue in an inner SELECT and join the name once per venue afterwards (SPARQL Aggregation) (Slide 22).

BIND#

BIND (REPLACE(STR(?venue), ".*/", "") AS ?name) adds a column holding the part of the venue IRI after the last / (SPARQL BIND) (Slide 23).

Spatial Join#

On OpenStreetMap, FILTER (geof:distance(…) <= 500) with metres as unit finds all buildings within 500 m of Freiburg Hauptbahnhof (Spatial Join) (Slide 24).

Hints for Exercise Sheet 1#

lecture-01, PDF page 25
lecture-01, PDF page 25

Exercise 1: find queries on the three endpoints at adbis.qlever.dev (Wikidata, OpenStreetMap, DBLP), using the SPARQL autocompletion or exploratory queries, and build each query incrementally. Exercise 2: install QLever, build an index for the given data with the provided Qleverfile and start a server (Slides 25–26, ADIS Sheet 01 (not published)).

Organization and Credits#

lecture-01, PDF page 27
lecture-01, PDF page 27

13 recorded lectures (last one on 2027-02-09), materials on the Wiki and in SVN /public. 12 exercise sheets, due at 12:00 before the next lecture, voluntary (no 50 % threshold), group work allowed (only one person commits). No tutorials and no weekly Q&A; feedback by the Friday after the deadline if requested in experiences.md, plus the forum and individual tutor appointments (Slides 27–32). 6 ECTS ≈ 180 h, about 8 h per sheet. The Studienleistung only requires registering on Daphne and for the exam (deadline 2027-01-17). The exam is written, with four tasks of 25 points each; 50 points give a 4.0 and 95 a 1.0, linear in between (Slides 33–35). Course systems: Daphne, forum, SVN and the build system (Slides 36–40).

Concepts#

Search

Type In
↑ ↓ move ↵ open ⇥ next section Ctrl↵ results page Prefix # to search text only