Template:Rapid transit OSM map/Sandbox/doc

Tests

Frankfurt

<mapframe zoom="10" frameless="1" align="left" height="440" latitude="50.08" longitude="8.65" width="500">[ { "type": "ExternalData", "service": "geoline", "properties": { "stroke-width": 3 }, "query": "SELECT ?id (if(BOUND(?idhexcolor), concat('#', str(?idhexcolor)), if(BOUND(?hexcolor), concat('#', str(?hexcolor)), '#07c63e')) as ?stroke) (concat('Line length: ', str(?length), ' km') as ?description) (if(BOUND(?link), concat('', ?idLabel, ''), ?idLabel) as ?title) WHERE { VALUES ?sys { wd:Q705684 } { ?id p:P5817/ps:P5817 wd:Q55654238; wdt:P16/wdt:P361* ?sys. } MINUS { VALUES ?rem { wd:Q548662 wd:Q55697304 } ?id wdt:P31/wdt:P279* ?rem. } OPTIONAL { ?id wdt:P465 ?idhexcolor. } OPTIONAL { ?id wdt:P462/wdt:P465 ?hexcolor. } SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' . ?id rdfs:label ?idLabel . } OPTIONAL {?link schema:about ?id. ?link schema:isPartOf <https://en.wikipedia.org/> . } } GROUP BY ?id ?link ?idLabel ?length ?hexcolor ?idhexcolor ORDER BY if(?id=wd:yes,1,2) "}, { "type": "ExternalData", "service": "geopoint", "properties": { "marker-symbol": "rail-metro", "marker-size" : "small"}, "query": "SELECT DISTINCT ?id ?geo ?marker_color (if(BOUND(?image), concat('File:', substr(str(?image), 52, 400), ''), ?typeLabel) as ?description) (if(BOUND(?link), concat('', ?idLabel, ''), ?idLabel) as ?title) WHERE { VALUES ?sqid { wd: } { ?id p:P5817/ps:P5817 wd:Q55654238; wdt:P81/wdt:P16*|wdt:P1192/wdt:P16* ?sqid; wdt:P625 ?geo. } MINUS { VALUES ?not { wd:Q6501349 } ?id wdt:P31/wdt:P279* ?not. } OPTIONAL { ?id wdt:P18 ?image. } OPTIONAL { ?sqid wdt:P465 ?idhexcolor. } OPTIONAL { ?sqid wdt:P462/wdt:P465 ?hexcolor. } BIND(COALESCE(?idhexcolor,?hexcolor,'5c72f2') as ?marker_color) SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' . ?id rdfs:label ?idLabel . } OPTIONAL {?link schema:about ?id. ?link schema:isPartOf <https://en.wikipedia.org/> . } }" }]</mapframe>


Moscow

<mapframe zoom="10" frameless="1" align="left" height="440" latitude="55.75" longitude="37.6" width="500">[ { "type": "ExternalData", "service": "geoline", "properties": { "stroke-width": 3 }, "query": "SELECT ?id (if(BOUND(?idhexcolor), concat('#', str(?idhexcolor)), if(BOUND(?hexcolor), concat('#', str(?hexcolor)), '#07c63e')) as ?stroke) (concat('Line length: ', str(?length), ' km') as ?description) (if(BOUND(?link), concat('', ?idLabel, ''), ?idLabel) as ?title) WHERE { VALUES ?sys { wd:Q5499 } { ?id p:P5817/ps:P5817 wd:Q55654238; wdt:P16/wdt:P361* ?sys. } MINUS { VALUES ?rem { wd:Q548662 wd:Q55697304 } ?id wdt:P31/wdt:P279* ?rem. } OPTIONAL { ?id wdt:P465 ?idhexcolor. } OPTIONAL { ?id wdt:P462/wdt:P465 ?hexcolor. } SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' . ?id rdfs:label ?idLabel . } OPTIONAL {?link schema:about ?id. ?link schema:isPartOf <https://en.wikipedia.org/> . } } GROUP BY ?id ?link ?idLabel ?length ?hexcolor ?idhexcolor ORDER BY if(?id=wd:yes,1,2) "}, { "type": "ExternalData", "service": "geopoint", "properties": { "marker-symbol": "rail-metro", "marker-size" : "small"}, "query": "SELECT DISTINCT ?id ?geo ?marker_color (if(BOUND(?image), concat('File:', substr(str(?image), 52, 400), ''), ?typeLabel) as ?description) (if(BOUND(?link), concat('', ?idLabel, ''), ?idLabel) as ?title) WHERE { VALUES ?sqid { wd: } { ?id p:P5817/ps:P5817 wd:Q55654238; wdt:P81/wdt:P16*|wdt:P1192/wdt:P16* ?sqid; wdt:P625 ?geo. } MINUS { VALUES ?not { wd:Q6501349 } ?id wdt:P31/wdt:P279* ?not. } OPTIONAL { ?id wdt:P18 ?image. } OPTIONAL { ?sqid wdt:P465 ?idhexcolor. } OPTIONAL { ?sqid wdt:P462/wdt:P465 ?hexcolor. } BIND(COALESCE(?idhexcolor,?hexcolor,'5c72f2') as ?marker_color) SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' . ?id rdfs:label ?idLabel . } OPTIONAL {?link schema:about ?id. ?link schema:isPartOf <https://en.wikipedia.org/> . } }" }]</mapframe>


