Module talk:WikidataIB: Difference between revisions

Content deleted Content added
 
Line 1:
{{Permanently protected}}
== Testing ==
{{WPBS|
{{WikiProject Wikidata}}
}}
{{banner holder|text=Page history|1=
{{oldtfdfull|date= 2020 September 15 |result=keep |disc=Module:Wikidata Infobox}}
}}
{{to-do|collapsed=yes}}
{{archives|search=yes}}
{{User:MiszaBot/config
|archiveheader = {{talkarchivenav}}
|maxarchivesize = 75K
|counter = 8
|minthreadsleft = 3
|minthreadstoarchive = 1
|algo = old(60d)
|archive = Module talk:WikidataIB/Archive %(counter)d
}}
 
==Multiple qualifiers==
Let's see how this would work in [[Animal farm]], [[d:Q1396889]].
Is there a way to filter a property with many values by two or more qualifiers? [[User:Serresmap|Serresmap]] ([[User talk:Serresmap|talk]]) 00:18, 10 April 2024 (UTC)
 
:@[[User:Serresmap|Serresmap]]: I don't think so. I recommend using [[Module:Wd]] instead, e.g. <code><nowiki>{{#invoke:wd|properties|Q55|P7295|P518=Q762943|P1365=Q11184}}</nowiki></code>. [[User:LennardHofmann|LennardHofmann]] ([[User talk:LennardHofmann|talk]]) 12:55, 12 April 2024 (UTC)
=== Local parameter ===
<pre>
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P50}}<
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P50 |Fred Bloggs}}<
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P50 |fetchwikidata=author; number_of_pages |name=author}}<
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P50 |fetchwikidata=author; number_of_pages; |name=author |Freda Bloggs}}<
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P50 |fetchwikidata=author; number_of_pages |name=author |suppressfields=author}}<
</pre>
 
==Option to get 'raw value'==
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P50}}<
There should be an option to get '''raw value''' of a wikidata item using this module, similar to what we get from {{code|{{wikidata{{!}}property{{!}}raw{{!}}...}}}}.
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P50 |Fred Bloggs}}<
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P50 |fetchwikidata=author; number_of_pages |name=author}}<
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P50 |fetchwikidata=author; number_of_pages; |name=author |Freda Bloggs}}<
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P50 |fetchwikidata=author; number_of_pages |name=author |suppressfields=author}}<
 
Absence of this option makes the template difficult to be used in infoboxes which require some wikidata property of a wikidata item which in turn is specified by some property of the given {{para|qid}}.
=== Only sourced ===
<pre>
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P50 |fetchwikidata=ALL |name=author |onlysourced=no}}<
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P50 |fetchwikidata=ALL |name=author |onlysourced=yes}}<
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P166 |fetchwikidata=ALL |name=awards |onlysourced=}}<
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P166 |fetchwikidata=ALL |name=awards |onlysourced=no}}<
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P166 |fetchwikidata=ALL |name=awards |onlysourced=yes}}<
</pre>
 
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P50 |fetchwikidata=ALL |name=author |onlysourced=no}}<
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P50 |fetchwikidata=ALL |name=author |onlysourced=yes}}<
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P166 |fetchwikidata=ALL |name=awards |onlysourced=}}<
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P166 |fetchwikidata=ALL |name=awards |onlysourced=no}}<
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P166 |fetchwikidata=ALL |name=awards |onlysourced=yes}}<
 
=== No icon ===
<pre>
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P50 |fetchwikidata=ALL |name=author |noicon=}}<
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P50 |fetchwikidata=ALL |name=author |noicon=no}}<
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P50 |fetchwikidata=ALL |name=author |noicon=yes}}<
</pre>
 
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P50 |fetchwikidata=ALL |name=author |noicon=}}<
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P50 |fetchwikidata=ALL |name=author |noicon=no}}<
# >{{#invoke:WikidataIB |getValue |qid=Q1396889 |P50 |fetchwikidata=ALL |name=author |noicon=yes}}<
 
