API module "ask"

From Linux Web Expert

ask
Allows to do ask queries
Keywords
API · API module · ask query · action ask · ask
Further Information
Provided by: Semantic MediaWiki
Added: 1.7.0
Removed: still available

The "ask" API module allows you to do ask queries via action "ask" (?action=ask) against Semantic MediaWiki using the MediaWiki API and get results back serialized in one of the supported formats. It was introduced with Semantic MediaWiki 1.7.0Released on an unknown date unknown versions of MediaWiki. API-module "compoundquery"Allows to do compounded ask queries provided by extension "Semantic Compound Queries"No description was provided. acts analogous to this module but additionally allows to compound several queries.

The module supports one semantic parameter, "query" (../api.php?action=ask&query=..), which takes the same string you'd feed into an #ask parser function, but URL-encoded.

Starting with Semantic MediaWiki 3.0.0Released on an unknown date unknown versions of MediaWiki this module supports the "api_version" parameter1 allowing to choose between the dictionary structure { ... } (version "2", which is the default to ensure backwards compatibility for any consumer that uses the API) and the list structure [ ... ] (version "3") for the JSON serialization of the resulting data queried with the API.

Example

Use "dictionary" structure for JSON serialization

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

run example
Use "list" structure for JSON serialization

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

run example
Further examples

References

  1. ^ gh:smw:3052