The template format used to join data from two pages into one table

From semantic-mediawiki.org
Jump to: navigation, search
ExamplesExamples/QueryThe template format used 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

{{#ask:
 [[Has pKa value::+]]
 |?Has pKa value
 |format=template
 |link=none
 |template=PKaValueTemplate
 |introtemplate=PKaValueTemplateHeader
 |outrotemplate=TableFooter
}}
Result
Chemical name Chemical formula pKa
Benzenesulfonic acid C6H5SO3H -2.5
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