Extension "Semantic Result Formats"
|Semantic Result Formats|
|Provides additional formats for semantic queries|
|Homepage:||→ external page|
|Maintainer(s):||James Hong Kong, Jeroen De Dauw|
|First released:||August 2008|
|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|
|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
- 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 (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)
- Average format (Displays the average of all queried numerical data)
- Interquartilemean format (Calculates the interquartile mean in queried numerical data)
- Interquartilerange.exc format (Calculates the interquartile range in queried numerical data)
- Interquartilerange format (Calculates the interquartile range in 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)
- Mode format (Displays the value appearing most often in queried numerical data)
- Product format (Displays the product of all queried numerical data)
- Quartillower format (Calculates the lower quartile in queried numerical data)
- Quartillower.exc format (Calculates the lower quartile in queried numerical data)
- Quartilupper.exc format (Calculates the upper quartile in queried numerical data)
- Quartilupper format (Calculates the upper quartile in queried numerical data)
- Standarddeviation format (Calculates the standarddeviation in queried numerical data)
- Samplestandarddeviation format (Calculates the samplestandarddeviation in queried numerical data)
- Sum format (Displays the sum of all queried numerical data)
- Variance format (Displays the variance in queried numerical data)
- Samplevariance format (Displays the sample variance in queried numerical data)
- BibTeX format (Produces a link to a file for downloading data in BibTeX format.)
- Calendar format (Displays time-associated pages on a calendar)
- Earliest format (Displays the earliest of all queried date/time data)
- Eventcalendar format (An event calendar with different views of displaying days and events)
- 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)
- 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)
- 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)
- Gallery format (Display images as a gallery)
- Media format (HTML5 Audio / Video media result printer)
- Slideshow format (Displays query results as a slideshow)
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).
- 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, [ 'googlebar', 'googlepie' ] );
... or you can override the set of formats entirely, with a call like:
$srfgFormats = [ 'calendar', 'timeline', 'filtered' ];
... 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.
- Information on Contributing and support for this extension
- Help page on available result formats, not just by this extension.
- Help page on writing result printers as a development guideline