Compound queries: Difference between revisions

From Maps for MediaWiki
mNo edit summary
mNo edit summary
Line 1: Line 1:
Maps can be used together with the [https://www.mediawiki.org/wiki/Extension:Semantic_Compound_Queries Semantic Compound Queries extension]. This extension allows displaying the results of multiple queries together.
Maps can be used together with the [https://www.mediawiki.org/wiki/Extension:Semantic_Compound_Queries Semantic Compound Queries extension].


This 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.
Semantic Compound Queries allows displaying the results of multiple queries together. This is done via the <code>#compound_query</code> 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.


<pre>
<pre>

Revision as of 09:47, 26 May 2020

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

}}