Help:Timeline format

From semantic-mediawiki.org
Help:Timeline format时间轴格式
Timeline format
Displays query results in interactive timelines
Further Information
Provided by: Extension "Semantic Result Formats"
Added: 1.4.0
Removed: still supported
Requirements: none
Format name: timeline
Enabled? Indicates whether the result format is enabled by default upon installation of the respective extension. yes
Authors: Markus Krötzsch
Categories: time
Keywords
Table of Contents
This result format is not currently maintained. It might not work with the latest version of Semantic MediaWiki.

The result format timeline is used to display query results in interactive timelines. This format was part of Semantic MediaWiki until Semantic MediaWiki 1.3.0Released on 7 September 2008 and compatible with MW 1.12.x - 1.15.x. and is now part of extension "Semantic Result Formats"Provides additional formats for semantic queries. Obviously, only results that include dates can be displayed in this way. This format only works when JavaScript is enabled. It is very similar to the eventline format.

Usage[edit]

The timeline format uses printout statements in queries for properties of datatype "Date"Holds particular points in time. If the timeline remains empty even though there are results, this is usually because no printouts for dates were specified. Timeline will normally use the first and optionally second date and display every result as a single point (one date given) or interval (two dates given). All other printout statements are shown in the tooltips that appear when clicking on items.

Parameters[edit]

Parameter Type Default Description
timelinesize text 300px The height of the timeline
timelineposition text middle Defines where the timeline initially focuses at.
timelinestart text empty A property name used to define a first time point
timelineend text empty A property name used to define a second time point
timelinebands list of texts MONTH, YEAR Defines which bands are displayed in the result.
template text empty The name of a template with which to display the printouts
named args yes/no no Name the arguments passed to the template

Available values for parameters:

  • timelinebands: Available bands are DECADE, YEAR, MONTH, WEEK, DAY, HOUR and MINUTE. Bands should be given from finer to coarser, and be separated by commas as in the example below.
  • timelineposition: Possible values are start (earliest entry), middle (middle entry), end (latest entry), today.

Example[edit]

{{#ask:
 [[News date::+]]
 [[Language code::en]]
 |?News date
 |sort=News date
 |order=descending
 |format=timeline
 |timelinebands=MONTH,YEAR,DECADE
 |timelineposition=end
 |limit=150
}}

This produces the following output:

Remarks[edit]

Page load times can be slowed down by timelines, especially if a large number of events is displayed. It is useful to use a smaller limit to keep the timeline more manageable for browsers.

Sorting results has no impact on the display of the timeline, since it always displays events chronologically. However, sorting can be very useful to select, e.g. the ten latest events instead of ten arbitrary events for display.