Using templates to join data from two pages into one table

From semantic-mediawiki.org
< Demo:Examples‎ | Queries(Redirected from Using templates to join data from two pages into one table)
ExamplesExamples/QueriesUsing templates to join data from two pages into one table
Templates for joining output
This page shows an example for the template format used to join data from two pages into one table.
Format
Keywords
Table of Contents

Example[edit]

Syntax
{{#ask:
 [[Has pKa value::+]]
 |?Has pKa value
 |format=plainlist
 |link=none
 |template=PKaValueTemplate
 |introtemplate=PKaValueTemplateHeader
 |outrotemplate=TableFooter
}}
Result
# Chemical name Chemical formula pKa
1 Benzenesulfonic acid C6H5SO3H -2.5
2 Trichloroacetic acid CCl3CO2H 0.77
NoteNote: The results show annotations for the "chemical formula" done via a template on a page and annotations for the "pKa value" done via a subobject embedded on the same page. While the "pKa value" is directly queried from the subobject on that page the "chemical formula" is queried via additional queries located in the query template ("PKaValueTemplate") from the same page on which the subobject holding the "pKa value" is embedded.

Templates used to create the example[edit]