Printouts and property chains

From semantic-mediawiki.org
Jump to: navigation, search
Property chains and paths
Property chains allow to select pages and values with the help of the dot chain syntax
Keywords
Table of Contents
Query conditions to select
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
}}
NoteNote: 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


References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:1824
  2. ^  Semantic MediaWiki: GitHub pull request gh:smw:2073
  3. ^  OWL 2 Web Ontology Language Primer - Property Chains