User:Cavila
From semantic-mediawiki.org
SIO vs subobject
| Semantic Internal Objects (extension) | Subobject (SMW since 1.7.0) | |
|---|---|---|
| Type of annotation | silent annotation | silent annotation |
| parser functions: | #set_internal and #set_internal_recurring_event followed by SIO property name |
#subobject followed by unique ID |
| Example: |
{{#set_internal:address
| type of address= street
| street number=10
| street name=Parks Road
| postcode=OX1 3QD
| city=Oxford
| country=UK
}}
{{#set_internal:address
|type of address=postal
| ...
}}
{{#set_internal_recurring_event:Is instance of
|property=Has date
|start=January 4, 2010
|end=June 8, 2011
|unit=week
|period=1
}}
|
{{#subobject:street address
| street number=10
| street name=Parks Road
| postcode=OX1 3QD
| city=Oxford
| country=UK
}}
{{#subobject:postal address
| ...
}}
|
| ID | ID is autonumbered: <page name>#1, <page name>#2, etc. |
ID is assigned manually: <page name>#street address, <page name>#postal address Note: Autonumbering can be achieved through the parser function "variable". See below. |
| multiple values | comma-separated lists are possible (no other delimiter is allowed):
{{#set_internal:Is president of
|Has name=Ulysses S. Grant
|Has vice president#list=Schuyler Colfax, Henry Wilson
}}
|
does not allow for multiple values (?) |
| SMW integration | cannot be combined with regular #ask queries | can be combined with regular #ask queries |
| Example query: | ... | ... |
| Limitation | Subobjects and SIOs do not (automatically) inherit the properties of the parent page. Categories are not inherited either nor is it possible for them to be assigned manuually. This means, for instance, that querying on a category will not yield any results from subobjects or SIOs. | |
Autonumbering
Define the variable:
{{#vardefine: #
| {{ #expr: {{ #var: # | 0 }} + 1 }}
}}
and add the variable at the appropriate place in the syntax:
{{#subobject: {{ #var: # }}
| property = value...
}}
Notes
- Common message: "Pages with too many expensive parser function calls"