Extension:Semantic Result Formats

Semantic Result Formats (SRF) is a MediaWiki extension, used in conjunction with the Semantic MediaWiki extension, that bundles a number of further result formats for SMW's inline queries. The individual formats can be added to the installation independently.

You can see an explanation of Semantic Result Formats (and some related extensions, like Semantic Maps), including screenshots and example code, at the slides for the.

Formats
Semantic Result Formats defines the following formats, listed here by type:

Graphing

 * Graph - uses the GraphViz extension to graph connections between pages
 * Process - uses the GraphViz extension to display process graphs

Plotting

 * googlebar -displays a bar chart of number values, using the Google Charts API
 * googlepie - displays a pie chart of number values, using the Google Charts API
 * jqplotbar - displays a bar chart of number values, using the jqPlot Javascript library
 * jqplotpie - displays a pie chart of number values, using the jqPlot Javascript library

Time-based

 * timeline - displays pages in a scrollable timeline, using the SIMILE Timeline Javascript library
 * eventline - similar to 'timeline', but shows each page as an individual point, instead of sometimes showing date ranges as 'timeline' does
 * calendar - displays pages in a monthly calendar

Math
Each of the mathematical formats simply display a number, and take no additional parameters. It is important to ensure that the number of pages queried is not less than the complete set, for accurate results; you can set the "limit=" parameter to a high number to try to guarantee this.
 * sum - displays the sum of a queried set of numbers
 * product - displays the product of a queried set of numbers (as of version 1.6)
 * min - displays the lowest of a queried set of numbers
 * max - displays the highest of a queried set of numbers
 * average - displays the average of a queried set of numbers
 * median - displays the median of a queried set of numbers (as of version 1.6)

Documentation of these formats can be found here.

Export

 * bibtex - exports bibliographic data in the BibTeX format
 * icalendar - exports calendar data in the iCalendar format
 * vcard - exports business-card data in the vCard format

Other

 * gallery - displays a gallery (including captions) of all images in the query results
 * filtered - will replace "exhibit" in future versions.
 * outline - lists pages in a hierarchical outline, based on property values
 * tagcloud - lists values in a tag cloud based on how many times they occur
 * valuerank - lists values by the time they occur
 * array - similar to the list format in SMW, but with more formatting and separator customization options. Ideal for data processing. Instead of visible output, arrays can be created if extension available.
 * hash - same as array format, but can create hash tables. By default this format only is enabled if the HashTables extension is installed.
 * tree - Displays query results as a tree in nested HTML bulleted lists (as of version 1.7.1)

There is also an overview page of all result formats available for SMW.

Version
You can see the version history here.

Download
Semantic Result Formats can be obtained in several ways:
 * Download the latest code, in .tgz format, here.
 * Download one of the current releases (recommended) or legacy releases
 * Download as part of the Semantic Bundle extension set
 * Call the following:

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.

Installation
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' and 'googlepie'. In order to additionally add one of these formats, you can add lines like:

...or alternatively

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

... 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 http://code.google.com/intl/en-en/apis/maps/signup.html.

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.

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.

Translating
Translation of Semantic Result Formats is done through translatewiki.net. The translation for this extension can be found here. To add language values or change existing ones, you should create an account on translatewiki.net, then request permission from the administrators to translate a certain language or languages on this page (this is a very simple process). Once you have permission for a given language, you can log in and add or edit whatever messages you want to in that language.