Template:Cite Q/sandbox

From blackwiki
Jump to navigation Jump to search
Template documentation[view] [edit] [history] [purge]

Template:Uses Wikidata

Usage

A wrapper for {{Citation}}, which calls available values from Wikidata.

An example of an article using this template for all of its references is South Pole Telescope; an example using Harvard style citations is Suffix automaton.

By default, if there are more than eight author names, the template displays three, followed by "et al". This can be changed using |display-authors=; using that parameter with no value displays them all. The same applies to multiple editors - see the test-case pages.

Future developments

  • Once robust the functionality should be merged into {{Citation}}
  • Eventually, each signed-in reader should be able to set, under their "Preferences", the style in which they wish to see citations rendered. No more CiteVar wars!
  • We should have a global template repository, so the code can be used by multiple wikis, without having to manually copy it after every update.

Parameters

  • |1= = Wikidata QID for the article

Additionally, any named parameter used in {{citation}} may be entered and will overwrite the value in Wikidata. Using such parameters, with a value of unset, will suppress display of data from Wikidata.

Blank

<ref name="">{{Cite Q| XXQIDXX }}</ref>

Reference naming

For ease of use, you may wish to name your references to reflect the cited work, for example:

<ref name="Williams-2010">{{Cite Q|Q15625490}}</ref>

Parameter / entity map

This section lists where each of the template's supported parameters gets its data.

Bibliographic parameters

Identifier parameters

Examples

{{Cite Q|Q15625490}}
Lua error in Module:Cite_Q at line 53: attempt to index field 'wikibase' (a nil value).
{{Cite Q|Q15625490|page=42}}
Lua error in Module:Cite_Q at line 53: attempt to index field 'wikibase' (a nil value).
{{Cite Q|Q15625490|access-date=18 May 2017}}
Lua error in Module:Cite_Q at line 53: attempt to index field 'wikibase' (a nil value).
{{Cite Q|Q15625490|quote=lorem ipsum}}
Lua error in Module:Cite_Q at line 53: attempt to index field 'wikibase' (a nil value).
{{Cite Q|Q25766745}}
Lua error in Module:Cite_Q at line 53: attempt to index field 'wikibase' (a nil value).
{{Cite Q|Q25766745 |chapter=The Final Cut}} (with chapter specified)
Lua error in Module:Cite_Q at line 53: attempt to index field 'wikibase' (a nil value).
{{Cite Q|Q25766745 |pages=48-52}} (with pages)
Lua error in Module:Cite_Q at line 53: attempt to index field 'wikibase' (a nil value).
{{Cite Q|Q15625490|access-date=18 May 2017}}
Lua error in Module:Cite_Q at line 53: attempt to index field 'wikibase' (a nil value).
{{Cite Q|Q25766745|mode=cs1}}
Lua error in Module:Cite_Q at line 53: attempt to index field 'wikibase' (a nil value).
{{Cite Q|Q25766745|mode=cs2}}
Lua error in Module:Cite_Q at line 53: attempt to index field 'wikibase' (a nil value).
{{Cite Q|Q25766745|author-mask=1}}
Lua error in Module:Cite_Q at line 53: attempt to index field 'wikibase' (a nil value).

For additional examples, see testcases and testcases/many names.

Module:Wd

Module:Wd can automatically cause this template to be invoked, e.g.,

{{Wikidata|references|raw|Q2978|P2046}}
Template:Wikidata

currently causes the following to be invoked:

{{Cite Q|Q15707237|pages=242}}
Lua error in Module:Cite_Q at line 53: attempt to index field 'wikibase' (a nil value).

because an Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P2046) statement on Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (Q2978) is referenced to be Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P248) Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (Q15707237) with Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P304) = 242.

Issues

Done

  • Multiple author names treated as one blob
  • Linking author name(s)
  • Title for a book uses {{ #invoke:WikidataIB |getLink |{{{1}}} }} and may be expensive
  • Fix |ol= values
  • Need to add manual date for newspaper articles/ website articles.
  • Make publisher a link, where appropriate
  • Improve handing of unexpected multiple values
    • e.g. Handle multiple DOIs
  • Author name string (Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P2093)) values (e.g. on Q38000000)
  • Pseudonymous author personas such as P. D. Q. Bach or Mark Twain
  • Title not in English
  • Handle volume, issue and page(s) as qualifiers of Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P1433)
  • Wider variety of examples/ test cases
  • If language of work or name is set (and not the local language); pass that; if not but language of title is set (and not the local language), use that
  • The url parameter should also pick up data from the properties Template:Wikidata property link and Template:Wikidata property link
  • Linking title to Wikipedia article, if any
  • Fetch ISSN etc. from item about journal
  • Move Wikidata link before |quote= (and after other IDs like |pmid=)
    • Also fixes postscript character issues in conjunction with |mode=cs1 and with |quote=
  • Fix page evaluation code to accept comma- and semicolon-separated lists
  • Use canonical parameter names when calling down to {citation} (f.e. |page= rather than |p=)
  • Is there a Pxxxx code for SBNs (Standard Book Number to support |sbn= parameter?
    • Apparently not -> Add SBN property to WD. (Also add SICI and BICI properties corresponding with COinS &rft.sici and &rft.bici.)
  • Is there a Pxxxx code for JFM (Jahrbuch über die Fortschritte der Mathematik) to support |jfm= parameter?
    • Template:WDP? No, Zbl uses the same resolving link, but it is a different ID.