Ask API

From semantic-mediawiki.org
Jump to: navigation, search

Note: The Ask API is still in alpha, and might see syntax and output changes in the future.

The Ask API allows you to do ask queries against SMW using the MediaWiki API and get results back serialized in one of the formats it supports. There are 2 API modules that differ in how you specify the query, but have identical output of the query results.

Ask

The ask module supports one parameter, query, which takes the same string you'd feed into an #ask tag, but urlencoded.

Example:

api.php?action=ask&query=[[Modification date::%2B]]|%3FModification date|sort%3DModification date|order%3Ddesc&format=jsonfm

Askargs

The Askargs module aims to take arguments in unserialized form, so with as little ask-specific syntax as possible. It supports 3 arguments:

  • conditions: The query conditions, ie the requirements for a subject to be included
  • printeouts: The query printeouts, ie the properties to show per subject
  • parameters: The query parameters, ie all non-condition and non-printeout arguments

Example:

api.php?action=askargs&conditions=Modification date::%2B&printeouts=Modification date&parameters=|sort%3DModification date|order%3Ddesc&format=jsonfm

External links

See also


This documentation page applies to all SMW versions from 1.7.0 to the most current version.
      Other languages: de

Ask API en 1.7.0


Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox