Printouts and property chains

From Linux Web Expert

Template:Interlanguagelink: en

Property chains and paths
Property chains allow to select pages and values with the help of the dot chain syntax
Keywords
Table of Contents
File:smw-printout-property-chain.png
Query conditions to select
File:smw-printout-property-chain-reference.png
Printout statements to display

The property chain feature allows to select pages and values with help of the dot chain syntax.

Chaining of entities is supported:

One requirement for both the condition and the print request is that chain members are to be page type entities while the last member is nonrestrictive to any type. The reason is that in order for the traversal process to be successful, chain member nodes are required to be referable which is not possible for primitive data values such as numbers, dates, or text.

It should be noted that the chain syntax3 on a query condition and its application on a result printout are technically two distinct operations that can not be compared with each other. The first relates to the filtering of results and the latter being a traversal process.

Examples

Query examples

Regular use cases
{{#ask:
 [[Category:Country]]
 |?Located in
 |?-Located in
 |?-Located in.Capital of
 |?-Located in.Has population
 |?-Located in.Has population.Retrieved on
 |?-Located in.Has population.Retrieved on=WithCustomTitle
}}
Advanced use cases
{{#ask:
 [[Category:Country]]
 [[Category:P0434]]
 |?Located in.-Located in.-Located in.Capital of.Has subobject.Has population.Number
 |link=none
}}
A query like this example is not recommended since various properties are chained (including inverted) to return the expected printout.

Notes

  • The number of chain members is currently not limited to a certain depth.
  • The headers (e.g. table headers) of properties identified as being part of a property chain are marked with two little superscripted dots "". These dots show all its members when being hovered over. See the SMW sandbox for an example.

See also

#scite could not render a citation text for reference "gh:smw:1824" because type "pullrequest" was not assigned to a template.
#scite could not render a citation text for reference "gh:smw:2073" because type "pullrequest" was not assigned to a template.
#scite could not render a citation text for reference "sb:smw:2073" because type "example" was not assigned to a template.

References