Help:Plainlist format – parameter import-annotation

From semantic-mediawiki.org
< Help:Plainlist format
Plainlist formatHelp:Plainlist format – parameter import-annotation
Parameter import-annotation
This help page explains how to import an annotation from the template used to display the output of the query to the page holding the query.
Keywords

This help page explains the usage of the import-annotation parameter when using templates with result format "Plainlist"Outputs results in a comma separated list, with additional outputs shown in parentheses. The output does not provide class attributes to HTML elements (default for queries without printout statements). to display the output of your queries.

This parameter allows to specify whether annotations on the template used to display the output of your query will be applied to the page which holds the query. The default value to this parameter is "no". The "import" of the annotations can be enabled with "yes".

This parameter was originally introduced with Semantic MediaWiki 2.3.1Released on 4 January 2016 and compatible with MW 1.19.0 - 1.25.x. for result format "Template"Uses a specified template to format and display the results1 which is now result format "Plainlist"Outputs results in a comma separated list, with additional outputs shown in parentheses. The output does not provide class attributes to HTML elements (default for queries without printout statements)..

Example[edit]

Syntax
{{#ask:
 [[Category:City]]
 [[Located in::Germany]]
 |?Population
 |?Area
 |format=plainlist
 |template=TableImportAnnotations
 |import-annotation=yes
}}
Result
  • Berlin − 3,520,061 people on 891.85 km²344.34 sqmi <br />.
  • Cologne − 1,080,394 people on 405.02 km²156.38 sqmi <br />.
  • Frankfurt − 679,664 people on 248.31 km²95.87 sqmi <br />.
  • Munich − 1,353,186 people on 310.43 km²119.86 sqmi <br />.
  • Stuttgart − 606,588 people on 207.35 km²80.06 sqmi <br />.
  • Würzburg − 126,635 people on 87.63 km²33.83 sqmi <br />.

The template used to create this example: TableImportAnnotations. The property used for annotating data on this template is About city.

Cross-check - syntax
{{#show:
 {{FULLPAGENAME}}
 |?About city
}}
Cross-check - result

Berlin, Cologne, Frankfurt, Munich, Stuttgart, Würzburg

This query to cross-check reveals that values to the "About city" property were annotated to this help page via the "TableImportAnnotations" template due to setting the import-annotation parameter to "yes" in the above example. Otherwise no annotation would have been added to this page.

See also[edit]

References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:1257