Demo:Standard table examples

From semantic-mediawiki.org
This demo page is about result format "Table"Outputs the results in a table (default for queries with printout statements).. If you would like to use result format "Broadtable"Outputs the results in a broad table. just add |format=broadtable to the example queries provided.
Table of Contents


Simple table example[edit]

{{#ask:
 [[Category:City]]
 [[Located in::Germany]] 
 |?Population
 |?Area#km²=Size in km²
 |format=table
 |mainlabel=City
}}

This produces the following output:

CityPopulationThe number of inhabitants of some geographical place.Size in km²
Berlin3,520,061891.85 km²344.34 sqmi <br />
Cologne1,080,394405.02 km²156.38 sqmi <br />
Frankfurt679,664248.31 km²95.87 sqmi <br />
Munich1,353,186310.43 km²119.86 sqmi <br />
Stuttgart606,588207.35 km²80.06 sqmi <br />
Würzburg126,63587.63 km²33.83 sqmi <br />

"class" parameter example[edit]

{{#ask:
 [[Category:City]]
 [[Located in::Germany]] 
 |?Population
 |?Area#km²=Size in km²
 |format=table
 |mainlabel=City
 |class=datatable
}}

This produces the following output:

"transpose" parameter example[edit]

{{#ask:
 [[Category:City]]
 [[Located in::Germany]] 
 |?Population
 |?Area#km²=Size in km²
 |format=table
 |transpose=true
 |mainlabel=City
}}

This produces the following output:

CityBerlinCologneFrankfurtMunichStuttgartWürzburg
PopulationThe number of inhabitants of some geographical place.3,520,0611,080,394679,6641,353,186606,588126,635
Size in km²891.85 km²344.34 sqmi <br />405.02 km²156.38 sqmi <br />248.31 km²95.87 sqmi <br />310.43 km²119.86 sqmi <br />207.35 km²80.06 sqmi <br />87.63 km²33.83 sqmi <br />

"sep" parameter example[edit]

{{#ask:
 [[Category:City]]
 [[Located in::Germany]] 
 |?Has point of interest=Point of Interest
 |format=table
 |sep=, 
 |mainlabel=City
}}

This produces the following output:

CityPoint of Interest
BerlinBrandenburg Gate, Museumsinsel, Reichstag
Cologne
Frankfurt
MunichDom zu Unserer Lieben Frau, Schloss Nymphenburg
Stuttgart
Würzburg

The output without using the "sep" parameter (default behaviour):

CityPoint of Interest
BerlinBrandenburg Gate
Museumsinsel
Reichstag
Cologne
Frankfurt
MunichDom zu Unserer Lieben Frau
Schloss Nymphenburg
Stuttgart
Würzburg