Zurich S6

<mapframe zoom="11" text="Zurich S6" align="left" height="440" latitude="47.34257598711343" longitude="8.567905807927676" width="400">[ { "type": "ExternalData", "service": "geoline", "properties": { "stroke-width": 3 }, "query": "SELECT ?id (if(BOUND(?idhexcolor), concat('#', str(?idhexcolor)), if(BOUND(?hexcolor), concat('#', str(?hexcolor)), '#07c63e')) as ?stroke) (concat('Line length: ', str(?length), ' km') as ?description) (if(BOUND(?link), concat('', ?idLabel, ''), ?idLabel) as ?title) WHERE { VALUES ?sys { wd:Q7388350 } { ?id p:P5817/ps:P5817 wd:Q55654238; wdt:P16 */wdt:P361* ?sys. } MINUS { VALUES ?rem { wd:Q548662 wd:Q55697304 } ?id wdt:P31/wdt:P279* ?rem. } OPTIONAL { ?id wdt:P465 ?idhexcolor. } OPTIONAL { ?id wdt:P462/wdt:P465 ?hexcolor. } SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' . ?id rdfs:label ?idLabel . } OPTIONAL {?link schema:about ?id. ?link schema:isPartOf <https://en.wikipedia.org/> . } } GROUP BY ?id ?link ?idLabel ?length ?hexcolor ?idhexcolor ORDER BY if(?id=wd:yes,1,2) "}, { "type": "ExternalData", "service": "geopoint", "properties": { "marker-symbol": "rail-metro", "marker-size" : "small"}, "query": "SELECT DISTINCT ?id ?geo ?marker_color (if(BOUND(?image), concat('File:', substr(str(?image), 52, 400), ''), ?typeLabel) as ?description) (if(BOUND(?link), concat('', ?idLabel, ''), ?idLabel) as ?title) WHERE { VALUES ?sqid { wd:Q7388350 } { ?id p:P5817/ps:P5817 wd:Q55654238; wdt:P81/wdt:P16*|wdt:P1192/wdt:P16* ?sqid; wdt:P625 ?geo. } MINUS { VALUES ?not { wd:Q6501349 } ?id wdt:P31/wdt:P279* ?not. } OPTIONAL { ?id wdt:P18 ?image. } OPTIONAL { ?sqid wdt:P465 ?idhexcolor. } OPTIONAL { ?sqid wdt:P462/wdt:P465 ?hexcolor. } BIND(COALESCE(?idhexcolor,?hexcolor,'5c72f2') as ?marker_color) SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' . ?id rdfs:label ?idLabel . } OPTIONAL {?link schema:about ?id. ?link schema:isPartOf <https://en.wikipedia.org/> . } }" }]</mapframe>


<mapframe height="200" frameless="1" align="left" width="300">[ { "type": "ExternalData", "service": "geoline", "properties": { "stroke-width": 3 }, "query": "SELECT ?id (if(BOUND(?idhexcolor), concat('#', str(?idhexcolor)), if(BOUND(?hexcolor), concat('#', str(?hexcolor)), '#07c63e')) as ?stroke) (concat('Line length: ', str(?length), ' km') as ?description) (if(BOUND(?link), concat('', ?idLabel, ''), ?idLabel) as ?title) WHERE { VALUES ?sys { wd:Q7283953 } { ?id p:P5817/ps:P5817 wd:Q55654238; wdt:P16 */wdt:P361* ?sys. } MINUS { VALUES ?rem { wd:Q548662 wd:Q55697304 } ?id wdt:P31/wdt:P279* ?rem. } OPTIONAL { ?id wdt:P465 ?idhexcolor. } OPTIONAL { ?id wdt:P462/wdt:P465 ?hexcolor. } SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' . ?id rdfs:label ?idLabel . } OPTIONAL {?link schema:about ?id. ?link schema:isPartOf <https://en.wikipedia.org/> . } } GROUP BY ?id ?link ?idLabel ?length ?hexcolor ?idhexcolor "}, ]</mapframe>