Extension:Semantic Scribunto

From semantic-mediawiki.org
Jump to: navigation, search
Semantic Scribunto
Provides service functions to support the Scribunto extension
Further Information
Homepage: follow this link
Maintainer(s): mwjames
First released: 06 2016
Release status: stable
Development status: active
Composer: mediawiki/semantic-scribunto
Area of usage:
Associated with: SMW
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.
SSC
Table of Contents

Documentation can be found in the readme.

mw.smw library functions

The following functions are available in the mw.smw package.

Overview

Notes

Difference between mw.smw.ask and mw.smw.getQueryResult

Both functions allow you to retrieve data from your smw store. The difference lies in the returned table. Where mw.smw.ask returns a very simplistic result set (its values are all pre-formatted and already type cast), mw.smw.getQueryResult leaves you with full control over your returned data, giving you abundant information but delegates all the data processing to you.

In other words:

  • ask is a quick and easy way to get data which is already pre-processed and may not suite your needs entirely
(e.g. it does not link page properties). However it utilizes native SMW functionality like printout formatting (see smwdoc for more information)
  • getQueryResult gets you the full result set in the same format provided by the api

For more information see the sample results in mw.smw.ask and mw.smw.getQueryResult.

Using #invoke

For a detailed description of the #invoke function, please have a look at the Lua reference manual.


Examples

See also