Module talk:WikidataIB
![]() | Module:WikidataIB is permanently protected from editing because it is a heavily used or highly visible module. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit.
|
|
![]() | This module was considered for deletion on 2020 September 15. The result of the discussion was "keep". |
|
||||||||
This page has archives. Sections older than 60 days may be automatically archived by Lowercase sigmabot III when more than 3 sections are present. |
How to add references
Is there a way to show references? {{wikidata}} has this nice option:
{{wikidata|properties|linked|references|normal+|Q18216|P703}}
- → liquorice,[1] Ixora coccinea[2]
But afaik it is less controllable. Some live examples in infoboxes? -DePiep (talk) 14:48, 26 September 2022 (UTC)
References
- ^ L A Mitscher; Y H Park; D Clark; J L Beal (March 1980). "Antimicrobial agents from higher plants. Antimicrobial isoflavanoids and related substances from Glycyrrhiza glabra L. var. typica". Journal of Natural Products. 43 (2): 259–269. doi:10.1021/NP50008A004. ISSN 0163-3864. PMID 7381508. Wikidata Q71214999.
- ^ Chia-Lin Lee; Yung-Chih Liao; Tsong-Long Hwang; Chin-Chung Wu; Fang-Rong Chang; Yang-Chang Wu (December 2010). "Ixorapeptide I and ixorapeptide II, bioactive peptides isolated from Ixora coccinea". Bioorganic & Medicinal Chemistry Letters. 20 (24): 7354–7357. doi:10.1016/J.BMCL.2010.10.058. ISSN 0960-894X. PMID 21106454. Wikidata Q39627968.
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. — Martin (MSGJ · talk) 15:11, 26 September 2022 (UTC)
- Ouch. This hurts... Thx. DePiep (talk) 18:57, 26 September 2022 (UTC)
- Oh, thank you for opening this discussion @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 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. DePiep (talk) 08:50, 7 October 2022 (UTC)
getWebsite error
I think there is an error in the getWebsite function. If there is no wikidata item corresponding to the current page then it will not even display the locally defined parameter. That prevents it being tested properly on talk pages and testcases.
{{#invoke:WikidataIB|getWebsite|url=www.google.com}}
currently produces: [www.google.com www
— Martin (MSGJ · talk) 06:36, 3 October 2022 (UTC)
- @MSGJ
Which infobox? This may be a template-level issue.Nevermind I'm dumb, I missed your example because it's literally blank :) Taking a glance... -- ferret (talk) 14:20, 3 October 2022 (UTC) - @MSGJ The culprit is the line
if not qid then return nil end
. If the page has no qid, the function ends early. I think this should probably be something likeif not qid and not url then return nil end
. That should allow it to continue if a locally defined url is set. -- ferret (talk) 14:29, 3 October 2022 (UTC)- Yes I agree. Was just checking in case I'd missed something silly. This function is not really documented. — Martin (MSGJ · talk) 15:41, 3 October 2022 (UTC)
- I've got some code which seems to work in Module:WikidataIB/sandbox — Martin (MSGJ · talk) 14:35, 4 October 2022 (UTC)
- Deployed — Martin (MSGJ · talk) 16:10, 6 October 2022 (UTC)
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)
- @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)
- 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)
- @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)- If using Module:Wd is an option, please use
{{wikidata|qualifier|raw|Q104417487|P4032|_|P585}}
instead. LennardHofmann (talk) 09:51, 4 November 2022 (UTC)- @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)
- If using Module:Wd is an option, please use
- @Evolution and evolvability: If you absolutely need to query for unknown values, use
- That's becaues the current v:Template:Review_info template uses the query:
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)