Template:Rapid transit OSM map

{{maplink|frame=yes|raw=[

{

"type": "ExternalData",

"service": "geoline",

"properties": {

"stroke-width": {{{stroke-width|4}}}

},

"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('', substr(str(?link),31,500), '{{!}}', ?idLabel, ''), ?idLabel) as ?title)

WHERE {

VALUES ?sys { wd:{{#if:{{{system_qid|{{{1|}}}}}}|{{{system_qid|{{{1|}}}}}}|{{wikidata|label|raw}}}}

{{#if:{{{system_qid2|{{{2|}}}}}}|wd:{{{system_qid2|{{{2|}}}}}}

{{#if:{{{system_qid3|{{{3|}}}}}}|wd:{{{system_qid3|{{{3|}}}}}}

{{#if:{{{system_qid4|{{{4|}}}}}}|wd:{{{system_qid4|{{{4|}}}}}}

{{#if:{{{system_qid5|{{{5|}}}}}}|wd:{{{system_qid5|{{{5|}}}}}}}}}}}}}} }

{

?id p:P5817/ps:P5817 wd:Q55654238.

?id wdt:P16{{#if:{{{single_line|}}}|*}}/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 ?color.

?color wdt:P465 ?hexcolor.}

SERVICE wikibase:label {

bd:serviceParam wikibase:language 'en,mul' .

?id rdfs:label ?idLabel .

}

OPTIONAL {?link schema:about ?id.

?link schema:isPartOf . }

} GROUP BY ?id ?link ?idLabel ?length ?hexcolor ?idhexcolor

"},

{{#if:{{{stations|}}}|{

"type": "ExternalData",

"service": "geopoint",

"properties": { "marker-symbol": "{{{marker-symbol|rail-metro}}}",

"marker-size" : "{{{marker-size|small}}}"},

"query": "SELECT DISTINCT ?id ?geo ?marker_color

(if(BOUND(?image), concat('File:', substr(str(?image), 52, 400), '{{!}}300px'), ?typeLabel) as ?description)

(if(BOUND(?link), concat('', substr(str(?link),31,500), '{{!}}', ?idLabel, ''), ?idLabel) as ?title)

WHERE {

VALUES ?sqid { wd:{{{stations_qid|{{wikidata|label|raw}}}}} }

{

?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({{#if:{{{marker-colour|}}}|'{{{marker-colour}}}'|{{#if:{{{marker-color|}}}|'{{{marker-color}}}'|COALESCE(?idhexcolor,?hexcolor,'5c72f2')}}}} as ?marker_color)

SERVICE wikibase:label {

bd:serviceParam wikibase:language 'en,mul' .

?id rdfs:label ?idLabel .

}

OPTIONAL {?link schema:about ?id.

?link schema:isPartOf . }

}"

}

}}]|plain={{{plain|yes}}}|zoom={{{zoom|}}}|type=|id=|frame-lat={{{frame-lat|}}}|frame-long={{{frame-long|}}}|frame-width={{{frame-width|}}}|frame-height={{{frame-height|}}}|text={{{text|}}}|frame-align={{{frame-align|left}}}|display={{{display|}}}

}}

{{Clear left}}

{{documentation}}