<div dir="ltr">The biggest issue with using Lua/Server side scripting with large lists is that every single data item used on a wiki page requires a separate SQL query (or even multiple ones), due to how mediawiki + wikibase is implemented.  On the other hand, relying on TagInfo has some shortcomings - TagInfo does not (yet) understand data items, relying on its own wiki page parser, it is very fixed in a way it can present information, and every wiki page view also uses makes 1 or more external call to taginfo (higher chance of something going down).<div><br></div><div>There is a popular middle ground that can solve it for us -- very flexible, highly performant, uses a common data source (data items), and relies on a single system.  Essentially it is a bot-updated wiki markup:</div><div><br></div><div>* an editor adds a special template at the top of a wiki page, where they specify a SPARQL query for the data they want - i.e. "find all label+description+image of data items, whose type is a 'tag' and whose key is 'denomination'".  A bot would run that query on occasion (e.g. once a day), and append query results to that same page after the template.  Thus, the result becomes a regular wiki markup, without any significant server costs.  See <a href="https://www.wikidata.org/wiki/Template:Wikidata_list">https://www.wikidata.org/wiki/Template:Wikidata_list</a></div><div><br></div><div>The PROs:</div><div>* The bot can run at any moment, by anyone, to update the data</div><div>* In the worst case of a bot completely dying, wiki markup could be edited by hand until the bot is fixed</div><div>* very flexible - a complex query could get any data needed for the output, and the output is templated to show in any kind of a list/table format.</div><div><br></div><div>CONs:</div><div>* every list update is essentially a wiki page edit, slowly increasing history. This is not that big of a deal because size wise the growth is small and has very little performance impact, plus it makes it possible to track changes with time.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Aug 3, 2019 at 5:25 PM Andrew Hain <<a href="mailto:andrewhainosm@hotmail.co.uk">andrewhainosm@hotmail.co.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<p>Now the wiki has data items and scripting in Lua I have been wondering whether they are a useful alternative to Taginfo-driven lists.
</p>
<p>Advantages of server scripts: </p>
<ol>
<li>Descriptions can be generated from data items, tharefore they can be in a language where there is no long form documentation for the key. This resolves the issues that have limited use of taglists in languages other than English because descriptions can
 be rolled out quickly and some can be copied from the old map features templates.</li><li>Tables at the top of pages are visible immediately,</li><li>A successful connection to <a href="http://tagindo.openstreetmap.org" target="_blank">tagindo.openstreetmap.org</a> is unnecessary.</li></ol>
