Help:Result formats (deferred mode)

From semantic-mediawiki.org
Result printer (deferred mode)
The @deferred query marker as identifier to delay query execution and result output generation
Collection
Keywords
Table of Contents

Semantic MediaWiki 3.0.0Released on 11 October 2018 and compatible with MW 1.27.0 - 1.31.x. extends the #ask and #show parser functions used to generate inline queries with the @deferred query marker1 as a fixed identifier to support the postponement of query execution and hereby defer (delay) the generation of query results for inline queries until after the page build process has been completed. The objective is to enable a result format to build outputs independent from the page flow and static HTML by creating a more responsive result output.

Features and limitations[edit]

The following result formats support the @deferred query marker (ResultPrinter::isDeferrable):

Result formats providing data exports (ResultPrinter::isExportFormat) do not support the @deferred query marker since they do not create an active repository connection during the page build process:
- result format "csv"Outputs results in Windows-style Comma Separated Value format.
- result format "dsv"Outputs results in *NIX-style Delimiter Separated Value format.
- result format "json"Outputs results in JSON-based serialisations.
- result format "kml"
- result format "rdf"Exports results in RDF-based serialisations.
- result format "icalendar"
- result format "icalendar"

The same applies to inline queries with the |limit=0 option.

Dynamic output control[edit]

A result output generated using the @deferred mode has a distinct control over its display characteristics (using the Ajax technique) and allows for its display to be independent from other article content.

To make us of the output control, @control query marker was added1 as an identifier to help with the generation of different control elements that are separate from a result printer (or format). By default, the identifier can be assigned a slider attribute to add a slider widget which can dynamically alter a query result by modifying the limit option.

Examples[edit]

Syntax
{{#ask:
 [[Category:Lorem ipsum]]
 |limit=3
 |@deferred 
}}
Links

See also[edit]

References

  1. a b  Semantic MediaWiki: GitHub pull request gh:smw:2398 (Add support for @deferred mode)