Generate interactive timelines from live Wikidata SPARQL queries
This tool allows you to generate an interactive HistropediaJS timeline using live results from a Wikidata SPARQL query.
Enter your query into the input box below, then click the GENERATE TIMELINE button to see the results.
The system will guess which variables in your query should be used to render the timeline, but you can choose manually using the Map variables section below. This can also be used for choosing variables to use as colour codes and filters for the resulting timeline.
= Colour code = Filters
Tick this box to merge duplicate results in your query into single items on the timeline.
When ticked, you must also fill out the Group by input box which appears.
Enter the name of a variable from your query.
e.g. item
The value of this variable will be used to determine which results are unique (any results with the same value for this variable will be merged together)
Note: The system will only merge items that also have the same date. For example, a timeline of presidents can have the same person appearing more than once, but they will have different dates so will not be merged (while multiple versions of the president on the same date will be merged).
This settings allows you to control how many events are visible on the screen at one time.
Lower ranked events are hidden until you zoom in further towards them, allowing you to see a broad overview of the key events.
Use "low" density for the least cluttered timeline, but with most content hidden at any one time.
Use "all" to show everything without any hiding of events by rank.
Enter the name of a variable used in your query.
e.g. itemLabel
The values returned in the query results will be used for the title text on each timeline item.
Enter the name of a variable used in your query.
e.g. englishArticle
The values returned in the query results will be used for the hyperlink when a user double clicks on a timeline item.
Enter the name of a variable used in your query.
e.g. birthDate
The values returned in the query results will be used for the start date of each timeline item.
Required data type: date
Enter the name of a variable used in your query.
e.g. birthDatePrecision
All start dates will have DAY precision if you leave this input field blank.
The values returned in the query results will be used to determine the precision of each corresponding start date. This affects how the start date is displayed on the event card, as well as how the duration is shown on the timeline.
Required data type: Integer (as returned automatically when you query for date precision in Wikidata).
You can manually set precision by binding any of the values below to the variable you are using for precision.
e.g. To make all start dates year precision, you could include (9 as ?start_precision) in your SELECT clause, then enter start_precision in this input field.
Enter the name of a variable used in your query.
e.g. deathDate
The values returned in the query results will be used for the end date of each timeline item.
Required data type: date
You can star events on the timeline to compare timespans (which are only shown for starred events and the currently selected event).
Enter the name of a variable used in your query.
e.g. deathDatePrecision
All end dates will have DAY precision if you leave this input field blank.
The values returned in the query results will be used to determine the precision of each corresponding end date. This affects how the end date is displayed on the event card, as well as how the duration is shown on the timeline.
Required data type: Integer (as returned automatically when you query for date precision in Wikidata).
You can manually set precision by binding any of the values below to the variable you are using for precision.
e.g. To make all end dates year precision, you could include (9 as ?end_precision) in your SELECT clause, then enter end_precision in this input field.
Enter the name of a variable used in your query.
e.g. image
The values returned in the query results will be used as the image URL for each corresponding timeline item.
Required data type: URL
Enter the name of a variable used in your query.
e.g. articleCount
The order of your SPARQL query results will be used as rank if you leave this field blank.
The numerical value returned in the query results will be used to determine the importance each corresponding timeline item (larger number indicates greater importance).
Items with the highest rank are always displayed in the most prominent postition as you pan, zoom and filter the timeline.
Required data type: Any number
e.g. An integer from a COUNT command in SPARQL, or a Wikidata quantity like 'length'
Enter the name of a variable used in your query, or a comma separated list of variables for multiple colour code options.
e.g. place_of_birth (single option) OR population, gender, rank (multiple options)
The values returned in your query results will be used to organise the items on your timeline into colour coded groups. A legend can be displayed by clicking on the icon on the timeline page, which also allows you to show/hide individual groups.
If the values in your results are numbers (e.g. when querying for population), then a colour scale will be created to visualise the relative sizes.
For any other data types, the values will be used as categories (e.g. when querying for a birth place label).
NOTE: The colour scale is only divided using integer values (whole numbers) at present, so will not work when the range of values in your query is small (i.e. if the range of each category is less than one)
Required data type: Number (for colour scale), or Any other type (for categories)
Enter a whole number.
e.g. 5
This number indicates the maximum number of colour code groups that are allowed. If there are more than this number of groups, the excess groups will be merged together into a miscellaneous group.
NOTE: If your chosen query variable returns a number, then colour scale colour coding will be used. In this case the Max no. of groups determines the number of divisions to use for the colour scale
Required data type: Integer (whole number)
Enter the name of a variable used in your query, or a comma separated list of variables for multiple filter options.
e.g. occupation (single option) OR occupation, gender, place_of_study (multiple options)
The values returned in your query results will be used to create the filter options on the resulting timeline.
One filter group will be created for each variable you include in the input field. The name of each filter group will be the same as the variable that was used to create it (TIP: all underscore characters are replaced with spaces in the user interface).
The filters can be accessed by clicking the 'add filter' button within the colour code and filtering panel on the resulting timeline (if the panel is closed, just click on the icon to open it).
IMPORTANT! When you include filter options, you should also check the 'Merge duplicates' box (next to the 'Generate timeline' button) and choose which variable to 'Group by' in the input box that appears next to it.
If you do not fill in this information then the system will try and guess which variable to use for merging duplicate items and may give unexpected results.
Merging duplicate results:
The merge duplicates options allows you to combine multiple query results relating to the same items.
e.g. The Mona Lisa depicts 9 different things, so querying for this data creates at least 9 separate results. The merge function combines this into a single Mona Lisa item on the timeline which has all 9 'depict' values associated with it, so that it will respond to any of those filter selections (e.g. "sky", "woman", "mountain" etc).
No colour code set |
No filters selected - click below to add a filter
This tool allows you to generate an interactive timeline using live results from a Wikidata SPARQL query.
The system will guess which variables in your query should be used to render the timeline, but you can also choose manually by entering variable names into the relevant input boxes in the "Map variables" section. You can also use this section to add colour coding and filter options to your timeline.
Links are very long, a link shortener will come soon. To make things easier we reccomend copy the url to the clipboard and shortening it at tiny URL
Choose one of the export options, then copy the output below.
The JSON output can be loaded directly into any HistropediaJS timeline.
The Histropedia Sheets output can be pasted into a Google Spreadsheet for use with the Histropedia Sheets tool. This allows you to edit the timeline data in any desired way, or add custom events not available on Wikidata.
Any data used as a colour code or filter option will be included in the export.
If your query contains variables named "item", "itemDescription" or "wikipedia", then these will also be included automatically.