Help:Queriable recurring events
| Queriable recurring events | ||
|---|---|---|
| Silently set recurring semantic data in a wiki page with one instance per recurrence | ||
| Further Information | ||
| Provided by: | Semantic Internal Objects | |
| Minimum version: | 1.5.2 | |
| Maximum version: | still supported | |
| Function: | yes | |
| Tag: | no | |
| Name: | #set_internal_recurring_event
| |
| Table of Contents | ||
| ||
The parser function #set_recurring_event lets you set a series of date values for a single page, representing a recurring event. Unfortunately, because of the way SMW's querying works, this is sometimes not an ideal solution, because individual instances of the event can't be easily separated from one another. To overcome this problem you can call the parser function #set_internal_recurring_event, which has a syntax that's a cross between #set_internal and #set_recurring_event, and defines a separate internal object for each instance of the event, with a different date for each. This allows for precise querying and display of only those event instances that fall within a certain date range. This parser function is provided by the Semantic Internal Objects extension.
The (abridged) syntax for #set_internal_recurring_event is:
{{#set_internal_recurring_event:object_to_page_property
...all parameters allowed by #set_recurring_event...
}}
Here is an example of such a call, on a page that defines a recurring event:
Example: Using #set_internal_recurring_event
{{#set_internal_recurring_event:Is instance of
|property=Has date
|start=January 4, 2012
|end=June 8, 2013
|unit=week
|period=1
}}
You could then display a table of all the events that happened in a certain week, along with their date, with the following call:
Example: Calling for events happening in a certain week
{{#ask:[[Has date::>February 1, 2012]][[Has date::<February 7, 2012]]
|mainlabel=-
|?Is instance of
|?Has date
}}
Known issues
- Having more than one call to #set_internal_recurring_event in the same page sometimes causes duplicate objects to be stored.