SPARQL Protocol and RDF Query Language (SPARQL) is a query language defined by the W3C standard for querying RDF data. For further information on SPARQL, see background-sparql.

The SPARQLer tool

The SPHN SPARQL Queries Generator (SPARQLer) is a Python tool that accepts as input an SPHN RDF Schema (Turtle format) and generates a series of SPARQL queries in a standard RDF/OWL format based on the concepts present in the schema. The tool is integrated into the SPHN Framework Schema Visualization Tool.

The automatically generated queries could be executed against a SPARQL endpoint by data managers and hospitals to retrieve the content of the RDF data in a tabular format.


Available SPARQL Queries

‘Concept flattening’ queries:

Composed of one query per concept/class. The output is a table that ‘flattens’ the data. Each query gives the list of resources defined for that concept together with the direct property values (see Concept Flattening in the SPARQLer).

Statistical queries:

  • Query per concept/class: Counting the instances per concept and predicate

  • Query per concept/class: Minimum and maximum of predicates (dates or values)

  • Query per concept/class: List and count of all used codes for hasCode

  • Manually built queries, based on the hospIT statistics queries - simply adapted prefixes, class and property names to fit the SPHN RDF Schema 2021-1

Availability and usage rights

© Copyright 2022, Personalized Health Informatics Group (PHI), SIB Swiss Institute of Bioinformatics.

The SPARQLer is available at (send request to DCC -

The SPARQL queries for the SPHN RDF Schema 2021-2 and 2022-2 are available at sparql-queries.

The SPARQLer is licensed under the GPLv3 (see License).

For any question or comment, please contact the Data Coordination Center (DCC) at