Semantic Compound Queries
-
- Last edited 6 years ago by Angelika
-
-
- No status information
Extension: Semantic Compound Queries
Overview | |||
---|---|---|---|
Description: | Defines a parser function, #compound_query, that can make multiple Semantic MediaWiki queries at the same time. | ||
State: | stable | Dependency: | MediaWiki |
Developer: | Yaron Koren, and others | License: | - |
Type: | MediaWiki | Category: | Rich Articles |
Edition: | BlueSpice free | ||
Features
The Semantic Compound Queries extension is meant to work with Semantic MediaWiki and allows for the display of more than one SMW inline query in one results display set. It uses its own parser function, #compound_query, which takes inputs similar to that of #ask but can take in an unlimited number of queries, instead of just one.
Usage[<a href="https://www.mediawiki.org/w/index.php?title=Extension:Semantic_Compound_Queries&action=edit§ion=2" title="Edit section: Usage">edit source]
A normal inline query, using the #ask parser function, takes in arguments of three types: (1) a filter that determines the results, (2) the names of properties to be displayed, and (3) arguments that determine the format and other aspects of the display. Here is an example of a normal inline query:
{{#ask:[[Category:Stores]][[Has type::Clothing]]|?Has country=Country|format=table}}
In this query there are three arguments separated by pipes and they belong to argument types 1, 2 and 3, respectively.
For compound queries the first two types of argument are unique to each sub-query and are separated from each other by semicolons instead of pipes; pipes are used to separate one sub-query from the rest. The third type of argument, setting the display of the results, is common across all sub-queries. Here is an example of a call to #compound_query that shows both clothing stores and fast-food restaurants in a table:
{{#compound_query:[[Category:Stores]][[Has type::Clothing]];?Has country=Country |[[Category:Restaurants]][[Has cuisine::Fast food]];?Has country=Country |format=table}}
One important exception to this rule is the limit= parameter, which sets the maximum number of results displayed: it must be used per sub-query, not for the overall compound query.
Source: mediawiki