Extension "Semantic Result Formats"

From semantic-mediawiki.org
Semantic Result Formats
Provides additional formats for semantic queries
Image collection
Further Information
Homepage: → external page
Maintainer(s): James Hong Kong, Jeroen De Dauw
First released: August 2008
Release: stable
Development: active
Area of usage: Displaying data
Association:SMW = Semantic MediaWiki, SB = Extension "Semantic Bundle", MW = MediaWiki SMW, SB
Shortcut:This is the shortcut to mark the beginning of the subject line when writing a support request to the mailing list or to the extension's author directly. See also this help page. SRF
Composer: → external page
Repository: → external page
Wikidata-ID: Q21678508
Table of Contents

Semantic Result Formats is an extension to extension "Semantic MediaWiki"Allows to store and query data annotated to pages that adds a large number of further result formats, including formats for calendars, timelines, charts, graphs and mathematical functions. The result formats can be used in inline queries and other semantic searches.

Result formats provided[edit]


  • Array format (Comma-separated list, with additional outputs shown in parentheses and extra formatting options)
  • Filtered format (Displays query results as switchable views, offers to filter)
  • Hash format (Comma-separated list, with additional outputs shown in parentheses and extra formatting options)
  • Incoming format (Displays incoming properties to a page or property/value pair)
  • Listwidget format (Outputs results with a navigation or pagination widget for lists (ordered and unordered))
  • Oltree format (Displays query results as a tree (nested HTML ordered lists))
  • Outline format (Lists pages in a hierarchical outline, based on property values)
  • Pagewidget format (Widget for embedded page content)
  • Tagcloud format (Displays queried data in a tagcloud)
  • Tree format (Displays query results as a tree (nested HTML bulleted lists))
  • Valuerank format (Lists values based on their occurrence)






  • D3 chart format (Various charts using the d3.js as visualization library)
  • Dygraphs format (high performance series charting using the dygraphs Javascript library)
  • Gantt format (Outputs the result as Gantt charts.)
  • Google bar format (Produces a bar chart using the Google Charts API)
  • Google pie format (Produces a pie chart using the Google Charts API)
  • Jqplotseries format (enable sets of numerical data to be displayed as a chart series using the jqPlot Javascript library)
  • Sparkline format (generates small inline charts (also known as sparklines))
  • Timeseries format (aggregated values assigned to a date (property type date) are plotted as a line/bar chart)
  • Jqplotchart format (Displays aggregated numerical data as a bar, line, pie, or donut chart)


  • Datatables format (legacy) (A progressive table result printer that integrates the DataTables JavaScript library)
  • Datatables format (Provides a complete porting of DataTables JavaScript library into Semantic MediaWiki)




Semantic Result Formats requires Semantic MediaWiki to run, at least at the same second-level version number as Semantic Result Formats, i.e. SRF 1.6.2 requires SMW 1.6.x. For a full list of changes in the different versions of Semantic Result Formats, see the release notes.


See this help page outlining the software compatibility of this extension (MediaWiki, Semantic MediaWiki and PHP).


See this help page outlining how to install this extension.


Enabling additional formats

If nothing else is added, all but the following formats are enabled: 'exhibit', 'incoming', 'googlebar', 'googlepie' and 'jitgraph'. In order to additionally add one of these formats, you can add lines like:

$srfgFormats[] = 'googlebar';
$srfgFormats[] = 'googlepie';

... or alternatively

$srfgFormats = array_merge(
    $srfgFormats, [

... or you can override the set of formats entirely, with a call like:

$srfgFormats = [

... using one or more of the formats provided.

There are some formats that you may not want to include because they may not follow certain policies within your wiki; the formats 'googlebar' and 'googlepie', for instance, send data to external web services for rendering, which may be considered a data leak.

In the event you want to use features that are taking advantage of Google Maps (such as the map view created by the Filtered result printer), please assign a valid Google Maps key to the $wgGoogleMapsKey variable in "LocalSettings.php". Otherwise, these features will not be available. If you do not yet have a Google Maps key for your wiki, you can get one at https://developers.google.com/maps/documentation/geocoding/get-api-key?hl=en.


Some data seems to be ignored in the results.

By default, inline queries return 50 pages. Even if you're aggregating the results, using distribution=yes, that limit still applies. You probably need to increase the limit, by setting the |limit= parameter within the query, and (if you need to query more than 500 pages) by setting configuration parameter $smwgQMaxInlineLimitSets the maximal number of rows ever printed by queries in "LocalSettings.php" as well.

See also[edit]