Extension "Semantic Internal Objects"

From semantic-mediawiki.org
Semantic Internal Objects
Setting of internal objects in Semantic MediaWiki
Further Information
Homepage: follow this link
Maintainer(s): Yaron Koren
First released: August 2009
Release status: stable
Development status: active
Area of usage: Storing additional data
Associated with:SMW = Semantic MediaWiki, SB = Semantic Bundle, SMW+ = Semantic MediaWiki Plus, MW = MediaWiki SMW, SB
Shortcut:This is the shortcut to mark the beginning of the subject line when writing a support request to the mailing list or to the extension's author directly. See also this help page. SIO
Wikidata-ID: not yet provided
Table of Contents



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.

Historical outline[edit]

  • 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[edit]

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[edit]

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[edit]

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[edit]

  • Having more than one call to #set_internal_recurring_event in the same page sometimes causes duplicate objects to be stored.


This documentation page applies to all SMW versions from 1.4.3 to the most current version.
      Other languages: defrzh-hans