Module talk:WikidataIB: Difference between revisions

Content deleted Content added
 
(27 intermediate revisions by 10 users not shown)
Line 1:
{{Permanently protected}}
{{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}}
Line 10 ⟶ 17:
|archive = Module talk:WikidataIB/Archive %(counter)d
}}
{{oldtfdfull|date= 2020 September 15 |result=keep |disc=Module:Wikidata Infobox}}
{{archives|search=yes}}
 
== How to add references ==
 
Is there a way to show references? {{tl|wikidata}} has this nice option:
:<code><nowiki>{{wikidata|properties|linked|references|normal+|Q18216|P703}}</nowiki></code>
:&rarr; {{wikidata|properties|linked|references|normal+|Q18216|P703}}
But afaik it is less controllable. Some live examples in infoboxes? -[[User:DePiep|DePiep]] ([[User talk:DePiep|talk]]) 14:48, 26 September 2022 (UTC)
{{reflist-talk}} [[User:DePiep|DePiep]] ([[User talk:DePiep|talk]]) 14:48, 26 September 2022 (UTC)
 
:As far as I know, this module was never designed to produce references. It would be nice to produce well formatted references. I think it will be quite challenging to match an existing citation style on an article. &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 15:11, 26 September 2022 (UTC)
::Ouch. This hurts... Thx. [[User:DePiep|DePiep]] ([[User talk:DePiep|talk]]) 18:57, 26 September 2022 (UTC)
:Oh, thank you for opening this discussion @[[User:DePiep|DePiep]]!
:In case we manage to combine both, I opened the mirror version here:
:https://en.wikipedia.org/wiki/Module_talk:Wd#Add_a_'maxvals'_option_as_in_https://en.wikipedia.org/wiki/Module:WikidataIB [[User:AdrianoRutz|AdrianoRutz]] ([[User talk:AdrianoRutz|talk]]) 08:43, 7 October 2022 (UTC)
::OK, thx. Other issues in here: reference formatting (& omitting when maxval is used). Bottleneck in moving fwd is time here; sub-ideal solutions in mind. [[User:DePiep|DePiep]] ([[User talk:DePiep|talk]]) 08:50, 7 October 2022 (UTC)
 
==Multiple qualifiers==
== Using "unknown value" in queries ==
Is there a way to usefilter anya value,property likewith inmany modulevalues Wdby two or more qualifiers? [[User:PonorSerresmap|PonorSerresmap]] ([[User talk:PonorSerresmap|talk]]) 18:00:18, 210 JuneApril 20232024 (UTC)
 
:@[[User:Serresmap|Serresmap]]::If I don't think so. I recommend using [[Module:Wd]] is an optioninstead, please usee.g. <code><nowiki>{{wikidata#invoke:wd|qualifierproperties|rawQ55|Q104417487P7295|P4032P518=Q762943|_|P585P1365=Q11184}}</nowiki></code> instead. [[User:LennardHofmann|LennardHofmann]] ([[User talk:LennardHofmann|talk]]) 0912:5155, 412 NovemberApril 20222024 (UTC)
Is there any way to query items with "[[wikidata:Help:Statements#Unknown_or_no_values|unknown value]]" in their statemennts?
 
