Semantic Result Formats 1.4.0 - 1.8.0

Jump to: navigation, search
Semantic Result Formats
Additional formats for Semantic MediaWiki inline queries
Image collection
Further Information
Homepage: follow this link
Maintainer(s): James Hong Kong, Yaron Koren, Jeroen De Dauw
First released: August 2008
Release status: stable
Development status: active
Area of usage: Displaying data
Associated with: SMW, SB
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.
Repository: Git [?]:
Wikidata-ID: not yet provided
Table of Contents

Semantic Result Formats is an extension to Semantic MediaWiki (SMW) that adds a large number of further Result formats to Inline queries, including formats for calendars, timelines, charts, graphs and mathematical functions.

Result formats added by Semantic Result Formats


  • Array format (Comma-separated list, with additional outputs shown in parentheses and extra formatting options)
  • Filtered format (Displays query results as switchable views, offers filtering)
  • 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 (Navigation widget for lists)
  • 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)


  • Average format (Displays the average of all queried numerical data)
  • Max format (Displays the maximum of all queried numerical data)
  • Median format (Displays the median of all queried numerical data)
  • Min format (Displays the minimum of all queried numerical data)
  • Product format (Displays the product of all queried numerical data)
  • Sum format (Displays the sum of all queried numerical data)




  • D3 chart format (Various charts using the d3.js as visualization library)
  • Dygraphs format (high performance series charting using the dygraphs Javascript library)
  • 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 (A progressive table result printer that integrates the DataTables JavaScript library)




You can see the version history here.


Semantic Result Formats can be obtained in several ways:

git clone

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.


In order to include the default available result formats, simply add the following line to your LocalSettings.php:


Enabling additional formats

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

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

...or alternatively

$srfgFormats = array_merge( $srfgFormats, array( 'googlebar', 'googlepie' ) );

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

$srfgFormats = array('calendar', 'timeline', 'exhibit');

... using one or more of the following values: average, bibtex, calendar, eventline, exhibit, googlebar, googlepie, graph, icalendar, jqplotbar, jqplotpie, max, min, outline, sum, timeline, vcard.

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 Exhibit 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 don't yet have a Google Maps key for your wiki, you can get one at


I have a spinning wheel but no output

If you see a spinning wheel but no actual output chances are high that the ResourceLoader could not located a JavaScript resource or had a problem to execute a dependency. In either case the problem of a "rouge" JavaScript needs to be resolved before the printer format can load their JavaScript plugin module to provide an output result.

Using &debug=true together with a tool like Firebug will most likely help to find the delinquent JavaScript resource.

Mailing list

You should use the Semantic MediaWiki mailing list, semediawiki-user, for any questions, suggestions or bug reports about Semantic Result Formats. If possible, please add "[SRF]" at the beginning of the subject line, to clarify the subject matter.

Contributing to the project

Bugs and feature requests

You can submit bug reports and requests for new features at MediaWiki's Bugzilla, here.

The current list of known bugs and requested features for Semantic Result Formats can be found here.

Contributing patches

If you found some bug and fixed it, or if you wrote code for a new feature, please create a patch by going to the main "SemanticResultFormats" directory, and typing:

git diff >descriptivename.patch

Then go to the relevant bug report in Bugzilla, or create one if one doesn't exist (note, again, that Bugzilla is used for both bugs and feature requests), and attach this patch file to it.

If, for any reason, you don't wish to use Bugzilla, feel free to simply send this patch, with a description, to the semediawiki-devel mailing list.

See also

Talks (videos and slides)

New features in Semantic Result Formats 1.8, SMWCon Fall 2012

Automatically transforming structured data into useful output formats, Wikimania 2010

This documentation page applies to all SMW versions from 1.4.0 to 1.8.0.
Other versions: ≥ 1.9.0       Other languages: dezh-hans

Semantic Result Formats en 1.4.0 1.8.0