Jump to content

Module talk:WikidataIB

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Janhrach (talk | contribs) at 08:20, 8 July 2023 (Possible bug: new section). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Using "unknown value" in queries

Is there any way to query items with "unknown value" in their statemennts?

For example:

{{#invoke:WikidataIB |getQualifierValue |qid=Q104417487 |P4032 |pval="Unknown"|qual=P585 |name=xyz |fetchwikidata=ALL |onlysourced=no |noicon=true |df=YMD}}

Should return the date "29 October 2022" from the item wikidata:Q104417487. T.Shafee(Evo&Evo)talk 11:36, 2 November 2022 (UTC)[reply]

@Evolution and evolvability: I recall last night that if I entered "anonymous"[1] as the author name, the "add this statement to wikidata" button disappears. OhanaUnitedTalk page 13:39, 2 November 2022 (UTC)[reply]
That's becaues the current v:Template:Review_info template uses the query:
{{#invoke:WikidataIB |getQualifierValue |qid=Q104417487 |P4032 |pval=Q4233718|qual=P585 |name=xyz |fetchwikidata=ALL |onlysourced=no |noicon=true |df=YMD}}
What I'm hoping to do is change it over to:
{{#invoke:WikidataIB |getQualifierValue |qid=Q104417487 |P4032 |pval="Unknown"|qual=P585 |name=xyz |fetchwikidata=ALL |onlysourced=no |noicon=true |df=YMD}}
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:
{{#invoke:WikidataIB |getValue |qid=Q104417487 |P4032 |name=xyz |fetchwikidata=ALL |onlysourced=no |noicon=true }}
returns:
Ken Winters, Unknown
It just needs to be extended from the getValue function to the getQualifierValue function. T.Shafee(Evo&Evo)talk 02:46, 3 November 2022 (UTC)[reply]
@Evolution and evolvability: If you absolutely need to query for unknown values, use {{#invoke:WikidataIB/sandbox |getQualifierValue |qid=Q104417487 |P4032 |pval=Unknown|qual=P585 |name=xyz |fetchwikidata=ALL |onlysourced=no |noicon=true |df=YMD}} LennardHofmann (talk) 09:45, 4 November 2022 (UTC)[reply]
If using Module:Wd is an option, please use {{wikidata|qualifier|raw|Q104417487|P4032|_|P585}} instead. LennardHofmann (talk) 09:51, 4 November 2022 (UTC)[reply]
@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. T.Shafee(Evo&Evo)talk 05:40, 11 November 2022 (UTC)[reply]

Pulling structured data from Commons

Is there an equivalent to this module to retrieve structured data from a file on wikimedia commons? E.g. this file should have P275 = Q20007257. Any ideas? T.Shafee(Evo&Evo)talk 06:29, 10 March 2023 (UTC)[reply]

value instead of Qid in qvalue

With module Wd it's possible to do this (for total revenue in d:Q30288051):

  • {{#invoke:Wd|property|eid=Q30288051|P2139|P585=2017}} → 1,993,978 United States dollar

but module WikidataIB only takes qualifier ID for qvalue so the following does not work

  • {{#invoke:WikidataIB |getValueByQual |qid=Q30288051 |P2139 |qualID=P585 |qvalue=2017}} →

Is there a way to use any value, like in module Wd? Ponor (talk) 18:00, 2 June 2023 (UTC)[reply]

@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 Wikidata time value is non-trivial, so I don't expect that getValueByQual will support the time datatype any time soon. LennardHofmann (talk) 18:59, 2 June 2023 (UTC)[reply]

Possible bug

I think {{wdib|P38|qid=Q30|sn=true|noicon=true|osd=no|fwd=ALL}} should output "US dollar", not "United States dollar" (as it does now), because sn=true was given. Is it a bug? Janhrach (talk) 08:20, 8 July 2023 (UTC)[reply]