# வார்ப்புரு:Cite Q/doc



This template, a wrapper for , returns a formatted citation from statements stored on a Wikidata item (referred to by its *Q identifier* or *QID*) describing a citable source such as a scholarly article.  

You can read about the template in:  
:  

**Note:** While Wikipedia , citations using Cite Q are *not* citing Wikidata; they cite the individual work stated, using metadata about that work, which is held on Wikidata for convenience.  

## Usage

For example, Wikidata item is a scholarly item. To cite this as a source:  
:<code></code> →  
::  

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 ; setting that parameter to <code>all</code> displays them all. The same applies to multiple editors – see the test-case pages.  

Citations of papers which have been retracted will appear in :Category:Cite Q - cites a retracted work.  

Citations of papers which have been replaced will appear in :Category:Cite Q - cites a replaced work.  

You can also use if you want to have a bullet returned before the citation (useful for automatic lists)  

### Parameters

- = Wikidata QID for the article

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

### Blank

:<code></code>  

### Reference naming

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

:<code></code>  

### Parameter / entity map
This section lists where each of the template's supported parameters gets its data.  

#### Bibliographic parameters
- =
- = ;
- =

- =
- = ;
- =
- =
- =
- =
- = (for written-at place)
- = (treated like unless both are given)
- = (for publication place, treated like unless both are given)
- =
- =
- = (Wikidata label)
- =
- = , ,
- =
- =
- = , , , ,

#### Identifier parameters
- = (add for some locales)
- =
- = (add to indicate free)
- =
- =
- = (add to indicate free; add if deprecated)
- = (add to indicate free)
- = (falls back to )
- =
- =
- = (add to indicate free)
- =
- =
- =
- = (add to indicate free)
- = (add to indicate free)
- = (add if embargoed)
- =
- =
- =
- = (add to indicate free)
- =

#### Archival parameters
- = (the long URL with a date is needed; see WP:WEBARCHIVES for e.g. Archive Today)

### Examples

;<code></code>  
:  
;<code></code>  
:  
;<code></code>  
:  
;<code></code>  
:  
;<code></code>  
:  
;<code></code> (with chapter specified)  
:  
;<code></code> (with pages)  
:  
;<code></code>  
:  
;<code></code>  
:  
;<code></code>  
:  
;<code></code>  
:  
;<code></code>  
:  

For an example of a bibliography, updated periodically by Listeriabot, see User:Mike Peel/publications.  

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

## Workflow

The template used with a single parameter, the Q-number of the article on Wikidata, will produce a citation using the default display parameters from Template:Citation and the styling of the author and editor names as they are stored on Wikidata. This is rarely the same as required by the citation formatting in any given article. The guidance at WP:CITEVAR requires that editors match the formatting of citations that they add to that of the article where it is added. At present, does not know what style the formatting in an article requires (although it is possible that common styles could be marked or recognised automatically as is done for date formatting).  

The result is that editors using must take care to preview their edits and ensure that the formatting rendered matches that of the rest of the article. The commonest formatting issues are:  
1. Order of first and last names of authors and editors:
1. : A typical output might be:
  1. <code></code> →
  1. 
1. : If that were used in an article that used "Last, First" format for author names, then the editor would have to find a way to format the Cite Q author names correctly. The best option, which will apply to all articles using Cite Q with a given ID, is to modify the Wikidata property for each author and editor, adding "object named as" with the author's name in "Last, First" format. See :d:Q45922947#P98 for an example.
1. : Editors can also supply those author names manually in the desired format within the Cite Q template. It's often worth previewing the citation in expanded form to show what is being passed to the actual citation template:
  1. <code></code> →
  1. 
1. : That would make the author names (and author-links) easily available for copy and paste, followed by tweaking into the desired format:
  1. <code></code> →
  1. 
