Help:Timeline format
| Timeline format |
|---|
| What: |
| Displas query results in interactive timelines |
| Provided by: |
| Semantic Result Formats |
| Added in version: |
| 1.4.0 |
| Removed in version: |
| still supported |
| Further Requirements: |
| none |
| Format name: |
| timeline |
| Authors: |
| Markus Krötzsch, Jeroen De Dauw |
| Categories: |
| misc |
Note: this result format is in need of a maintainer. Contact Jeroen De Dauw for more info.
The result format timeline is used to display query results in interactive timelines. This format was part of SMW until SMW 1.3 and is now part of the Semantic Result Formats extension. 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.
Parameters
The timeline format uses printout statements in queries for properties of datatype 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.
The timeline formats introduces 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.
| Parameter | Type | Default | Description |
|---|---|---|---|
| limit | Whole number | 20 | The maximum number of results to return |
| offset | Whole number | 0 | The offset of the first result |
| headers | Text | show | Display the headers/property names |
| mainlabel | Text | no | The label to give to the main page name |
| link | Text | all | Show values as links |
| timelinebands | List of text items | required | Defines which bands are displayed in the result. |
| timelineposition | Text | required | Defines where the timeline initially focuses at. |
| timelinestart | Text | required | A property name used to define a first time point |
| timelineend | Text | required | A property name used to define a second time point |
| timelinesize | Text | required | The height of the timeline (default is 300px) |
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:
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.