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

Content deleted Content added
sync from .../Sandbox
No edit summary
Line 6:
"stroke-width": {{{stroke-width|3}}}
},
"query": "SELECT ?id ?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(if(BOUND(?image),concat('[[File:', substr(str(?image), 52, 400), '{{!}}{{{icon_size|20px}}}]] '),''), '[[', substr(str(?link),31,500), '{{!}}', ?idLabel, ']]'), if(BOUND(?image),concat('[[File:', substr(str(?image), 52, 400), '{{!}}{{{icon_size|20px}}}]] ', ?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*/wdt:P361* ?sys.
}
MINUS {
VALUES ?rem { wd:Q548662 wd:Q55697304 }
?id wdt:P31/wdt:P279* ?rem. }
OPTIONAL { ?id p:P16/ps:P16/wdt:P154 ?image. }
OPTIONAL { ?id wdt:P465 ?idhexcolor. }
OPTIONAL { ?id wdt:P462/wdt:P465 ?colorhexcolor. }
BIND(if(BOUND(?idhexcolor), concat('#', str(?idhexcolor)), if(BOUND(?hexcolor), concat('#', str(?hexcolor)), '#07c63e')) as ?stroke)
?color wdt:P465 ?hexcolor.}
SERVICE wikibase:label {
bd:serviceParam wikibase:language '[AUTO_LANGUAGE],en' .
Line 39 ⟶ 28:
OPTIONAL {?link schema:about ?id.
?link schema:isPartOf <https://en.wikipedia.org/> . }
} GROUP BY ?id ?link ?idLabel ?length ?stroke ?image
}
 
"},
{{#if:{{{stations|}}}|{
Line 46 ⟶ 34:
"service": "geopoint",
"properties": { "marker-symbol": "{{{marker-symbol|rail-metro}}}",
"marker-color": "{{{marker-color|5c72f2}}}",
"marker-size" : "{{{marker-size|small}}}"},
"query": "SELECT DISTINCT ?id ?geo
(SAMPLE(?marker_clr) as ?marker_color)
(if(BOUND(?image), concat('[[File:', substr(str(?image), 52, 400), '{{!}}300px]]'), ?typeLabel) as ?description)
(SAMPLE(?descripn) as ?description)
(if(BOUND(?link),
(if(BOUND(?link), concat('[[', substr(str(?link),31,500), '{{!}}', ?idLabel, ']]'), ?idLabel) as ?title)
WHERE {
?idLabel)
VALUES ?sqid { wd:{{{stations_qid|{{wikidata|label|raw}}}}} }
as ?title)
{
WHERE { ?id p:P5817/ps:P5817 wd:Q55654238. ?id wdt:P81/wdt:P16*{{!}}wdt:P1192/wdt:P16* wd:{{{stations_qid|{{wikidata|label|raw}}}}}; wdt:P625 ?geo .
?id p:P5817/ps:P5817 wd:Q55654238;
OPTIONAL { ?id wdt:P18 ?image }.
wdt:P81/wdt:P16*{{!}}wdt:P1192/wdt:P16* ?sqid;
wdt:P625 ?geo.
}
OPTIONAL { ?id wdt:P18 ?image }.
(if(BOUND(?image), BIND(concat('[[File:', substr(str(?image), 52, 400), '{{!}}300px]]'), ?typeLabel) as ?descriptiondescripn)
}
OPTIONAL { ?id wdt:P81/wdt:P465{{!}}wdt:P1192/wdt:P465 ?idhexcolor. }
OPTIONAL { ?id wdt:P81/wdt:P462/wdt:P465{{!}}wdt:P1192/wdt:P462/wdt:P465 ?hexcolor. }
BIND({{#if:{{{marker-colour|}}}|'{{{marker-colour}}}'|{{#if:{{{marker-color|}}}|'{{{marker-color}}}'|COALESCE(?idhexcolor,?hexcolor,'5c72f2')}}}} as ?marker_clr)
SERVICE wikibase:label {
bd:serviceParam wikibase:language '[AUTO_LANGUAGE],en' .
Line 62 ⟶ 58:
OPTIONAL {?link schema:about ?id.
?link schema:isPartOf <https://en.wikipedia.org/> . }
} GROUP BY ?id ?geo ?link ?idLabel"
}"
}
}}]|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|}}}
}}</includeonly><noinclude>
 
{{documentation}}
</noinclude>