Extension:SMWAskAPI

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
SMWAskAPI

Release status: beta

Implementation API, Search
Description Extends the SMW (Semantic MediaWiki) API with support for #ask queries
Author(s) PierreMzTalk
Last version 0.9a (2010-12-05)
License GPLv3
Download http://sourceforge.net/projects/smwaskapi/files/latest
http://sourceforge.net/projects/smwaskapi/files/README.txt/download
Parameters

$wgSMWAskAPI_ActionName

Tags
smw ask api query semantic mediawiki

Check usage (experimental)

Contents

[edit] What can this extension do?

Extends the mediawiki API with support for semantic queries #ask: allow one to execute SMW ask query via API.

[edit] Usage

After installing it, you can execute a semantic #ask query through the api.

This example:

api.php?action=ask&q=[[testproperty::Dummy]]&po=testproperty|otherproperty

will look for all pages with a property testproperty set to Dummy, and display them along with their testproperty and otherproperty values.

[edit] Dependencies

This extension depends on Semantic MediaWiki to work.

Both 1.6 and 1.5 versions of Semantic MediaWiki are supported - see below the download section to know where to pick the corresponding archives.

[edit] Download instructions

The most up-to-date instructions are contained in the README.txt file on sourceforge

You can either download a ZIP archive containing all the needed files, or export them from SVN.

[edit] Download a ZIP archive

Go to the sourceforge download page an pick the most recent ZIP file matching your need. The file names are built this way:

SMWAskAPI-<version of the extension>-smw<version of SMW>-rev<SVN revision>.zip

Thus, if you use SMW 1.6, you will be looking for a file looking like

SMWAskAPI-<version of the extension>-smw1.6-rev<SVN revision>.zip

Just be sure to take the one with the highest <version of the extension> and <SVN revision>, to have the most up-to-date version of the extension

The most recent ZIP archive can also be downloaded directly from this link


The ZIP archive contains a SMWAskAPI folder, which is the extension folder

[edit] Via SVN

Get the latest version of the extension from the SVN repository.

  • For SMW 1.6
svn co https://smwaskapi.svn.sourceforge.net/svnroot/smwaskapi/trunk/SMWAskAPI
  • For SMW 1.5
svn co https://smwaskapi.svn.sourceforge.net/svnroot/smwaskapi/branches/smw-1.5/SMWAskAPI

You will get a SMWAskAPI folder, which is the extension folder

[edit] Where to put the files

Move the SMWAskAPI folder into $IP/extensions/.

Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.

[edit] Installation

After placing the sources into $IP/extensions/SMWAskAPI, add following line into LocalSettings.php:

require_once( "$IP/extensions/SMWAskAPI/SMWAskAPI.php" );

[edit] Configuration parameters

  • $wgSMWAskAPI_ActionName: (optional) define the api action name used to execute the ask query. Default is 'ask'


[edit] Report a bug / request a feature

Use this link: http://sourceforge.net/apps/trac/smwaskapi/newticket to create a new ticket about a bug or a feature request. You do not need to have a sourceforge account to create a ticket (although it does not hurt)

[edit] See also

Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox