SPARQL/Views

This page helps you to understand the various possibilities to display results on Wikidata Query. The query example page contains many good examples you can try!

After running a query, you can choose with the "Display" button which result view you want to display. Depending on your query and the data type, some of the views will be available.

Default View
The default view can be changed for each SPARQL query by using a comment For example:

Table (default)
Shows the result data as table. It is the default view for results and can display every data type.

This will map every variable from the SPARQL select clause to a formatted table column.

Image Grid
The  shows the result data as a grid with images.

Every grid item has a big picture and opens the gallery when clicking on it.

Contents an item is the formatted row data.

Rows containing no image will be ignored.

Options:

Map
The  shows the result data as map with OpenStreetMap data.

Options:

specified using  using the array if there are multiple variables.

Technically, any well-known text literal can be displayed, not just a point coordinate.

Some Geoshapes are available via property. See this example for the countries.

Geometry values can also be constructed in SPARQL using functions like  and   – see this map of Czech railway lines for an example of   geometry.

Line, Area, Bar and Scatter Chart
,,   and   shows one of these chart types.

Bubble Chart
The  shows a bubble chart where the size and the color of the bubble can configured.

When an item is provided a bubble is linked to Wikidata.org.

Tree Map
shows a zoomable tree map.

Tree
shows an expandable tree.

Timeline
shows an explorable timeline.

Options:

Dimensions
shows dimension and their links.

It also allows filtering them by selecting an axis fraction.

Graph
Shows an interactive graph that allow hierarchically ordering and exploring items.

Formatting
There is special formatting for the following data types:

Mobile / Responsive
Result views are made to work on different devices and resolutions. Their appearance may change depending on the space they can use.

Embed Mode
Result views can be linked or embedded via iframes. You can get the regarding link or code by clicking Link in the above menu. See the difference: link to a query and link to a result or the embed code:

Download results


There are several ways to export the results of a query.

JSON, TSV and CSV are three different open-standard formats to download the data.

You can also download some of the graphic views as a SVG file: this feature works with all the views except table, image grid, timeline, graph builder, map, and graph.

Default View
The default view can be changed for each SPARQL query by using a comment: For example:

Result view options
Result views can be configured with various options, which are specified in format, either following the   comment or following a separate   comment.

External tools
See Wikidata:Tools/Visualize data for a list of external tools to visualize data.