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

Content deleted Content added
sys icon in line title
No edit summary
 
(10 intermediate revisions by 2 users not shown)
Line 4:
"service": "geoline",
"properties": {
"stroke-width": {{{stroke_widthstroke-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(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{{#if:{{{single_line|}}}|*}}/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. }
?color wdt:P465 ?hexcolor.}
SERVICE wikibase:label {
bd:serviceParam wikibase:language 'en' .
Line 39 ⟶ 27:
OPTIONAL {?link schema:about ?id.
?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)}}
 
"},
{{#if:{{{stations|}}}|{
"type": "ExternalData",
"service": "geopoint",
"properties": { "marker-symbol": "{{{marker_symbolmarker-symbol|rail-metro}}}",
"marker-colorsize" : "{{{marker_colormarker-size|5c72f2small}}}"},
"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)
(if(BOUND(?link),
WHERE {
concat('[[', substr(str(?link),31,500), '{{!}}', ?idLabel, ']]'),
VALUES ?sqid { wd:{{{stations_qid|{{wikidata|label|raw}}}}} }
?idLabel)
}{
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 .
wdt:P81/wdt:P16*{{!}}wdt:P1192/wdt:P16* ?sqid;
OPTIONAL { ?id wdt:P18 ?image }.
wdt:P625 ?geo.
} MINUS ){
VALUES ?not { wd:Q6501349 }
?id wdt:P31/wdt:P279* ?not. }
OPTIONAL { ?id p:P16/ps:P16/wdt:P154P18 ?image. }
OPTIONAL { ?idsqid wdt:P18P465 ?imageidhexcolor. }.
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' .
Line 63 ⟶ 59:
}"
}
}}]|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|}}}
}}
}}</includeonly><noinclude>
{{Clear left}}
 
}}</includeonly><noinclude>
{{documentation}}
</noinclude>