Compound queries

From Maps for MediaWiki
Revision as of 19:47, 26 May 2020 by Jeroen De Dauw (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Maps can be used together with the Semantic Compound Queries extension.

Semantic Compound Queries allows displaying the results of multiple queries together. This is done via the #compound_query parser function.

The below example runs 3 queries: cities in Germany, cities in Belgium, and cities in neither of those two countries. Cities in Germany get a green marker icon, those in Belgium get a red one, and those in neither use the default marker icon.

{{#compound_query:
   [[Category:Cities]] [[Located in::Germany]] ; ?Coordinates ; icon=Green-marker.png
 | [[Category:Cities]] [[Located in::Belgium]] ; ?Coordinates ; icon=Red-marker.png
 | [[Category:Cities]] [[Located in::!Germany]] [[Located in::!Belgium]] ; ?Coordinates
 | format=map
}}
Loading map...

You can customize maps shown via compound queries with the same parameters available in regular Semantic MediaWiki queries with a map result format. See Leaflet SMW queries and Google Maps SMW queries for more information on available parameters.