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 only show year of a numeric value?
How can I only show the year of a numeric value, for example the year for the population size of a city? Now I used the following advanced string manipulation to remove the value, which makes the script slow - it gives the error message "The time allocated for running scripts has expired" if the script is included a large number of times in the same Wikipedia page:
{{#invoke:Ustring|gsub|{{#invoke:WikidataIB |getValue |P1082 |qid=... |fwd=ALL |rank=best |osd=no |qual=P585|qdf=y|noicon=TRUE|list=p-1}}|^[%d,± ]* %((%d%d%d%d)%)|%1}}
Tomastvivlaren (talk) 00:06, 11 March 2022 (UTC)
sorted=true: by what?
I understand that |sorted=true
sorts the returned values, but I cannot see by what ordering. Eg, for quassin (Q2079986), found in taxon (P703):
- sorted=false: Picrasma crenata, Picrasma javanica, Picrasma quassioides, Quassia africana, Quassia amara, Samadera indica
dflt
- sorted= true: Quassia africana, Picrasma crenata, Picrasma javanica, Picrasma quassioides, Quassia amara, Samadera indica
- sorted=false: Picrasma crenata, Picrasma javanica, Picrasma quassioides, Quassia africana, Quassia amara, Samadera indica
- So, true-results have unexpected order IMO. (Incidentally, the itempage has/shows alphabetical order).
DePiep (talk) 13:26, 26 September 2022 (UTC)
- Does it have to do with wikilinked/unlinked? If so, by some rationale or because of code like "[[..."? DePiep (talk) 13:28, 26 September 2022 (UTC)
- @DePiep From the doc page/comments:
It's only a very dumb alphabetical sort and sorts linked values as "[[ ..."
. So a literal alphabetical sort that doesn't break up links to sort by label. That seems to match your example as well. -- ferret (talk) 13:30, 26 September 2022 (UTC)- Thanks; makes me feel good having the question right ;-)
- Consider answered. DePiep (talk) 13:38, 26 September 2022 (UTC)
- @DePiep From the doc page/comments:
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)
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. -- ferret (talk) 14:20, 3 October 2022 (UTC)