توضیحات الگو[نمایش] [ویرایش] [تاریخچه] [پاکسازی]

Usage

A wrapper for {{Citation}}, which calls available values from ویکی‌داده.

An example of an article using this template for all of its references is تلسکوپ قطب جنوب; 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 ویکی‌پدیا:شیوه ارجاع به منابع wars!
  • We should have a [[:mediawiki:|Global templates|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}}
{{citation}}: Empty citation (help), Wikidata Q15625490
{{Cite Q|Q15625490|page=42}}
, p. 42 {{citation}}: Missing or empty |title= (help), Wikidata Q15625490
{{Cite Q|Q15625490|access-date=18 May 2017}}
{{citation}}: Empty citation (help), Wikidata Q15625490
{{Cite Q|Q15625490|quote=lorem ipsum}}
, lorem ipsum {{citation}}: Missing or empty |title= (help), Wikidata Q15625490
{{Cite Q|Q25766745}}
{{citation}}: Empty citation (help), Wikidata Q25766745
{{Cite Q|Q25766745 |chapter=The Final Cut}} (with chapter specified)
"The Final Cut", {{citation}}: Missing or empty |title= (help), Wikidata Q25766745
{{Cite Q|Q25766745 |pages=48-52}} (with pages)
, pp. 48–52 {{citation}}: Missing or empty |title= (help), Wikidata Q25766745
{{Cite Q|Q15625490|access-date=18 May 2017}}
{{citation}}: Empty citation (help), Wikidata Q15625490
{{Cite Q|Q25766745|mode=cs1}}
{{citation}}: Empty citation (help) Wikidata Q25766745
{{Cite Q|Q25766745|mode=cs2}}
{{citation}}: Empty citation (help), Wikidata Q25766745
{{Cite Q|Q25766745|author-mask=1}}
{{citation}}: Empty citation (help), Wikidata Q25766745

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

Module:Wd

پودمان:Wd can automatically cause this template to be invoked, e.g.,

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

currently causes the following to be invoked:

{{Cite Q|Q15707237|pages=242}}
, p. 242 {{citation}}: Missing or empty |title= (help), Wikidata Q15707237

because an (P2046) statement on (Q2978) is referenced to be (P248) (Q15707237) with (P304) = 242.

Issues

  • Render (P1680), following the title with a :
  • More properties/ parameters to add
  • Parameters with no equivalent property?
  • Check/resolve handling of redirected QID
  • Resolve special case of newspaper articles
  • Improve date formatting options
  • Handle volume in a serial
  • Order of precedence for rendering author names:
    1. (P1932) qualifier on (P50)
    2. (P2093)
    3. (P50) label in English
    4. (P50) label in any other language
    • Regardless of which of the above is used, link to the author biography article if available, via (P50) (matched via (P1545) if applicable)
  • Author names (Western-style, at least) should display as "Last, First Middle" to match Wikipedia house style
  • Are there values of |others which are not illustrators? Possibly:
  • Add a tracking category for references with a (P1366) statement
  • Add a tracking category for references with a (P5824) statement
  • Add tracking categories for each parameter where the local value differs from the corresponding WD value so that either the WD entry can be updated/corrected or the local override can be corrected/removed
  • Links to sister projects: Wikisource, if a transcription project exists; Wikibooks; Wikiversity (esp. the Wikijournals there); perhaps more
    • Avoid <ref name="dicc">{{Cite Q|Q100160262}} {{cite wikisource|wslanguage=pt|wslink=Diccionario Bibliographico Brazileiro/Francisco Antonio de Almeida|title=Transcription}}</ref>!
  • Consider case where author is given as (Q311624)
    • If last author/editor is named "et al." (and variants), mute this entry and set display-authors/editors=etal instead before passing down to {citation}
  • (P996) should take priority over all URL properties
    • What if also on Wikisource?
  • Where there is a Wikipedia article about the work cited, link the title to that, overriding the URL if necessary (example: d:Q25766745)
    • Ditto for editions of works
  • Fix unnecessary piping of author/editor and journal links if link and label are the same, f.e. [[مؤلف (پدیدآور)]] -> [[مؤلف (پدیدآور)]], [[Journal|Journal]] -> [[Journal]]
  • Is there a Pxxxx code for SBNs (شماره استاندارد بین‌المللی کتاب to support |sbn= parameter?
    • Apparently not
  • Is there a Pxxxx code for JFM (Jahrbuch über die Fortschritte der Mathematik) to support |jfm= parameter?
  • Is there a Pxxxx code for book series editors to add them to the list of "normal" editors?
  • Fix page evaluation code to accept comma- and semicolon-separated lists, at present a WD pages entry of "1" will result in |pages=1–1 (and metadata &rft.pages=1-1) rather than |page=1 (and metadata &rft.pages=1).
  • Implement evaluation of generic keyword for all parameters to denote that a WD value should be accepted by framing its value in accept-this-as-written markup ((..)). See talk thread for possible keyword names.
  • Fix invocation with |qid= instead of unnamed parameter. At present {{cite Q|qid=Q12345}} instead of {{cite Q|Q12345}} gives an error.
    • This is intended; please discuss on talk
  • Use canonical parameter names when calling down to {citation} (f.e. |page= rather than |p=) and check all parameter aliases when scanning for override parameters (at present some alias parameter names are ignored, possibly leading to inconsistent behaviour if they are set as well).
  • Consider including a link to Special:EntityUsage, in the form, say, Other cites or with a small icon.

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 ( (P2093)) values (e.g. on Q38000000)
  • Pseudonymous author personas such as P. D. Q. Bach or مارک توین
  • Title not in English
  • Handle volume, issue and page(s) as qualifiers of (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 (P953) and (P2699)
  • 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=