Skip to content

cdrini/wikidata-timeline

Repository files navigation

banner image View it live here: https://tools.wmflabs.org/wikidata-timeline/

Web app for visualizing Wikidata items in the form of a timeline.

Developed on/for Chrome 44+. Firefox/IE also tested to be stable, but might have some issues.

When using WDQ, these properties are used for determining time:

  • startTime: 'P577', 'P580', 'P569', 'P571'
  • endTime: 'P577', 'P582', 'P570', 'P576'

If endTime is missing, applies a default value (see the defaultEndTime url parameter). If startTime = endTime, displayed as a point. Performs rounding when endtime is 'someValue'.

URL Params

Valid on the timeline view and the new view.

Note: Boolean parameters are true for any value which is not "false".

Name Type Default Description
title String Untitled Timeline's title. Useful so that your browser's history doesn't display the same thing for different timelines.
sparql String The SPARQL Query to use for the visualization. Expects the 1st variable to be items, 2nd to be labels, 3rd to be start time, and 4th to be end time (optional; see defaultEndTime parameter)). Try it/learn more at Wikidata Query Service.
wdq String The Wikidata Query from which to get items. See WDQ's Documentation for help. Note this is translated to SPARQL using WDQ2SPARQL, so some features might not be available.
defaultEndTime String now One of "now" or "start".
(also useful for resolving P571(inception) ambiguity).
embed Boolean false If true, optimizes view for embedding in an iframe.
widthOfYear Number widthOfYear How many pixels wide a year should be on the timeline

WDQ URL Params

The url parameters work if the wdq is present.

Name Type Default Description
languages CSV en,fr The languages to use, ordered by preference. If no label in the given lang(s), stays blank
sitelink String wikidata What an item links to when clicked. Language determined by languages. Possible values: [ 'wikisource', 'commonswiki', 'wikibooks', 'wikiquote', 'wiki', 'wikinews', 'wikidata' ]
sitelinkFallback Boolean true If true, when the desired sitelink is not available, links to wikidata. If false, links to nothing.

Deprecated URL Params

Please do not use these parameters.

  • query: Now an alias for wdq

Credits

Services/APIs

Libraries