Help:Timeline format

From semantic-mediawiki.org

Jump to: navigation, search

The result formats timeline and eventline are used to display query results in interactive timelines. They are both defined within the Semantic Result Formats extension (since SMW 1.4.0). Obviously, only results that include dates can be displayed in this way. This format only works when JavaScript is enabled.

Example

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

This produces the following output:

Use a JavaScript-enabled browser to view this element. Browse the result list directly.MONTHYEARSemantic MediaWiki 1.5.0 released: inverse properties, printout parameters, improved code2010-03-07T00:00:000News date 7 March 2010
SMW Homepage Open for Editing2009-12-29T00:00:000News date 29 December 2009
Call for participation in GSoC 20102009-12-02T00:00:000News date 2 December 2009
SMW Camp 2009 in Karlsruhe2009-10-12T00:00:000News date 12 October 2009
PDF Version of SMW Manual Available2009-08-16T00:00:000News date 16 August 2009
Semantic MediaWiki 1.4.3 released: tracking input errors, new query options, less bugs2009-08-05T00:00:000News date 5 August 2009
Security Alert for SRF Ploticus2009-05-05T00:00:000News date 5 May 2009
Semantic MediaWiki at CeBit 20092009-02-18T00:00:000News date 18 February 2009
Semantic MediaWiki 1.4.2 released: Better performance, PostgreSQL support, JSON export2009-02-11T00:00:000News date 11 February 2009
New data visualization for SMW: Exhibit and Ploticus2009-01-22T00:00:000News date 22 January 2009
2010-03-07T00:00:00


Usage and parameters

The timeline formats use printout statements in queries for properties of Type:Date. If the timeline remains empty even though there are resutls, 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.

Eventline is similar, but displays all dates in the printout as separate points. So a query with five data printouts would create five points on the timeline for each result. Different colors are used to maintain some visual hint of which points belong to which result. Again the tooltip shows all details.

The timeline and eventline formats introduce the following additional parameters:

  • timelinebands: defines which bands are displayed in the result. Available bands are DECADE, YEAR, MONTH, WEEK, and DAY. Bands should be given from finer to coarser, and be separated by commas as in the above example.
  • timelineposition: defines where the timeline initially focusses at. Possible values are start (earliest entry), middle (middle entry), end (latest entry).
  • timelinestart: can be used to define a specific printout (property) name to use as a first timepoint in timeline.
  • timelineend: can be used to define a specific printout (property) name to use as a second timepoint in timeline.
  • timelinesize: can be used to give the height of the timeline. The default value is 300px.

Remarks

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.

This documentation page applies to all SMW versions from 1.4.0 to the most current version.
Other versions: 0.6 – 1.3      

Help:Timeline format en 1.4.0

Personal tools