Querying Data with SPARQL

This training was developed in the context of the Swiss Personalized Health Network (SPHN) initiative. SPHN provides projects a framework to semantically represent data in RDF using internationally recognized terminologies (e.g. SNOMED CT and LOINC).

Having data in RDF researchers can benefit from the graph technologies to answer specific research questions with the use of queries. SPARQL is the standard querying languages that enables to explore RDF graphs and retrieve wanted results. In this training, we provide a short introduction to SPARQL before showcasing two concrete examples of queries that answer the following questions:

  • Which patients are allergic to a certain substance?
  • Which patients had a certain lab test done?

With these questions, we explore the use of knowledge provided in external terminologies (SNOMED CT and LOINC) as well as reasoning possibilities offered in RDF (inference).


This course assumes that your data is loaded into your triplestore (in our example, GraphDB). If you need instructions on this step, please watch our training RDF Schema and Data Visualization or read our user guide.

External documentation:

- SPARQL Documentation

Scientific topics: Computer science, Data management, FAIR data, Medical informatics

Operations: Query and retrieval, Database search, Data handling, Data retrieval

Keywords: Clinical data, SPARQL, Query data, RDF, Knowledge graph, SNOMED CT, LOINC

Resource type: Video, Training materials with mock data, E-learning

Target audience: Research Scientists, Data Managers, Biomedical Researchers, Bioinformaticians, Data Scientists

Difficulty level: Beginner

Licence: Creative Commons Attribution-NonCommercial-Share-Alike 4.0

Authors: Personalized Health Informatics Group, Vasundra Touré

Contributors: Philip Krauss, Sabine Österle

Querying Data with SPARQL https://tess.elixir-europe.org/materials/querying-data-with-sparql This training module will provide researcher with an introduction to SPARQL queries for health-related data. Philip Krauss Sabine Österle Computer science Data management FAIR data Medical informatics Clinical data, SPARQL, Query data, RDF, Knowledge graph, SNOMED CT, LOINC Research Scientists Data Managers Biomedical Researchers Bioinformaticians Data Scientists