SemanticMediaWiki/SemanticMediaWiki — pull request #225 by mwjames (2014-03-13 05:06:36+00:00)
Title: Introduce @sortkey and @sortby to support sorting annotation for a subobject

- `@sorkey` is a restricted keyword which allows to set an arbitrary sort value for a particular subobject
- `@sortby` is a restricted keyword which allows to set a reference to a property which in return will use the value of the reference property as sort value

`@sortby` and `@sortkey` are case sensitive, stored as a "string", and further will not appear visible to the end-user

## subobject example
```
{{#subobject:
|Has group=test
|Has value=1111
|@sortby=Has value
}}

{{#subobject:
|Has group=test
|Has value=9999
|@sortkey=A
}}
```
Results are displayed by sorting the subobject according to the preference
```
{{#ask: [[Has group::test]]
|?Has value
|format=table
}}
```
## set_recurring_event example
```
{{#set_recurring_event:property=Has date
|start=January 4, 2010 05:00
|end=June 8, 2011
|unit=week
|period=1
|@sortby=Has date
}}
```
Listing recurring events will be sorted by "Has date"
```
{{#ask: [[Has date::+]]
|?Has date
|format=broadtable
}}
```