<p>Advantages of taglists driven by Taginfo: </p>
<ol>
<li>The technology aleady exists and can be rolled out.</li><li>Separate scripts avoid overloading the server (Map Features in Polish, Ukrainian and Japanese hits wiki limits).</li><li>The web scripts are free-standing and can be hosted on another website outside the wiki,</li></ol>
(crossposted from <a href="https://wiki.openstreetmap.org/wiki/Talk:Taginfo/Taglists#Server_scripts_as_alternative_taglists" id="gmail-m_-4885831686578523128LPlnk720706" target="_blank">
https://wiki.openstreetmap.org/wiki/Talk:Taginfo/Taglists#Server_scripts_as_alternative_taglists</a>)</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
--</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Andrew<br>
<div id="gmail-m_-4885831686578523128LPBorder_GTaHR0cHM6Ly93aWtpLm9wZW5zdHJlZXRtYXAub3JnL3dpa2kvVGFsazpUYWdpbmZvL1RhZ2xpc3RzI1NlcnZlcl9zY3JpcHRzX2FzX2FsdGVybmF0aXZlX3RhZ2xpc3Rz" class="gmail-m_-4885831686578523128LPBorder961271" style="width:100%;margin-top:16px;margin-bottom:16px;max-width:800px;min-width:424px">
<table id="gmail-m_-4885831686578523128LPContainer961271" style="padding:12px 36px 12px 12px;width:100%;border-width:1px;border-style:solid;border-color:rgb(200,200,200);border-radius:2px">
<tbody>
<tr style="border-spacing:0px" valign="top">
<td style="width:100%">
<div id="gmail-m_-4885831686578523128LPTitle961271" style="font-size:21px;font-weight:300;margin-right:8px;font-family:wf_segoe-ui_light,"Segoe UI Light","Segoe WP Light","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;margin-bottom:12px">
<a id="gmail-m_-4885831686578523128LPUrlAnchor961271" href="https://wiki.openstreetmap.org/wiki/Talk:Taginfo/Taglists#Server_scripts_as_alternative_taglists" style="text-decoration:none" target="_blank">Talk:Taginfo/Taglists - OpenStreetMap Wiki</a></div>
<div id="gmail-m_-4885831686578523128LPDescription961271" style="font-size:14px;max-height:100px;color:rgb(102,102,102);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;margin-bottom:12px;margin-right:8px;overflow:hidden">
Languages. This is a very cool feature! One question: Could the template get the langugage automatically? I know this is done on some templates (e.g. Template:Tag).-- Jojo4u 17:20, 20 August 2015 (UTC) . I am not a template wizard.</div>
<div id="gmail-m_-4885831686578523128LPMetadata961271" style="font-size:14px;font-weight:400;color:rgb(166,166,166);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif">
<a href="http://wiki.openstreetmap.org" target="_blank">wiki.openstreetmap.org</a></div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
</div>
<div id="gmail-m_-4885831686578523128appendonsend"></div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_-4885831686578523128divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Joseph Eisenberg <<a href="mailto:joseph.eisenberg@gmail.com" target="_blank">joseph.eisenberg@gmail.com</a>><br>
<b>Sent:</b> 02 August 2019 14:22<br>
<b>To:</b> Tag discussion, strategy and related tools <<a href="mailto:tagging@openstreetmap.org" target="_blank">tagging@openstreetmap.org</a>><br>
<b>Subject:</b> Re: [Tagging] Rethinking Map Features</font>
<div> </div>
</div>
<div class="gmail-m_-4885831686578523128BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="gmail-m_-4885831686578523128PlainText">Andrew,<br>
<br>
I now think it is a good idea to switch to taglists for all of the Map<br>
Feature page templates. It will make it much easier to keep the pages<br>
consistent and to a reasonable length if all of the descriptions are<br>
pulled from the wiki pages directly (just as is done for descriptions<br>
used by Taginfo).<br>
<br>
This just means that any deprecated or discouraged tags which are<br>
currently "strikethrough" on Map Features will need something in the<br>
description that mentions that they are discouraged. This is a good<br>
idea anyway, so that the documentation is consistent.<br>
<br>
Joseph<br>
<br>
On 7/7/19, Andrew Hain <<a href="mailto:andrewhainosm@hotmail.co.uk" target="_blank">andrewhainosm@hotmail.co.uk</a>> wrote:<br>
> I have been working on a scheme to improve the cross-language quality of Map<br>
> Features.<br>
> [<a href="https://wiki.openstreetmap.org/wiki/Talk:Map_Features#Reimagining_Map_Features" target="_blank">https://wiki.openstreetmap.org/wiki/Talk:Map_Features#Reimagining_Map_Features</a>]<br>
><br>
> Of course the page may deserve a bigger or deeper rethink.<br>
><br>
> --<br>
> Andrew<br>
> Talk:Map Features - OpenStreetMap<br>
> Wiki<<a href="https://wiki.openstreetmap.org/wiki/Talk:Map_Features#Reimagining_Map_Features" target="_blank">https://wiki.openstreetmap.org/wiki/Talk:Map_Features#Reimagining_Map_Features</a>><br>
> amenity=school rendering colour. amenity=school is displayed in the page as<br>
> a light-purple area for ways, whereas mapnik renders them as a pale yellow<br>
> colour<br>
> <a href="http://wiki.openstreetmap.org" target="_blank">wiki.openstreetmap.org</a><br>
><br>
><br>
<br>
_______________________________________________<br>
Tagging mailing list<br>
<a href="mailto:Tagging@openstreetmap.org" target="_blank">Tagging@openstreetmap.org</a><br>
<a href="https://lists.openstreetmap.org/listinfo/tagging" target="_blank">https://lists.openstreetmap.org/listinfo/tagging</a><br>
</div>
</span></font></div>
</div>

_______________________________________________<br>
Tagging mailing list<br>
<a href="mailto:Tagging@openstreetmap.org" target="_blank">Tagging@openstreetmap.org</a><br>
<a href="https://lists.openstreetmap.org/listinfo/tagging" rel="noreferrer" target="_blank">https://lists.openstreetmap.org/listinfo/tagging</a><br>
</blockquote></div>