1. Punctuation:
1. : The separators between elements in the above citation is a comma, which is the default for a CS2-style format produced by . Careful examination in a particular article will often show the separator punctuation to be a full stop (period). That may be selected by setting :
  1. <code></code> →
  1. 
  1. Sometimes, the article will have author names with initials, and those initials are terminated with a full stop (period). It may be necessary to manually add or remove the punctuation in the author names to match the style of the target article (note: this does not apply to author-links, which match the title of the author's article):
  1. <code></code> →
  1. 
1. Italicisation in titles:
1. : Titles drawn from Wikidata cannot contain formatting, so editors using may have to add appropriate formatting.
1. : will automatically apply italicisation to titles of books, etc. so that does not need to be added:
  1. <code></code> →
  1. 
1. : However, some titles require partial italicisation, and that has to be done manually when the whole title is not italicised, although that is rare. Titles of chapters may also need to be checked:
  1. For example (from ): <code></code>

## Module:Wd

Module:Wd can automatically cause this template to be invoked, e.g.,  
;<code></code>  
:  
currently causes the following to be invoked:  
;<code></code>  
:  
because an statement on is referenced to be with = 242.  

## Issues

### Future developments
- Once robust the functionality should be merged into
- 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.

### To do list
- Properties
  - More properties/ parameters to add
  - Parameters with no equivalent property?
- Internationalisation
- Check/resolve handling of redirected QID
- Order of precedence for rendering author names:
  - 
 qualifier on 

  - 
 qualifier on 

  - 


  - 
 label in English

  - label in any other language
  - 
Regardless of which of the above is used, link to the author biography article if available, via (matched via if applicable)

- 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
  - Other tracking categories?
- Links to sister projects: Wikisource, if a transcription project exists; Wikibooks; Wikiversity (esp. the WikiJournals there); perhaps more
  - Avoid <code></code>!
  - Also add links to authors who have pages on Wikisource but not on Wikipedia. Related query: Authors on Wikisource but not other projects, who are linked to by an item which is a subclass of Q47461344 (written work)
- Link to Wikisource should take priority over all URL properties, but only if accompanied by . If not, should take precedence over URLs.
- 
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
- 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.
- 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.
- Take possible template parameter usage as hint which parameter to use in the generated output. F.e. if the journal/magazine/newspaper parameter is used, the template should use the same in the output. The underlying template {citation} will switch the output format accordingly.
- Try to utilize given parameter values as filter for retrieved WD data. If an editor specifies |edition=2 or |volume=3, cite Q should select correlating data (f.e. page ranges, identifiers etc.) while retrieving data from WD (in cases where more than one entry is available for a particular parameter)
- When the author is cited as , the label should start with an upper case letter
  - Quick and dirty workaround: <code></code>
- Make this fix unnecessary.
- Add indication alongside citations of retracted/ replaced works
- Consider cases where citing a retracted/ replaced work is deliberate
- Make use of , , and consider how to use
  - Partially implemented for the cases where is a qualifier of and is a URL showing the date in a recognised format (per a regex)
- Use , where present.
- Ability to cite chapters, per Template talk:Cite Q#Cite Q chapter broken
- Use something like so that is used to provide the English translated title, if present, in addition to the non-English original title.

### Deferred
Feel free to tackle these; the core team working on Cite Q sees them as low priority, or too complex.  

- Resolve special case of newspaper articles
  - Is the following topic of "hint parameters" related to this?
- Author names (Western-style, at least) should display as "Last, First Middle" to match Wikipedia house style
  - How to deal with Tussenvoegsels etc.
    - In Romance languages, it should be, e.g., "Quental, Antero de" instead of "de Quental, Antero"
- Handle volume in a serial
  - **Clarification needed:** What is meant by this? |part=, or output format differences journal vs. magazine?
- Is there a Pxxxx code for book series editors to add them to the list of "normal" editors?
  - resolve at Wikidata first

### Done
- 
Multiple author names treated as one blob

- 
Linking author name(s)

- 
Title for a book uses <code></code> and may be expensive

- 
Fix 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 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 

- 
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 <code>url</code> parameter should also pick up data from the properties and 

- 
Linking title to Wikipedia article, if any

- 
Fetch ISSN etc. from item about journal

- 
Move Wikidata link before (and after other IDs like )

  - 
Also fixes postscript character issues in conjunction with and with 

- 
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?

  - 
? No, Zbl uses the same resolving link, but it is a different ID.

- Are there values of which are not illustrators? Possibly:
  - 


  - 


    - 
Fails for very high numbers

  - 


  - 


- 
Add a tracking category for references with a statement

- 
Add a tracking category for references with a statement

- 
Render , following the title with a <code>:</code>

- 
Convert WikiData's edition number (e.g., *1*) into the ordinal (*1st*) expected by .


### Won't fix
- Improve date formatting options
  - This is done in
- Fix unnecessary piping of author/editor and journal links if link and label are the same, f.e. -> , -> for improved reusability, cleaniness of output, reduced size of resulting page code, and to avoid potential future extra text errors thrown by the underlying {citation} template
  - See talk
- Fix invocation with instead of unnamed parameter. At present instead of gives an error.
  - This is intended; please discuss on talk
  - Fix ready for test in template sandbox: gives
- Replace the QID with a pen icon
  - The QID is valid metadata about the cited work.
- Consider case where author is given as
  - 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}
    - Disputed; see Template talk:Citation#Et al
- Improve rendering when both and are present.
  - Example: ** →
  - Current rendering of author name uses semicolon: “Camelia-Manuela Lățăianu; Manuela Lataianu”
  - Suggested improved rendering of author name: “Manuela Lataianu [= Camelia-Manuela Lățăianu]”
  - Such instances should be fixed on Wikidata, as done here