Template:Rapid transit OSM map/sandbox: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
 
(32 intermediate revisions by 2 users not shown)
Line 1:
<includeonly>{{maplink|frame=yes|raw={[
{
"type": "ExternalData",
"service": "geoline",
"properties": {
"stroke-width": {{{stroke-width|3}}}
},
"query": "SELECT ?id
(if(BOUND(?idhexcolor), concat('#', str(?idhexcolor)), if(BOUND(?hexcolor), concat('#', str(?hexcolor)), '#07c63e')) as ?stroke)
 
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)
(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.;
?wds wdt:P16{{#if:{{{single_line|}}}|*}}/wdt:P361* ?sys.
{{{#if:single_sys||?id p:P16/ps:P16/wdt:P279*{{!}}p:P361/ps:P361/wdt:P361* ?wds.}}}
}
MINUS {
VALUES ?rem { wd:Q548662 wd:Q55697304 }
?id wdt:P31/wdt:P279* ?rem. }
{{#if:{{{length|}}}|OPTIONAL { ?id wdt:P2043 ?length. } | }}
OPTIONAL { ?id wdt:P465 ?idhexcolor. }
OPTIONAL { ?id wdt:P462/wdt:P465 ?colorhexcolor. }
?color wdt:P465 ?hexcolor.}
SERVICE wikibase:label {
bd:serviceParam wikibase:language 'en' .
Line 42 ⟶ 28:
?link schema:isPartOf <https://en.wikipedia.org/> . }
} GROUP BY ?id ?link ?idLabel ?length ?hexcolor ?idhexcolor
{{#if:{{{stations|}}}|ORDER BY if(?id=wd:{{{stations|}}},1,2)}}
 
"},
"}|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|center}}}|display={{{display|}}}
{{#if:{{{stations|}}}|{
}}</includeonly><noinclude>
"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. }
{{#if:{{{length|}}}|OPTIONAL { ?id wdt:P2043P18 ?lengthimage. } | }}
OPTIONAL { ?sqid wdt:P465 ?idhexcolor. }
OPTIONAL { ?colorsqid 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' .
?id rdfs:label ?idLabel) .
}
OPTIONAL {?link schema:about ?id.
?link schema:isPartOf <https://en.wikipedia.org/> . }
}"
}
"}}]|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|centerleft}}}|display={{{display|}}}
}}
{{Clear left}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>