Introduction to Open Data
  • Home
  • Syllabus
  • Exercises
    • Exercise 1: OA Deep Dive
    • Exercise 2: Movements and Principles
    • Exercise 3: Up to date with Linked Data
    • Exercise 4: Discovering ORD Platforms
    • Exercise 5: The Reuser’s Perspective (OGD)
    • Exercise 6: Reading Assignment
    • Exercise 7: Open Refine
    • Exercise 8: IIIF & ML
  • Course Sections
    • Characteristics of Open Data
    • Associated Movements
    • Associated Principles
    • Open Data Platforms and Organisations
    • Assessment, Data Quality, and Best Practices
    • Techniques, Software, and Tools
    • Showcases
  • Recap
  • References
  • About

On this page

  • Up to date with Linked Data
    • The Four Principles of Linked Data
    • Understanding RDF Triples
    • Turtle Syntax
    • SPARQL Queries
  • Exercises (15-20 minutes)
    • A: Understanding Turtle Syntax (4-5 minutes)
    • B: Real-World SPARQL Exploration (6-8 minutes)
    • C: Reflection Questions (5-7 minutes)
  • Additional Resources
  • Edit this page
  • Report an issue

Exercise 3: Up to date with Linked Data

Author
Affiliations

Julien A. Raemy

docuteam SA

University of Bern

Published

February 4, 2026

Modified

February 20, 2026

Up to date with Linked Data

Linked Data is about publishing structured data on the web so that it can be interlinked and become more useful through semantic queries. It extends standard web technologies (HTTP, URIs) to share information in a machine-readable way.

The Four Principles of Linked Data

Tim Berners-Lee defined four principles for publishing data on the web:

  1. Use URIs as names for things - Give everything a unique web address
  2. Use HTTP URIs - Make those addresses accessible via the web
  3. Provide useful information - When someone looks up a URI, return data using standards (RDF, SPARQL)
  4. Include links to other URIs - Enable discovery of related information

Understanding RDF Triples

RDF (Resource Description Framework) represents data as triples: subject-predicate-object statements.

Example: “Vincent van Gogh created the Starry Night painting”

subject:   <http://example.org/artist/vangogh>
predicate: <http://example.org/vocab/created>
object:    <http://example.org/artwork/starrynight>

Turtle Syntax

Turtle (Terse RDF Triple Language) is a human-readable syntax for RDF. Let’s look at a cultural heritage example:

@prefix ex: <http://example.org/> .
@prefix schema: <http://schema.org/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .

ex:vangogh a foaf:Person ;
    foaf:name "Vincent van Gogh" ;
    foaf:birthday "1853-03-30" ;
    schema:nationality "Dutch" ;
    ex:created ex:starrynight .

ex:starrynight a schema:Painting ;
    schema:name "The Starry Night" ;
    schema:dateCreated "1889-06" ;
    schema:material "Oil on canvas" ;
    schema:creator ex:vangogh ;
    schema:location ex:moma .

ex:moma a schema:Museum ;
    foaf:name "Museum of Modern Art" ;
    schema:location "New York, USA" .

Key elements:

  • @prefix declares namespace prefixes
  • a means “is of type”
  • ; continues statements about the same subject
  • . ends a group of statements

SPARQL Queries

SPARQL is the query language for RDF data. It allows you to find patterns in the data.

Basic SPARQL query structure:

PREFIX ex: <http://example.org/>
PREFIX schema: <http://schema.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

SELECT ?subject ?predicate ?object
WHERE {
    ?subject ?predicate ?object .
}

Find all paintings:

SELECT ?painting ?name
WHERE {
    ?painting a schema:Painting ;
              schema:name ?name .
}

Find artworks created by Van Gogh:

SELECT ?artwork ?title
WHERE {
    ex:vangogh ex:created ?artwork .
    ?artwork schema:name ?title .
}

Exercises (15-20 minutes)

A: Understanding Turtle Syntax (4-5 minutes)

Look at the following Turtle snippet describing a manuscript:

@prefix ex: <http://library.org/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix schema: <http://schema.org/> .

ex:manuscript_042 a schema:Book ;
    dc:title "Grandes Chroniques de France" ;
    dc:creator "Anonymous" ;
    schema:dateCreated "1375" ;
    ex:heldBy ex:chateauroux_library .

ex:chateauroux_library a schema:Library ;
    schema:name "Bibliothèque municipale de Châteauroux" ;
    schema:location "France" .
  • What type of resource is ex:manuscript_042?
  • How many triples have ex:manuscript_042 as their subject?
  • What relationship links the manuscript to the library?
TipHints for Part A
  • Type of resource: Pay attention to the keyword a in Turtle — it is shorthand for rdf:type. What comes right after a on the line where ex:manuscript_042 is first described?
  • Counting triples: Each property-value pair (including the a statement) about a subject is one triple. Remember that ; separates multiple triples sharing the same subject. Count each line carefully.
  • Relationship to the library: Look for the triple where the object is ex:chateauroux_library. The predicate (property) in that triple is your answer.

B: Real-World SPARQL Exploration (6-8 minutes)

Visit the Wikidata Query Service: https://query.wikidata.org/

Try this query to find Van Gogh paintings with images:

SELECT ?painting ?paintingLabel ?image
WHERE {
    ?painting wdt:P31 wd:Q3305213 ;    # instance of painting
              wdt:P170 wd:Q5582 ;       # creator: Vincent van Gogh
              wdt:P18 ?image .          # has image
    SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
  • How many paintings with images did you find?
  • Try modifying the query to find paintings by a different artist (hint: search Wikidata for another artist’s Q-number, e.g., Pablo Picasso is wd:Q5593). What artist did you choose and how many results did you get?
TipHints for Part B
  • Number of paintings: After running the query, the Wikidata Query Service shows the total result count at the bottom of the results table. You should find several dozen results for Van Gogh.
  • Modifying the query: The only part you need to change is wd:Q5582 (Van Gogh’s identifier). To find another artist’s Q-number, use the Wikidata search bar at wikidata.org and look for the Q-identifier on their page. Replace it in the wdt:P170 line. Some artists may have significantly more or fewer results depending on how well their works are documented on Wikidata.

C: Reflection Questions (5-7 minutes)

  • What are the main advantages of using Linked Data for cultural heritage collections?
  • What challenges might institutions face when implementing Linked Data?
  • Based on your experience with the Wikidata Query Service, what makes a SPARQL endpoint useful or difficult to use?
TipHints for Part C
  • Advantages: Think about what happens when collections from different institutions can reference the same entities (people, places, concepts). Consider aspects like discoverability, interoperability across systems, and the ability to enrich records by linking to external knowledge bases.
  • Challenges: Consider the practical side — what does an institution need in terms of expertise, tooling, and ongoing maintenance? Think also about data quality, choosing the right vocabularies/ontologies, and dealing with legacy cataloguing systems.
  • SPARQL usability: Reflect on your own experience — was the query language intuitive? Did features like auto-completion help? Think about the balance between the power of the query language and the learning curve for newcomers.

Additional Resources

  • Linked Data Principles: https://www.w3.org/DesignIssues/LinkedData.html
  • Turtle Specification: https://www.w3.org/TR/turtle/
  • SPARQL Tutorial: https://www.w3.org/TR/sparql11-query/
  • Wikidata SPARQL Examples: https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples
Back to top

Reuse

CC BY 4.0

Julien A. Raemy | Introduction to Open Data

 
  • Edit this page
  • Report an issue

Content is published under a Creative Commons Attribution 4.0 International licence