https://de.wikipedia.org/w/index.php?action=history&feed=atom&title=Wikipedia%3ALua%2FModul%2FWikidataScheme%2FSpecification Wikipedia:Lua/Modul/WikidataScheme/Specification - Versionsgeschichte 2025-07-03T11:33:00Z Versionsgeschichte dieser Seite in Wikipedia MediaWiki 1.45.0-wmf.8 https://de.wikipedia.org/w/index.php?title=Wikipedia:Lua/Modul/WikidataScheme/Specification&diff=194846049&oldid=prev PerfektesChaos: m 2019-12-12T13:25:34Z <p>m</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 12. Dezember 2019, 15:25 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 86:</td> <td colspan="2" class="diff-lineno">Zeile 86:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*; qualifiers</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*; qualifiers</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*: Permitted within &lt;code&gt;claims.values&lt;/code&gt; only.</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*: Permitted within &lt;code&gt;claims.values&lt;/code&gt; only.</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>*: Sequence table, of [[#Qualifier|Qualifier]]</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>*: Sequence table, of [[#Qualifier|Qualifier]]<ins style="font-weight: bold; text-decoration: none;"> each.</ins></div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*; [[#example|example]]</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*; [[#example|example]]</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*; [[#terminate|terminate]]</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*; [[#terminate|terminate]]</div></td> </tr> <tr> <td colspan="2" class="diff-lineno">Zeile 93:</td> <td colspan="2" class="diff-lineno">Zeile 93:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>This is rather similar to &lt;code&gt;claims&lt;/code&gt;.</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>This is rather similar to &lt;code&gt;claims&lt;/code&gt;.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* One single qualifier.</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* One single qualifier.</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* <del style="font-weight: bold; text-decoration: none;">Sequence</del> table, with each element as mapping table of the following (mostly optional) components:</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* <ins style="font-weight: bold; text-decoration: none;">Element of a sequence</ins> table, with each element as mapping table of the following (mostly optional) components:</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*; [[#subject|subject]]</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*; [[#subject|subject]]</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*: Mandatory.</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*: Mandatory.</div></td> </tr> </table> PerfektesChaos https://de.wikipedia.org/w/index.php?title=Wikipedia:Lua/Modul/WikidataScheme/Specification&diff=194832625&oldid=prev PerfektesChaos: + 2019-12-11T21:35:22Z <p>+</p> <a href="//de.wikipedia.org/w/index.php?title=Wikipedia:Lua/Modul/WikidataScheme/Specification&amp;diff=194832625&amp;oldid=194817998">Änderungen zeigen</a> PerfektesChaos https://de.wikipedia.org/w/index.php?title=Wikipedia:Lua/Modul/WikidataScheme/Specification&diff=194817998&oldid=prev PerfektesChaos: Setup 2019-12-11T12:00:25Z <p>Setup</p> <p><b>Neue Seite</b></p><div>{{LuaModuleDoc}}<br /> This page describes the data structure used for a &#039;&#039;&#039;WikidataScheme specification&#039;&#039;&#039;.<br /> * The structure applies to both [[JavaScript Object Notation|JSON]] and [[Lua]] table.<br /> A [[#root|root]] element is to be provided.<br /> <br /> == Building blocks ==<br /> <br /> === EntityName ===<br /> This can be either:<br /> * A [[Wikidata]] entity ID, beginning with P, Q, L and followed by digits: &lt;code&gt;[[d:Q1|Q1]]&lt;/code&gt;&lt;code&gt;&lt;/code&gt;<br /> * A symbolic name.<br /> ** This is required to be resolved by [[#NameResolver|NameResolver]].<br /> <br /> === NameResolver ===<br /> This is a mapping table &lt;code&gt;resolve&lt;/code&gt; in [[#root|root]] element which assigns:<br /> * symbolic name<br /> * mapping table as follows:<br /> ** assign a &#039;&#039;number&#039;&#039; to (at least) one of the components &lt;code&gt;P&lt;/code&gt;, &lt;code&gt;Q&lt;/code&gt;, &lt;code&gt;L&lt;/code&gt;.<br /> ** Basically more than one component may be present, but the first one found in that order will be used.<br /> The motivation to use a symbolic name is:<br /> * The thematic description becomes more intuitive; described by self explaining words only.<br /> * An entity used in several places may change pointer at once.<br /> * The assignment may differ in development. Just apply another resolving map. Actually there are three different Wikibase installations available:<br /> *# Productive Wikidata https://www.wikidata.org/<br /> *# WMF test Wikidata<br /> *# BETA Wikidata (wmflabs)<br /> Naturally, all expected symbolic names are to be resolved, otherwise an error is shown in displayed table.<br /> <br /> The [[../#JSON|JSON]] function may be used to resolve all symbolic names and generates pretty formatted JSON with entity IDs only.<br /> <br /> === TextVariant ===<br /> This can be either:<br /> * A &#039;&#039;string&#039;&#039;, with [[Wikidata]] entity ID only, beginning with P, Q, L and followed by digits (label will be used)<br /> * A &#039;&#039;string&#039;&#039;, with constant text otherwise<br /> * A mapping &#039;&#039;table&#039;&#039;, which assigns an [[ISO 639]] / BCP47 key to a text &#039;&#039;string&#039;&#039;.<br /> ** There should be always present at least: &lt;syntaxhighlight lang=&quot;json&quot; style=&quot;white-space:nowrap&quot; inline&gt;{ &quot;en&quot;: &quot;Fallback text&quot; }&lt;/syntaxhighlight&gt;<br /> ** In addition to language codes, the following two components are processed:<br /> ***; class<br /> ***: Sequence table (array) or &#039;&#039;string&#039;&#039; with class names for this text element<br /> ***; style<br /> ***: Mapping table or &#039;&#039;string&#039;&#039; with [[Cascading Style Sheets|CSS]] for this text element<br /> The resulting strings may contain basic markup:<br /> * For italic and bold, &lt;code&gt;&lt;nowiki&gt;&#039;&#039;&lt;/nowiki&gt;&lt;/code&gt; and &lt;code&gt;&lt;nowiki&gt;&#039;&#039;&#039;&lt;/nowiki&gt;&lt;/code&gt; wikisyntax<br /> * Internal links, with &lt;code style=&quot;white-space:nowrap&quot;&gt;&lt;nowiki&gt;[[double bracket]]&lt;/nowiki&gt;&lt;/code&gt; syntax, beginning with global project prefix.<br /> * External links, with &lt;code style=&quot;white-space:nowrap&quot;&gt;&lt;nowiki&gt;[single bracket]&lt;/nowiki&gt;&lt;/code&gt; syntax, beginning with protocol &#039;&#039;http https ftp&#039;&#039;.<br /> * Whitelisted HTML elements, like &#039;&#039;span div bdi bdo code pre ul ol li dl dt dd em strong b i table caption tr th td&#039;&#039;.<br /> <br /> === Entry ===<br /> This is used for both &lt;code&gt;claims&lt;/code&gt; and &lt;code&gt;qualifiers&lt;/code&gt;.<br /> * Both are a sequence table, with each element as mapping table of the following components:<br /> *; subject<br /> *: Property name, P-number or symbolic name resolved by [[#NameResolver|NameResolver]] as P-number.<br /> *; intro<br /> *: General description, introduction<br /> *: [[#TextVariant|TextVariant]]<br /> *; state<br /> *: One of: &lt;code&gt;&quot;required&quot;&lt;/code&gt;, &lt;code&gt;&quot;suggested&quot;&lt;/code&gt;, &lt;code&gt;&quot;deprecated&quot;&lt;/code&gt;, otherwise &lt;code&gt;&quot;optional&quot;&lt;/code&gt;<br /> *; values<br /> *: Sequence table (array) of mapping tables. Each with the following components:<br /> *:; q<br /> *:: The one and only permitted value as item<br /> *:: [[#EntityName|EntityName]] as Q-number.<br /> *:: Must not be used together with &lt;code&gt;qlist&lt;/code&gt;.<br /> *:; qlist<br /> *:: Sequence table (array) of items.<br /> *::* [[#EntityName|EntityName]] as Q-number.<br /> *::* Last element may be &lt;code&gt;true&lt;/code&gt; which indicates that other items than explicitly mentioned are permitted as well.<br /> *:: Must not be used together with &lt;code&gt;q&lt;/code&gt;.<br /> *; qualifiers<br /> *: Permitted within &lt;code&gt;claims&lt;/code&gt; only.<br /> *: [[#Entry|Entry]]<br /> *; example<br /> *: Example value, text<br /> *: [[#TextVariant|TextVariant]]<br /> *; terminate<br /> *: Final remarks<br /> *: [[#TextVariant|TextVariant]]<br /> *; class<br /> *: Sequence table (array) or &#039;&#039;string&#039;&#039; with class names for entire unit<br /> *; style<br /> *: Mapping table or &#039;&#039;string&#039;&#039; with [[Cascading Style Sheets|CSS]] for entire unit<br /> <br /> == {{Anker|root}} Root Element ==<br /> Using all definitions of [[#Parts|parts ]], the specification is defined as follows:<br /> * Mapping table created from the following components:<br /> *; caption<br /> *: Table or gadget title<br /> *: [[#TextVariant|TextVariant]]<br /> *; onLabel<br /> *: Naming convention and expectations on label text<br /> *: [[#TextVariant|TextVariant]]<br /> *; onDesc<br /> *: Formatting and expectations on description text<br /> *: [[#TextVariant|TextVariant]]<br /> *; onAlias<br /> *: Formatting and expectations on aliases texts<br /> *: [[#TextVariant|TextVariant]]<br /> *; claims<br /> *: Statements (actually mandatory)<br /> *; footer<br /> *: Terminating hints, remarks, legend<br /> *: [[#TextVariant|TextVariant]]<br /> *; id<br /> *: &#039;&#039;string&#039;&#039;, selector for entire table<br /> *; class<br /> *: Sequence table (array) or &#039;&#039;string&#039;&#039; with class names for entire table<br /> *; style<br /> *: Mapping table or &#039;&#039;string&#039;&#039; with [[Cascading Style Sheets|CSS]] for entire table<br /> *; options<br /> *: Mapping table, override local /config<br /> *; resolve<br /> *: Mandatory if symbolic names occurring.<br /> *: [[#NameResolver|NameResolver]]<br /> * While all components are optional a specification without &lt;code&gt;claims&lt;/code&gt; is pointless.<br /> * More components are permitted but not evaluated.<br /> <br /> == JSON and Lua ==<br /> * A &#039;&#039;mapping table&#039;&#039; in Lua is an &#039;&#039;object&#039;&#039; &lt;code style=&quot;white-space:nowrap&quot;&gt;{ }&lt;/code&gt; in JSON.<br /> * A &#039;&#039;sequence table&#039;&#039; in Lua is an &#039;&#039;Array&#039;&#039; &lt;code style=&quot;white-space:nowrap&quot;&gt;[ ]&lt;/code&gt; in JSON.<br /> * Both textual JSON and Lua tables may be provided.<br /> * Lua specifications may be generated by general module call, or by providing a generating &lt;code style=&quot;white-space:nowrap&quot;&gt;mw.loadData()&lt;/code&gt; page name.<br /> * A number of specifications may be created programmatically, e.g. fundamentals of a human being, then forking into opera singer, rock &amp; pop musisicians, composer, painter, writer,&amp;nbsp;…<br /> <br /> == Example ==<br /> {{#rel2abs:../../GlobalSharing/Wikidata}}</div> PerfektesChaos