|Found errors or typos? Just edit the page or leave a message on the talk page.|
The English language documentation is canonical and most up to date.
Extension "Semantic Result Formats"
|Semantic Result Formats|
|Provides additional formats for semantic queries|
|Homepage:||follow this link|
|Maintainer(s):||James Hong Kong, Jeroen De Dauw|
|First released:||August 2008|
|Area of usage:||Displaying data|
|Associated with:SMW = Semantic MediaWiki, SB = Extension:Semantic Bundle, SMW+ = Semantic MediaWiki Plus, 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|
|Repository:||Project page •|
Commit history •
|Table of Contents|
Semantic Result Formats is an extension to Semantic MediaWiki (SMW) 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
- Array format (Comma-separated list, with additional outputs shown in parentheses and extra formatting options)
- 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)
- 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)
- Calendar format (Displays time-associated pages on a calendar)
- Earliest format (Displays the earliest of all queried date/time data)
- Eventline format (Displays query results in interactive eventlines)
- Latest format (Displays the latest of all queried date/time data)
- Timeline format (Displays query results in interactive timelines)
- D3 chart format (Various charts using the d3.js as visualization 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)
- Media format (HTML5 Audio / Video media result printer)
- Slideshow format (Displays query results as a slideshow)
- 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)
- ICalendar format (Exports data in iCalendar format.)
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.
The Compatibility of Semantic Result Formats with MediaWiki, Semantic MediaWiki, PHP, etc, is outlined on this page.
- 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, [ 'googlebar', 'googlepie' ] );
... or you can override the set of formats entirely, with a call like:
$srfgFormats = [ '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 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.
- I see a spinning wheel but no output.
- 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 in a single inline query on a single page, even if a setting
limit=... is given in "LocalSettings.php" as well.
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 the GitHub issue tracker.
The current list of known bugs and requested features for Semantic Result Formats can be found at GitHub as well.
If you found some bug and fixed it, or if you wrote code for a new feature, please create a patch by opening a pull request at GitHub.
If, for any reason, you don't wish to use GitHub, feel free to simply send this patch, with a description, to the semediawiki-devel mailing list.