== Coordinates ==
 
Just to note that it would be nice to be able to set the coordinates to display both inline and in the title (passing "|display=inline,title" to {{tl|coord}}); this module just seems to allow inline coordinates. Thanks. [[User:Mike Peel|Mike Peel]] ([[User talk:Mike Peel|talk]]) 17:37, 18 December 2016 (UTC)
 
: {{reply to |Mike Peel|label=Mike}} I've implemented the 'display' parameter now. This is how it would work in {{q|Q592248}}:
:* <code><nowiki>{{#invoke:WikidataIB |getCoords |qid=Q592248 |name=coord |fetchwikidata=ALL}}</nowiki></code> → {{#invoke:WikidataIB |getCoords |qid=Q592248 |name=coord |fetchwikidata=ALL}}
: You should see 31°57′30″N 111°35′48″W in the title position of this page as well.
: You can't see multiple examples because the of title coordinates.
: If you want to test the "title" or "inline" values, change the above to
:* <code><nowiki>{{#invoke:WikidataIB |getCoords |qid=Q592248 |display=title |name=coord |fetchwikidata=ALL}}</nowiki></code>
:* <code><nowiki>{{#invoke:WikidataIB |getCoords |qid=Q592248 |display=inline |name=coord |fetchwikidata=ALL}}</nowiki></code>
: Of course, you don't need this so much now that the coord templates are Wikidata-aware, but it's useful if you want to implement the white/blacklists. --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 11:55, 16 January 2017 (UTC)
 
== Format Dates ==
Some test cases for the function formatDate. Call like <code><nowiki>{{#invoke:WikidataIB |formatDate | 1 August 30 BCE |bc=BCE |df=dmy}}</nowiki></code>
{| class="wikitable" style="width:24em;"
|+ Input date: 1 August 30 BCE, 12:39:56
|-
| no parameters || {{#invoke:WikidataIB |formatDate | 1 August 30 BCE, 12:39:56}}
|-
| bc=BC || {{#invoke:WikidataIB |formatDate | 1 August 30 BCE, 12:39:56 |bc=BC}}
|-
| bc=BCE || {{#invoke:WikidataIB |formatDate | 1 August 30 BCE, 12:39:56 |bc=BCE}}
|-
| bc=bc || {{#invoke:WikidataIB |formatDate | 1 August 30 BCE, 12:39:56 |bc=bc}}
|-
| bc=bce || {{#invoke:WikidataIB |formatDate | 1 August 30 BCE, 12:39:56 |bc=bce}}
|-
| bc=XYZ || {{#invoke:WikidataIB |formatDate | 1 August 30 BCE, 12:39:56 | bc=XYZ}}
|-
| df=dmy || {{#invoke:WikidataIB |formatDate | 1 August 30 BCE, 12:39:56 |df=dmy}}
|-
| df=DMY || {{#invoke:WikidataIB |formatDate | 1 August 30 BCE, 12:39:56 |df=DMY}}
|-
| df=mdy || {{#invoke:WikidataIB |formatDate | 1 August 30 BCE, 12:39:56 |df=mdy}}
|-
| df=MDY || {{#invoke:WikidataIB |formatDate | 1 August 30 BCE, 12:39:56 |df=MDY}}
|-
| df=ABC || {{#invoke:WikidataIB |formatDate | 1 August 30 BCE, 12:39:56 |df=ABC}}
|-
| df=y || {{#invoke:WikidataIB |formatDate | 1 August 30 BCE, 12:39:56 |df=y }}
|-
| bc=BCE df=dmy || {{#invoke:WikidataIB |formatDate | 1 August 30 BCE, 12:39:56 |bc=BCE |df=dmy}}
|-
| bc=BCE df=mdy || {{#invoke:WikidataIB |formatDate | 1 August 30 BCE, 12:39:56 |bc=BCE |df=dmy}}
|-
| bc=BCE df=y || {{#invoke:WikidataIB |formatDate | 1 August 30 BCE, 12:39:56 |bc=BCE |df=y}}
|-
| bc=BC df=dmy || {{#invoke:WikidataIB |formatDate | 1 August 30 BCE, 12:39:56 |bc=BC |df=dmy}}
|-
| bc=BC df=mdy || {{#invoke:WikidataIB |formatDate | 1 August 30 BCE, 12:39:56 |bc=BC |df=mdy}}
|-
| bc=BC df=y || {{#invoke:WikidataIB |formatDate | 1 August 30 BCE, 12:39:56 |bc=BC |df=y}}
|}
 
{| class="wikitable" style="width:24em;"
|+ Input date: 20 January 2017, 12:39:56
|-
| no parameters || {{#invoke:WikidataIB |formatDate | 20 January 2017, 12:39:56}}
|-
| bc=BC || {{#invoke:WikidataIB |formatDate | 20 January 2017, 12:39:56 |bc=BC}}
|-
| bc=BCE || {{#invoke:WikidataIB |formatDate | 20 January 2017, 12:39:56 |bc=BCE}}
|-
| bc=bc || {{#invoke:WikidataIB |formatDate | 20 January 2017, 12:39:56 |bc=bc}}
|-
| bc=bce || {{#invoke:WikidataIB |formatDate | 20 January 2017, 12:39:56 |bc=bce}}
|-
| bc=XYZ || {{#invoke:WikidataIB |formatDate | 20 January 2017, 12:39:56 | bc=XYZ}}
|-
| df=dmy || {{#invoke:WikidataIB |formatDate | 20 January 2017, 12:39:56 |df=dmy}}
|-
| df=DMY || {{#invoke:WikidataIB |formatDate | 20 January 2017, 12:39:56 |df=DMY}}
|-
| df=mdy || {{#invoke:WikidataIB |formatDate | 20 January 2017, 12:39:56 |df=mdy}}
|-
| df=MDY || {{#invoke:WikidataIB |formatDate | 20 January 2017, 12:39:56 |df=MDY}}
|-
| df=ABC || {{#invoke:WikidataIB |formatDate | 20 January 2017, 12:39:56 |df=ABC}}
|-
| df=y || {{#invoke:WikidataIB |formatDate | 20 January 2017, 12:39:56 |df=y }}
|-
| bc=BCE df=dmy || {{#invoke:WikidataIB |formatDate | 20 January 2017, 12:39:56 |bc=BCE |df=dmy}}
|-
| bc=BCE df=mdy || {{#invoke:WikidataIB |formatDate | 20 January 2017, 12:39:56 |bc=BCE |df=dmy}}
|-
| bc=BCE df=y || {{#invoke:WikidataIB |formatDate | 20 January 2017, 12:39:56 |bc=BCE |df=y}}
|-
| bc=BC df=dmy || {{#invoke:WikidataIB |formatDate | 20 January 2017, 12:39:56 |bc=BC |df=dmy}}
|-
| bc=BC df=mdy || {{#invoke:WikidataIB |formatDate | 20 January 2017, 12:39:56 |bc=BC |df=mdy}}
|-
| bc=BC df=y || {{#invoke:WikidataIB |formatDate | 20 January 2017, 12:39:56 |bc=BC |df=y}}
|}
 
Some test cases for the function formatDate. Call like <code><nowiki>{{#invoke:WikidataIB/sandbox |formatDate | 1 August 30 BCE |bc=BCE |df=dmy}}</nowiki></code>
{| class="wikitable" style="width:24em;"
|+ Input date: 1 August 30 BCE, 12:39:56
|-
| no parameters || {{#invoke:WikidataIB/sandbox |formatDate | 1 August 30 BCE, 12:39:56}}
|-
| bc=BC || {{#invoke:WikidataIB/sandbox |formatDate | 1 August 30 BCE, 12:39:56 |bc=BC}}
|-
| bc=BCE || {{#invoke:WikidataIB/sandbox |formatDate | 1 August 30 BCE, 12:39:56 |bc=BCE}}
|-
| bc=bc || {{#invoke:WikidataIB/sandbox |formatDate | 1 August 30 BCE, 12:39:56 |bc=bc}}
|-
| bc=bce || {{#invoke:WikidataIB/sandbox |formatDate | 1 August 30 BCE, 12:39:56 |bc=bce}}
|-
| bc=XYZ || {{#invoke:WikidataIB/sandbox |formatDate | 1 August 30 BCE, 12:39:56 | bc=XYZ}}
|-
| df=dmy || {{#invoke:WikidataIB/sandbox |formatDate | 1 August 30 BCE, 12:39:56 |df=dmy}}
|-
| df=DMY || {{#invoke:WikidataIB/sandbox |formatDate | 1 August 30 BCE, 12:39:56 |df=DMY}}
|-
| df=mdy || {{#invoke:WikidataIB/sandbox |formatDate | 1 August 30 BCE, 12:39:56 |df=mdy}}
|-
| df=MDY || {{#invoke:WikidataIB/sandbox |formatDate | 1 August 30 BCE, 12:39:56 |df=MDY}}
|-
| df=ABC || {{#invoke:WikidataIB/sandbox |formatDate | 1 August 30 BCE, 12:39:56 |df=ABC}}
|-
| df=y || {{#invoke:WikidataIB/sandbox |formatDate | 1 August 30 BCE, 12:39:56 |df=y }}
|-
| bc=BCE df=dmy || {{#invoke:WikidataIB/sandbox |formatDate | 1 August 30 BCE, 12:39:56 |bc=BCE |df=dmy}}
|-
| bc=BCE df=mdy || {{#invoke:WikidataIB/sandbox |formatDate | 1 August 30 BCE, 12:39:56 |bc=BCE |df=dmy}}
|-
| bc=BCE df=y || {{#invoke:WikidataIB/sandbox |formatDate | 1 August 30 BCE, 12:39:56 |bc=BCE |df=y}}
|-
| bc=BC df=dmy || {{#invoke:WikidataIB/sandbox |formatDate | 1 August 30 BCE, 12:39:56 |bc=BC |df=dmy}}
|-
| bc=BC df=mdy || {{#invoke:WikidataIB/sandbox |formatDate | 1 August 30 BCE, 12:39:56 |bc=BC |df=mdy}}
|-
| bc=BC df=y || {{#invoke:WikidataIB/sandbox |formatDate | 1 August 30 BCE, 12:39:56 |bc=BC |df=y}}
|}
 
{| class="wikitable" style="width:24em;"
|+ Input date: 20 January 2017, 12:39:56
|-
| no parameters || {{#invoke:WikidataIB/sandbox |formatDate | 20 January 2017, 12:39:56}}
|-
| bc=BC || {{#invoke:WikidataIB/sandbox |formatDate | 20 January 2017, 12:39:56 |bc=BC}}
|-
| bc=BCE || {{#invoke:WikidataIB/sandbox |formatDate | 20 January 2017, 12:39:56 |bc=BCE}}
|-
| bc=bc || {{#invoke:WikidataIB/sandbox |formatDate | 20 January 2017, 12:39:56 |bc=bc}}
|-
| bc=bce || {{#invoke:WikidataIB/sandbox |formatDate | 20 January 2017, 12:39:56 |bc=bce}}
|-
| bc=XYZ || {{#invoke:WikidataIB/sandbox |formatDate | 20 January 2017, 12:39:56 | bc=XYZ}}
|-
| df=dmy || {{#invoke:WikidataIB/sandbox |formatDate | 20 January 2017, 12:39:56 |df=dmy}}
|-
| df=DMY || {{#invoke:WikidataIB/sandbox |formatDate | 20 January 2017, 12:39:56 |df=DMY}}
|-
| df=mdy || {{#invoke:WikidataIB/sandbox |formatDate | 20 January 2017, 12:39:56 |df=mdy}}
|-
| df=MDY || {{#invoke:WikidataIB/sandbox |formatDate | 20 January 2017, 12:39:56 |df=MDY}}
|-
| df=ABC || {{#invoke:WikidataIB/sandbox |formatDate | 20 January 2017, 12:39:56 |df=ABC}}
|-
| df=y || {{#invoke:WikidataIB/sandbox |formatDate | 20 January 2017, 12:39:56 |df=y }}
|-
| bc=BCE df=dmy || {{#invoke:WikidataIB/sandbox |formatDate | 20 January 2017, 12:39:56 |bc=BCE |df=dmy}}
|-
| bc=BCE df=mdy || {{#invoke:WikidataIB/sandbox |formatDate | 20 January 2017, 12:39:56 |bc=BCE |df=dmy}}
|-
| bc=BCE df=y || {{#invoke:WikidataIB/sandbox |formatDate | 20 January 2017, 12:39:56 |bc=BCE |df=y}}
|-
| bc=BC df=dmy || {{#invoke:WikidataIB/sandbox |formatDate | 20 January 2017, 12:39:56 |bc=BC |df=dmy}}
|-
| bc=BC df=mdy || {{#invoke:WikidataIB/sandbox |formatDate | 20 January 2017, 12:39:56 |bc=BC |df=mdy}}
|-
| bc=BC df=y || {{#invoke:WikidataIB/sandbox |formatDate | 20 January 2017, 12:39:56 |bc=BC |df=y}}
|}
 
=== Calls to getValue for dates ===
Some calls to getValue that return dates:
* In {{q|Q357585}}: <code><nowiki>{{#invoke:WikidataIB |getValue |qid=Q357585 |P569 |fetchwikidata=ALL}}</nowiki></code> -> {{#invoke:WikidataIB |getValue |qid=Q357585 |P569 |fetchwikidata=ALL}}
* In {{q|Q51673}}: <code><nowiki>{{#invoke:WikidataIB |getValue |qid=Q51673 |P569 |fetchwikidata=ALL}}</nowiki></code> -> {{#invoke:WikidataIB |getValue |qid=Q51673 |P569 |fetchwikidata=ALL}}
* In {{q|Q51673}}: <code><nowiki>{{#invoke:WikidataIB |getValue |qid=Q51673 |P569 |fetchwikidata=ALL |bc=BC}}</nowiki></code> -> {{#invoke:WikidataIB |getValue |qid=Q51673 |P569 |fetchwikidata=ALL |bc=BC}}
* In {{q|Q51673}}: <code><nowiki>{{#invoke:WikidataIB |getValue |qid=Q51673 |P569 |fetchwikidata=ALL |df=mdy}}</nowiki></code> -> {{#invoke:WikidataIB |getValue |qid=Q51673 |P569 |fetchwikidata=ALL |df=mdy}}
* In {{q|Q51673}}: <code><nowiki>{{#invoke:WikidataIB |getValue |qid=Q51673 |P569 |fetchwikidata=ALL |df=y}}</nowiki></code> -> {{#invoke:WikidataIB |getValue |qid=Q51673 |P569 |fetchwikidata=ALL |df=y}}
* In {{q|Q151973}}: <code><nowiki>{{#invoke:WikidataIB |getValue |qid=Q151973 |P569 |fetchwikidata=ALL}}</nowiki></code> -> {{#invoke:WikidataIB |getValue |qid=Q151973 |P569 |fetchwikidata=ALL}}
* In {{q|Q151973}}: <code><nowiki>{{#invoke:WikidataIB |getValue |qid=Q151973 |P569 |fetchwikidata=ALL |bc=BC}}</nowiki></code> -> {{#invoke:WikidataIB |getValue |qid=Q151973 |P569 |fetchwikidata=ALL |bc=BC}}
* In {{q|Q151973}}: <code><nowiki>{{#invoke:WikidataIB |getValue |qid=Q151973 |P569 |fetchwikidata=ALL |df=mdy}}</nowiki></code> -> {{#invoke:WikidataIB |getValue |qid=Q151973 |P569 |fetchwikidata=ALL |df=mdy}}
* In {{q|Q151973}}: <code><nowiki>{{#invoke:WikidataIB |getValue |qid=Q151973 |P569 |fetchwikidata=ALL |df=y}}</nowiki></code> -> {{#invoke:WikidataIB |getValue |qid=Q151973 |P569 |fetchwikidata=ALL |df=y}}
 
== Can't get this working ==
 
{{Wikidata property|P176}}
About [[:en:Prussian P 10]], item: {{Q|Q882458}}. It has P176=Borsig (Company). So Wikidata seems OK.
 
In this case I test:
-<nowiki>{{#invoke:WikidataIB|getValue|qid=Q882458|P176}}</nowiki>-
Returns empty string: -{{#invoke:WikidataIB|getValue|qid=Q882458|P176}}-
 
Also, when previewing in article page itself (no {{para|qid}} used), it returns a blank. Am I missing something? -[[User:DePiep|DePiep]] ([[User talk:DePiep|talk]]) 17:32, 15 January 2017 (UTC)
 
: {{reply to |DePiep}} Remember that this is designed for use in an infobox, therefore there are extra parameters that have to be enabled otherwise it won't return anything. The call matches the name of the field you're using it in with a list of fields that are to enabled ("whitelisted"). What you call the field doesn't matter as long as it's on the whitelist. So you can use:
:* <code><nowiki>{{#invoke:WikidataIB |getValue |qid=Q882458 |P176 |name=def |fetchwikidata=abd, def, ghi, jkl, etc}}</nowiki></code> → {{#invoke:WikidataIB |getValue |qid=Q882458 |P176 |name=def |fetchwikidata=abd, def, ghi, jkl, etc}}
: And it will return {{Q|P176}} for {{Q|Q882458}}. I'll miss out the qid in the first part of the following examples as you won't need it other than for testing on pages like this.
: Rather than having to list every fieldname on the whitelist, you can use "ALL". So the call you probably want is something like:
:* <code><nowiki>{{#invoke:WikidataIB |getValue |P176 |name=manufacturer |fetchwikidata=ALL}}</nowiki></code> → {{#invoke:WikidataIB |getValue |qid=Q882458 |P176 |name=manufacturer |fetchwikidata=ALL}}
: Although if you're designing an infobox, you'll probably want to pass the whitelist (and blacklist) as parameters so the article editor supplies them once and the infobox passes them to each call in the design. Lets say we give them the names {{para|whitelist}} and {{para|blacklist}}. Then the code in the infobox design for the 'Manufacturer' field would be:
:* <code><nowiki>{{#invoke:WikidataIB |getValue |P176 |name=manufacturer |fetchwikidata={{{whitelist|}}} |suppressfields={{{blacklist|}}} |{{{manufacturer|}}} }}</nowiki></code>
: The second unnamed parameter allows a local parameter (called 'manufacturer' in this case) to override the Wikidata call as ususal.
: The infobox in use in an article could look something as simple as:
<pre style="margin-left:1.7em; line-height:1.2em;">
{{infobox something
| whitelist = ALL
}}
</pre>
: Does that make sense? Let me know if you're still having problems. Cheers --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 02:03, 16 January 2017 (UTC)
::Thanks, will process this. Could this be in the documentation? Sort of basic "required parameters" list? To me, the description & examples there are already quite abstract (into high end usage). Quite an object that requires studying. -[[User:DePiep|DePiep]] ([[User talk:DePiep|talk]]) 09:16, 16 January 2017 (UTC)
 
This is necessary in order to comply with [[Wikipedia:Wikidata/2018 Infobox RfC | this RFC]] and [[Wikipedia:Wikidata#Appropriate_usage_in_articles|this list of RFCs]] which make it mandatory to use {{tl|Wdib}} with {{para|osd|true}} in infoboxes.
== Date handling ==
 
An example requirement is {{para|mla}} of {{tl|Infobox Indian Constituency (wd)}}. [[User Talk:Riteze|<span style="color:green;">Riteze</span>]] 08:19, 4 March 2025 (UTC)
If more extensive date handling is ever needed, consider [[Module:Date]] which can parse dates in various formats, including a Wikidata date, and perform date arithmetic. However, the module is limited to four-digit years. The template {{tl|extract}} can be used for quick tests although it does not expose options to choose the BC/BCE format.
*<code><nowiki>{{extract|+2016-06-21T14:30:00Z}}</nowiki></code> → {{extract|+2016-06-21T14:30:00Z}}
*<code><nowiki>{{extract|+2016-06-21T14:30:00Z|show=ymd}}</nowiki></code> → {{extract|+2016-06-21T14:30:00Z|show=ymd}}
[[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 23:41, 20 January 2017 (UTC)
:
: Thanks {{u|Johnuniq|John}}. I think I had most of that functionality, as well as the BC/BCE and dmy/mdy/y functionality in [[Module:Wikidata]] in the getDateValue function, which dealt with any date BC or AD - I needed that for dob of notable Romans, etc. although the code was hard to read because I was using the timestamp and manipulating that directly. For greater flexibility in this module, I decided to use the mw.wikibase.formatPropertyValues() function – which always returns dmy format dates with BCE as appropriate – because that can be used on properties that are qualifiers as well. I'll need that later as fewer properties are defined and more values are stored as properties of qualifiers (like property:creator - qualifier:has role - item:video game artist instead of property:video game artist). Things like marriages have start-date and end-date that are in qualifiers. Anyway, I think I've managed to create a local function that takes the date in dmy+BCE format and outputs it in whatever format is wanted for use in article infoboxes. I've put a wrapper around it so that it's exported and can be invoked. --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 04:00, 21 January 2017 (UTC)
::Good, and I'm sure Wikidata has many quirks which require dedicated code. I just wanted to say that if more stuff such as date differences or adding time deltas were ever needed, Module:Date is available. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 05:59, 21 January 2017 (UTC)
 
== Bugopen inand fetchingclose referencedquotation datamark ==
 
Many of [[Quotation mark]]s have opening and closing, so both open and close quotation mark should be able to specified in [[Module:WikidataIB/titleformats|/titleformats]]. [[User:FlatLanguage|FlatLanguage]] ([[User talk:FlatLanguage|talk]]) 18:54, 26 March 2025 (UTC)
At [[Edward Bergh]] I added a second date at [[d:Q5572078]] with year-only accuracy, as that's what I can easily find a reference for atm. Now that there's a reference, it displays the date in the infobox. However, it fetches the *unreferenced* date (with day-accuracy) rather than the referenced one (with year-accuracy). Not a big deal, since [https://www.wikidata.org/w/index.php?title=Q5572078&diff=437849800&oldid=437848585 changing the rank] causes the correct one to show, but this is probably an edge-case that should be fixed ({{ping|RexxS|p=}}). Thanks. [[User:Mike Peel|Mike Peel]] ([[User talk:Mike Peel|talk]]) 16:35, 28 January 2017 (UTC)
:Please see [[MOS:CURLY]]. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 01:57, 27 March 2025 (UTC)
: (Note: I've found a ref for the day-accuracy one, so I've now removed the year-accuracy one from the entry, but this can be found in the history. Thanks. [[User:Mike Peel|Mike Peel]] ([[User talk:Mike Peel|talk]]) 16:39, 28 January 2017 (UTC)
::/titleformats is for i18n, so projects other than enwiki should be considered. --[[User:FlatLanguage|FlatLanguage]] ([[User talk:FlatLanguage|talk]]) 01:59, 27 March 2025 (UTC)