Status: | effective |
Progress: | 75% |
Version: | 3.0.0+ |
#ask:
syntax – "order" printout sorter
#ask: syntax details:
| |
Syntax | +order= |
Description | Property "Has description" (as page type) with input value "Defines the sorting order for printout statements (dot chain syntax)[[CiteRef::gh:smw:2073" contains invalid characters or is incomplete and therefore can cause unexpected results during a query or annotation process. |
Datatype support | All datatypes |
Component | printout |
Software | Semantic MediaWiki |
Since version | Semantic MediaWiki 2.5.0 Released on an unknown date unknown versions of MediaWiki |
Keyword | sorting · display · printout |
The +order=
query printout sorter was introduced in Semantic MediaWiki 2.5.0Released on an unknown date unknown versions of MediaWiki.
Rationale
Allows to define an order for printout statements in a query result which were selected with the dot chain syntax (property chains) using the +order=
query parameter.
The options set with the +order=
query parameter denote the order the content of the respective result column should have. The option is either "asc
" (long version is "ascending
"), "desc
" (long version is "descending
") or "rand
" (long version is "random
" in short), like e.g. |+order=asc
, |+order=desc
or |+order=rand
. Note that "asc
" is the default which usually does not need to be defined explicitly.
Semantic MediaWiki 3.0.0Released on an unknown date unknown versions of MediaWiki brought two more sorting options to the +order=
query parameter allowing to do natural sorting instead of strict sorting: "n-asc
" and "n-desc
"1. This allows to sort 1, 2, 3, 10 ... instead of 1, 10, 2, 3 ...2
Examples
- Syntax
{{#ask: [[{{FULLPAGENAME}}]] |?Has subobject |+order=asc |?Has subobject.MyFirstProperty.MySecondProperty |+order=asc |format=broadtable }}
or
{{#ask: [[{{FULLPAGENAME}}]] |?Has subobject |+order=desc |?Has subobject.MyFirstProperty.MySecondProperty |+order=desc,asc |format=broadtable }}
- Link
<sandbox.semantic-mediawiki.org>: More examples for this query parameter
See also
- Help page on other sorting options
- Help page on property chains
- Help page on displaying information in a broad sense
- Help page on configuration parameter
$smwgEntityCollation
No description was provided.