Module talk:WikidataIB: Difference between revisions

Content deleted Content added
Possible bug: new section
Tags: Mobile edit Mobile web edit New topic
m Archiving 1 discussion(s) to Module talk:WikidataIB/Archive 8) (bot
Line 12:
{{oldtfdfull|date= 2020 September 15 |result=keep |disc=Module:Wikidata Infobox}}
{{archives|search=yes}}
 
== Using "unknown value" in queries ==
 
Is there any way to query items with "[[wikidata:Help:Statements#Unknown_or_no_values|unknown value]]" in their statemennts?
 
For example:
<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)
 
== Pulling structured data from Commons ==