Help:Property chains and paths

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.

Property chain syntax support is available for:

One requirement for both the condition and the print request is that chain members are to be page type resources with the last member being nonrestrictive to any type. Reason is that to process a successful traversal on chain members, nodes are required to be referable which is not possible for primitive data values such as numbers, dates, or text.

The chain syntax3 used in a query condition and its application on a result printout are two different processes and technically distinct from each other.

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 amount of chain members is currently not limited to a certain depth.
  • Properties identified as being part of a property chain are marked with two little superscripted dots "" which shows all its members when being hovered over.

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