Compound queries

From Maps for MediaWiki

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
}}

{{#compound_query: Germany ; ?Coordinates ; icon=Green-marker.png

| Belgium ; ?Coordinates ; icon=Red-marker.png
| !Germany !Belgium ; ?Coordinates
| format=map
| scrollzoom=off
| hidenamespace=yes

}}

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.