Help:Semantic Internal Objects
From Edge of Darkness Wiki
Semantic Internal Objects Release status: unknown | |
---|---|
Description | {{{description}}} |
License | No license specified |
Download | no link |
Semantic Internal Objects (SIO) is an extension to Semantic MediaWiki (SMW). It provides two parser functions, #set_internal
and #set_internal_recurring_event
, both of which are used to define so-called "internal objects" (now "subobjects") within the Semantic MediaWiki system. SIO's main contribution to SMW is in the introduction of certain compound types of information, sometimes known as 'n-ary relations', which ensures that pages can include more than one group of associated property-value pairs. SIO lets you define a two-dimensional table of information on a single page, with a call to #set_internal
or #set_internal_recurring_event
being used to store each row.
This functionality has been adopted by SMW so that #set_internal
and #set_internal_recurring_event
are now broadly equivalent to SMW's own parser functions #subobject
(introduced in SMW 1.7) and #set_recurring_event
(since SMW 1.9) respectively, both of which are used to define "subobjects". Since SIO 0.7, the differences have become even less significant as SIO's parser functions now serve as a wrapper for SMW subobjects, which are called internally with SMWSQLStore3.
Contents |
Historical outline
- The functionality of parser function
#set_internal
was introduced into SMW core with parser function#subobject
in version 1.7.0 . - The functionality of parser function
#set_internal_recurring_event
was applied to#set_recurring_event
in SMW 1.9. - As of v0.7, SMW subobjects are called when using SMWSQLStore3 (for SMW 1.8+).
#set_internal_recurring_event
SIO's #set_internal_recurring_event
was created as a solution to a problem with #set_recurring_event
: in versions of SMW prior to 1.9, #set_recurring_event
allows you to store recurrent events but individual instances of an event can't be (easily) separated from one another. SIO defines a separate "internal object" for each instance of an event, with a different date for each, and so allows for more precise querying and display of only those event instances that fall within a certain date range. As of SMW 1.9, however, SMW's #set_recurring_event
adopts a similar approach by defining a separate subobject for each instance of an event. The two parser functions behave alike and they both allow you to separate individual instances of an event.
Syntax
The (abridged) syntax for #set_internal_recurring_event
is:
{{#set_internal_recurring_event:object_to_page_property ...all parameters allowed by #set_recurring_event... }}
Example
Here is an example of such a call, on a page that defines a recurring event: 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:
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.