Help:Contributing/citations: Difference between revisions

From Wikibase
Jump to navigation Jump to search
Cite-by-QID help page (issues #24/#25): {{#cite}} / {{#citations:}} parser functions (via create-page on MediaWiki MCP Server)
 
human rewrite of LLM-gen content
Line 1: Line 1:
Cite a Wikibase item by its QID and the citation renders from the item graph — you never type the bibliographic metadata. Edit the source item once; every page that cites it updates. Every example below is live against real items.
'''ronzz-wikibase has a custom citation mechanism.''' It is different from those on vanilla wikibase instances, such as Wikipedia.


== The two parser functions ==
== Why a custom citation mechanism? ==


{| class="wikitable" style="width:100%"
On a vanilla wikibase, citation is cubersome: You need to write citation text manually or generate it via a 3rd-party app, then paste it between <syntaxhighlight lang="html" inline><ref></ref></syntaxhighlight> tags to create a citation item. Therefore, if you cite the same source on multiple pages, the way to go is to copy and paste the citation text multiple times.
! Function
! What it does
! Use it when
|-
| <code>#cite</code>
| Renders one citation for one or more items — inline, or inside a <syntaxhighlight lang="wikitext" inline><ref></syntaxhighlight> footnote.
| Quoting, footnoting.
|-
| <code>#citations:</code>
| Renders the page's bibliography: one entry per distinct source item.
| A "Sources" section.
|}


== Citing with #cite ==
The most scary part comes when you later updates the citation (e.g., because you made a typo). You will need to manually update each one, unless you have a bot account setup and know MediaWiki APIs well enough to do some batch text-op scripting.


Running example: Q95 (a book) and Q96 (a quotation that cites the book). The citation follows the item's class: a content item cites through its <code>source</code> statement, a source item cites itself.
To eliminate all the complexity, we purpose-built our custom entity-based citation mechanism.


{| class="wikitable" style="width:100%"
== A citation starts with a citable entity ==
! You type !! You get
|-
| <syntaxhighlight lang="wikitext">{{#cite:Q95}}</syntaxhighlight>
| {{#cite:Q95}}
|-
| <syntaxhighlight lang="wikitext">{{#cite:Q95|style=vancouver}}</syntaxhighlight>
| {{#cite:Q95|style=vancouver}}
|-
| <syntaxhighlight lang="wikitext">{{#cite:Q96}}</syntaxhighlight>
| {{#cite:Q96}}
|-
| <syntaxhighlight lang="wikitext">{{#cite:Q95|Q96}}</syntaxhighlight>
| {{#cite:Q95|Q96}}
|}


<blockquote>
To create a citation on ronzz-wikibase, you first need a citable entity, which can be a book, a newspaper article, or whatever source you would like to cite.
'''A citation follows the source, not the page.''' Q96's citation is the quotation itself (author, date, text) — its source book shows as the container. Multi-entity <syntaxhighlight lang="wikitext" inline>{{#cite:Q95|Q96}}</syntaxhighlight> puts both citations in one output — one footnote with several sources.
</blockquote>


== Footnotes ==
First search via [[Special:ItemDisambiguation]] page by title if the source you would like to cite exists already as an entity on ronzz-wikibase. If so, note its entity number (the number starting with "Q"). If it does not yet exist, you can [[Special:AddSource|create it]]. The entity number will be shown at the end of the guided creation process. Note it. This magic number represents the citable entity across ronzz-wikibase


Wrap <syntaxhighlight lang="wikitext" inline>{{#cite}}</syntaxhighlight> in the stock Cite extension's <syntaxhighlight lang="wikitext" inline><ref></syntaxhighlight> and list the footnotes with <syntaxhighlight lang="wikitext" inline><references/></syntaxhighlight>:
== A citation is declared with <syntaxhighlight lang="wikitext" inline><ref>{{#cite:Qxx}}</ref></syntaxhighlight> ==


{| class="wikitable" style="width:100%"
{| class="wikitable" style="width:100%"
Line 52: Line 24:
|}
|}


<references/>
That's it. The ronzz-wikibase render engine takes care of everything.


<blockquote>
<blockquote>
'''Use <syntaxhighlight lang="wikitext" inline><references/></syntaxhighlight>, not <syntaxhighlight lang="wikitext" inline>{{reflist}}</syntaxhighlight>.''' The stock Cite extension on this wiki registers the <syntaxhighlight lang="wikitext" inline><references/></syntaxhighlight> tag; <syntaxhighlight lang="wikitext" inline>{{reflist}}</syntaxhighlight> only works if a <syntaxhighlight lang="wikitext" inline>Template:Reflist</syntaxhighlight> exists.
If you ever need to cite multiple sources in one place, simply repeat the entire syntax multiple times. Each source needs its own <syntaxhighlight lang="wikitext" inline><ref></ref></syntaxhighlight> wrapping.
</blockquote>
</blockquote>


== The Sources section: #citations: ==
== Create bibliography with <syntaxhighlight lang="wikitext" inline><references/></syntaxhighlight> ==
 
This part is exactly the same as on vanilla wikibase instances such as wikipedia. You simply type at the end of your article:


Collects the distinct source items cited on the page — multiple quotes from one book collapse to one entry:
<syntaxhighlight lang="wikitext">
<references/>
</syntaxhighlight>


{| class="wikitable" style="width:100%"
and everything you have cited in the article will be automatically included:
! You type !! You get
|-
| <syntaxhighlight lang="wikitext">{{#citations:}}</syntaxhighlight>
| {{#citations:}}
|-
| <syntaxhighlight lang="wikitext">{{#citations:Q95|Q96}}</syntaxhighlight>
| {{#citations:Q95|Q96}}
|}


<blockquote>
<blockquote>
'''The trailing colon is required.''' <syntaxhighlight lang="wikitext" inline>{{#citations}}</syntaxhighlight> without the colon renders literally — the wiki reads it as an unknown template:
<references/>
 
{| class="wikitable" style="width:100%"
! You type !! You get
|-
| <syntaxhighlight lang="wikitext">{{citations}}</syntaxhighlight>
| {{citations}}
|}
</blockquote>
</blockquote>


== Arguments ==
== To edit citations, edit simply the citable entity ==
 
Both functions accept <code>style</code> and <code>output</code> as named arguments (or positionally, after the QIDs):
 
{| class="wikitable" style="width:100%"
! Argument !! Values !! Default
|-
| <code>style</code>
| <code>apa</code>, <code>vancouver</code>, <code>json</code>, <code>bibtex</code>, <code>ris</code>
| <code>apa</code>
|-
| <code>output</code>
| <code>html</code>, <code>text</code>
| <code>html</code>
|}
 
== Keep the items healthy ==


* Sources are items with harvested metadata (DOI, publisher, pages, …) — create them with [[Help:Contributing/import|Special:AddSource]].
If you ever need to update a citation, because you spotted a typographic error, etc., you simply need to update the citable entity it refers to.Visit <code>https://wikibase.ronzz.org/wiki/Item:Qxxx</code>, where <code>xxx</code> stands for the citable entity's serial number, and use the in-page edit buttons to update relevant fields. All citations on any ronzz-wikibase page of that source will be updated automatically.
* Content items point at their source with a <code>source</code> statement ([[Help:Contributing/entities|items and properties]]).
* For an exact quote location, add a <code>page(s)</code> qualifier on the content item's <code>source</code> statement — it becomes the page number in the citation.
* A missing or unknown item renders an error span, never a broken page.


== How updates propagate ==
== Do NOT delete citable entities, even if you delete your citations ==


Editing a cited item re-renders every citing page automatically (through the job queue, usually within a few minutes). A page always renders the current state of its citations — there is no metadata to keep in sync by hand.
It may be counter-intuitive, but in this case you should NOT cleanup after yourselves. Even if you delete all the references to one citable entity you created, you should not delete the citable entity itself, ever. The possibility that someone else is citing it on another page ranges from high (for popular sources) to possible (for niche sources), in all cases never zero. Deleting a citable entity saves less 1 kB of memory, at the risk of breaking an unknown number of pages. It is NEVER worth the risk.


== See also ==
== See also ==


* [[Help:Contributing/import]] — creating source items from external authorities
For further info on the semantic data model behind the citation mechanism at ronzz-wikibase, see [[Help:Contributing/entities]].
* [[Help:Contributing/entities]] — items, properties, statements and qualifiers
* [[Help:Contributing/semanticDynamicContent]] — other ways to render item data on a page
* [[Help:Contributing/query]] — analyse the data with SPARQL
* [[Help:Contributing]] — contributing to this wiki

Revision as of 15:24, 20 August 2026

Languages: English · français · Esperanto

ronzz-wikibase has a custom citation mechanism. It is different from those on vanilla wikibase instances, such as Wikipedia.

Why a custom citation mechanism?

On a vanilla wikibase, citation is cubersome: You need to write citation text manually or generate it via a 3rd-party app, then paste it between <ref></ref> tags to create a citation item. Therefore, if you cite the same source on multiple pages, the way to go is to copy and paste the citation text multiple times.

The most scary part comes when you later updates the citation (e.g., because you made a typo). You will need to manually update each one, unless you have a bot account setup and know MediaWiki APIs well enough to do some batch text-op scripting.

To eliminate all the complexity, we purpose-built our custom entity-based citation mechanism.

A citation starts with a citable entity

To create a citation on ronzz-wikibase, you first need a citable entity, which can be a book, a newspaper article, or whatever source you would like to cite.

First search via Special:ItemDisambiguation page by title if the source you would like to cite exists already as an entity on ronzz-wikibase. If so, note its entity number (the number starting with "Q"). If it does not yet exist, you can create it. The entity number will be shown at the end of the guided creation process. Note it. This magic number represents the citable entity across ronzz-wikibase

A citation is declared with <ref>{{#cite:Qxx}}</ref>

You type You get
Ada was first.<ref>{{#cite:Q96}}</ref>
Ada was first.[1]

That's it. The ronzz-wikibase render engine takes care of everything.

If you ever need to cite multiple sources in one place, simply repeat the entire syntax multiple times. Each source needs its own <ref></ref> wrapping.

Create bibliography with <references/>

This part is exactly the same as on vanilla wikibase instances such as wikipedia. You simply type at the end of your article:

<references/>

and everything you have cited in the article will be automatically included:

  1. ↑ Lovelace, A. (1843). The Analytical Engine has no pretensions whatever to originate anything. In Notes by the Translator. R. & J. E. Taylor. https://doi.org/10.1000/notes

To edit citations, edit simply the citable entity

If you ever need to update a citation, because you spotted a typographic error, etc., you simply need to update the citable entity it refers to.Visit https://wikibase.ronzz.org/wiki/Item:Qxxx, where xxx stands for the citable entity's serial number, and use the in-page edit buttons to update relevant fields. All citations on any ronzz-wikibase page of that source will be updated automatically.

Do NOT delete citable entities, even if you delete your citations

It may be counter-intuitive, but in this case you should NOT cleanup after yourselves. Even if you delete all the references to one citable entity you created, you should not delete the citable entity itself, ever. The possibility that someone else is citing it on another page ranges from high (for popular sources) to possible (for niche sources), in all cases never zero. Deleting a citable entity saves less 1 kB of memory, at the risk of breaking an unknown number of pages. It is NEVER worth the risk.

See also

For further info on the semantic data model behind the citation mechanism at ronzz-wikibase, see Help:Contributing/entities.