Semantic MediaWiki and related extensions
Parameters

Parameters to the #ask function can apply to the filtered format as a whole (format level) or to only one specific printout (printout level). On format level there are some generic parameters that are common to all result formats and some format specific parameters that are used only by the filtered format.

Consider the following query:

{{#ask:[[SomeCondition]]
|? SomePrintout |+filter=number
|? Position
|format=filtered
|limit=100
|views=map
|mapviewmarkerpositionproperty=Position
}}

In this query limit=100 is on format level (generic), views=map is on format level (format specific) and +filter=number is on printout level.

Format level - Generic:

Supported:

Not supported by the filtered format:

Format level - Format specific:

List view

Calendar view

Table view

Map view

This view is only available if $srfgMapProvider is set in LocalSettings.php, e.g. `$srfgMapProvider='OpenStreetMap.HOT';`
See the list of available providers

It's also possible to set alternative provider for users with dark appearance enabled on their systems via $srfgMapProviderDark.

Printout level

Value filter

Distance filter

Number filter

Building

This is only required for development, not for simple installation and usage.

From the .../SemanticResultFormats/formats/filtered directory run

npm install

Running tests

JavaScript

JavaScript tests use the QUnit test environment of MediaWiki. To enable the test environment add the following to LocalSettings.php:

$wgEnableJavaScriptTest = true;

Then the easiest way to run tests is to go to http://127.0.0.1/wiki/Special:JavaScriptTest/qunit/plain?module=ext.srf.formats.filtered (with server and path modified as necessary).

To at some point allow for continuous integration testing the tests can also be run from the command line on a headless browser. Google Chrome 59 (currently in Beta status) allows headless execution. It will forward anything written to the JavaScript console to the CLI standard output. So, to run tests from the command line install Chrome Beta and run

google-chrome-beta \
--headless \
--disable-gpu \
--remote-debugging-port=9222 \
'http://127.0.0.1/wiki/Special:JavaScriptTest/qunit/plain?debug=true&module=ext.srf.formats.filtered'

Chrome will remain running, so when the test run is finished it has to be force-stopped. See https://developers.google.com/web/updates/2017/04/headless-chrome for details on headless Chrome.

PHP

PHP tests use PHPUnit. The easiest way to run all SRF tests including the tests for the Filtered format is to run composer phpunit from the SRF directory. However, for the tests to run it has to be ensured, that the $srfgMapProvider configuration variable is not set in LocalSettings.php.

#Credits

The Filtered format contains the following software libraries:

Several other libraries are used for the build process. See the devDependencies in the package.json file.


About | General disclaimer | Privacy policy