Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Wikidata table/doc
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> This module creates one or more table rows where the data in each cell is taken from Wikidata. == Usage == === Function makerow === This function is under development for use in articles. It creates a single table row from one Wikidata entity using a given set of properties. The first cell is the label for the Wikidata entity and it is marked up as a row-header. An "editonwikidata" icon is appended to the first cell. The table caption, column headings and scopes, etc. should be supplied externally. See the examples for more detail. <syntaxhighlight lang="moin"> {{#invoke:Wikidata table |makerow |pids= P123, P234+P345, P456, P567/P580-P582, etc. (see below) |qid = Q12345 (one entity id for the row) |line = HTML color code for horizontal line applied to top of each row (if required) |c1 = locally supplied value (overrides value from Wikidata for column 1) |c2 = locally supplied value (overrides value from Wikidata for column 2) |cN = locally supplied value (overrides value from Wikidata for column N), etc. |c1+ = locally supplied value (appends value from Wikidata to column 1) |c2+ = locally supplied value (appends value from Wikidata to column 2) |cN+ = locally supplied value (appends value from Wikidata to column N), etc. }} </syntaxhighlight> === Notes=== * A table cell can be made up of a combination of multiple properties, qualifiers and references. * Whitespace is ignored in the list of pids. * The separator for cell values is the comma <code>,</code>. * Within a cell, multiple properties are separated by the plus sign <code>+</code>. * Each property can be separated from one or more qualifiers by a forward-slash <code>/</code>. * Each qualifier is separated by a hyphen <code>-</code> (although any punctuation other than <code>, + /</code> will work). === Function convert === A convenient function to convert a list of articles into a table. <syntaxhighlight lang="moin"> {{subst:#invoke:Wikidata table | convert | template = name of template | 1 = list of articles }} </syntaxhighlight> For example: <syntaxhighlight lang="moin"> {{subst:#invoke:Wikidata table | convert | template = Wdtable row/dam | 1 = * [[Aoyama Dam]] * [[Apporo Dam]] * [[Ariake Dam]] }} </syntaxhighlight> produces: <pre> {{Wdtable row/dam|qid=Q113189811<!-- Aoyama Dam -->}} {{Wdtable row/dam|qid=Q113189827<!-- Apporo Dam -->}} {{Wdtable row/dam|qid=Q113189802<!-- Ariake Dam -->}} </pre> === Function makerows === This function is simple and is intended to test performance. It is unsuitable for use in articles. <syntaxhighlight lang="moin"> {{#invoke:Wikidata table |makerows |pids= P123, P234, P345, etc. (one property id per column) |qids = Q12345, Q23456, Q34567, etc. (one entity id per row) }} </syntaxhighlight> == See also == * [[Template:Wdtable row]] β a wrapper template for <code>makerow</code> * [[Template:Wdtable row/lighthouse]] β a custom wrapper template for <code>makerow</code>, hard-coding the pids for lists of lighthouses * [[Module talk:Wikidata table]] β testing/examples for <code>makerow</code> * [[Template:Wikidata list]] β bot generates Wikidata tables * [[Module:Tabular data]] β shows tabular data from Commons <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | <!-- Categories below this line, please; interwikis at Wikidata --> [[Category:Wikidata modules]] }}</includeonly>
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)