==Option to get 'raw value'==
For example:
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{{!}}...}}}}.
<pre>{{#invoke:WikidataIB |getQualifierValue |qid=Q104417487 |P4032 |pval="Unknown"|qual=P585 |name=xyz |fetchwikidata=ALL |onlysourced=no |noicon=true |df=YMD}}
</pre>
Should return the date "29 October 2022" from the item [[wikidata:Q104417487]]. [[User:Evolution and evolvability|T.Shafee(Evo<small>&#38;</small>Evo)]]<sup>[[User talk:Evolution and evolvability|talk]]</sup> 11:36, 2 November 2022 (UTC)
: {{re|User:Evolution and evolvability}} I recall last night that if I entered "anonymous"[https://www.wikidata.org/w/index.php?title=Q104417487&diff=prev&oldid=1762383730] as the author name, the "add this statement to wikidata" button disappears. [[User:OhanaUnited|<b style="color: #0000FF;">OhanaUnited</b>]][[User talk:OhanaUnited|<b style="color: green;"><sup>Talk page</sup></b>]] 13:39, 2 November 2022 (UTC)
::That's becaues the current [[v:Template:Review_info]] template uses the query:
:::<code><nowiki>{{#invoke:WikidataIB |getQualifierValue |qid=Q104417487 |P4032 |pval=</nowiki>'''Q4233718'''<nowiki>|qual=P585 |name=xyz |fetchwikidata=ALL |onlysourced=no |noicon=true |df=YMD}}</nowiki></code>
::What I'm hoping to do is change it over to:
:::<code><nowiki>{{#invoke:WikidataIB |getQualifierValue |qid=Q104417487 |P4032 |pval=</nowiki>'''"Unknown"'''<nowiki>|qual=P585 |name=xyz |fetchwikidata=ALL |onlysourced=no |noicon=true |df=YMD}}</nowiki></code>
::so that the "''unknown value''" special value can be used on the wikidata items, because that's where the community seems to be moving for indicating statements about anonymous peer reviewers.
::The module seems to have some ability to understand "''unknown value''" statements because this query:
:::<code><nowiki>{{#invoke:WikidataIB |getValue |qid=Q104417487 |P4032 |name=xyz |fetchwikidata=ALL |onlysourced=no |noicon=true }}</nowiki></code>
::returns:
:::<code>{{#invoke:WikidataIB |getValue |qid=Q104417487 |P4032 |name=xyz |fetchwikidata=ALL |onlysourced=no |noicon=true }}</code>
::It just needs to be extended from the getValue function to the getQualifierValue function. [[User:Evolution and evolvability|T.Shafee(Evo<small>&#38;</small>Evo)]]<sup>[[User talk:Evolution and evolvability|talk]]</sup> 02:46, 3 November 2022 (UTC)
:::@[[User:Evolution and evolvability|Evolution and evolvability]]: If you absolutely need to query for unknown values, use <code><nowiki>{{#invoke:WikidataIB</nowiki>'''/sandbox'''<nowiki> |getQualifierValue |qid=Q104417487 |P4032 |pval=</nowiki>'''Unknown'''<nowiki>|qual=P585 |name=xyz |fetchwikidata=ALL |onlysourced=no |noicon=true |df=YMD}}</nowiki></code> [[User:LennardHofmann|LennardHofmann]] ([[User talk:LennardHofmann|talk]]) 09:45, 4 November 2022 (UTC)
::::If using [[Module:Wd]] is an option, please use <code><nowiki>{{wikidata|qualifier|raw|Q104417487|P4032|_|P585}}</nowiki></code> instead. [[User:LennardHofmann|LennardHofmann]] ([[User talk:LennardHofmann|talk]]) 09:51, 4 November 2022 (UTC)
:::::@[[User:LennardHofmann|LennardHofmann]] - oh good idea! I always forget about that module (tbh, I'm still a little hazy on the main differences between it and this one). Anyway, the template [[v:Template:Review_info]] now works again to first to detect whether a wikidata item has an anon peer reviewer (P4032="unknown value") and if not, adds one via quickstatements. [[User:Evolution and evolvability|T.Shafee(Evo<small>&#38;</small>Evo)]]<sup>[[User talk:Evolution and evolvability|talk]]</sup> 05:40, 11 November 2022 (UTC)
 
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}}.
== Pulling structured data from Commons ==
 
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.
Is there an equivalent to this module to retrieve structured data from a file on wikimedia commons? E.g. [[c:File:Inhibition_mechanism_(irreversible).svg|this file]] should have P275 = Q20007257. Any ideas? [[User:Evolution and evolvability|T.Shafee(Evo<small>&#38;</small>Evo)]]<sup>[[User talk:Evolution and evolvability|talk]]</sup> 06:29, 10 March 2023 (UTC)
 
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)
== value instead of Qid in qvalue ==
 
== open and close quotation mark ==
With module [[:Module:Wd|Wd]] it's possible to do this (for ''total revenue'' in [[:d:Q30288051]]):
*<nowiki>{{#invoke:Wd|property|eid=Q30288051|P2139|P585=2017}}</nowiki> → {{#invoke:Wd|property|eid=Q30288051|P2139|P585=2017}}
but module WikidataIB only takes qualifier ID for qvalue so the following does not work
*<nowiki>{{#invoke:WikidataIB |getValueByQual |qid=Q30288051 |P2139 |qualID=P585 |qvalue=2017}}</nowiki> → {{#invoke:WikidataIB |getValueByQual |qid=Q30288051 |P2139 |qualID=P585 |qvalue=2017}}
Is there a way to use any value, like in module Wd? [[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 18:00, 2 June 2023 (UTC)
 
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)
:@[[User:Ponor|Ponor]]: There is a comment in the code that says "We'll only deal with wikibase-items and strings for now". Checking whether a given date string (e.g. "2017") matches a [https://doc.wikimedia.org/Wikibase/master/php/docs_topics_json.html#json_datavalues_time Wikidata time value] is non-trivial, so I don't expect that getValueByQual will support the <code>time</code> datatype any time soon. [[User:LennardHofmann|LennardHofmann]] ([[User talk:LennardHofmann|talk]]) 18:59, 2 June 2023 (UTC)
::Ouch.Please Thissee hurts..[[MOS:CURLY]]. Thx. [[User:DePiepJonesey95|DePiepJonesey95]] ([[User talk:DePiepJonesey95|talk]]) 1801:57, 2627 SeptemberMarch 20222025 (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)