Module talk:WikidataIB: Difference between revisions

Content deleted Content added
 
(36 intermediate revisions by 12 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}}
 
== sorted=true: by what? ==
 
I understand that {{para|sorted|true}} sorts the returned values, but I cannot see by what ordering. Eg, for {{Q|Q2079986}}, {{Property|P703}}:
::sorted=false: {{#invoke:WikidataIB |getValue |P703 |qid=Q2079986|fwd=ALL|sorted=false }} dflt
::sorted= true: {{#invoke:WikidataIB |getValue |P703 |qid=Q2079986|fwd=ALL|sorted=true }}
:So, true-results have unexpected order IMO. (Incidentally, the itempage has/shows alphabetical order).
[[User:DePiep|DePiep]] ([[User talk: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 "<nowiki>[[...</nowiki>"? [[User:DePiep|DePiep]] ([[User talk:DePiep|talk]]) 13:28, 26 September 2022 (UTC)
::@[[User:DePiep|DePiep]] From the doc page/comments: {{tq|It's only a very dumb alphabetical sort and sorts linked values as "<nowiki>[[</nowiki> ..."}}. So a literal alphabetical sort that doesn't break up links to sort by label. That seems to match your example as well. -- [[User:Ferret|ferret]] ([[User_talk:Ferret|talk]]) 13:30, 26 September 2022 (UTC)
:::Thanks; makes me feel good having the question right ;-)
:::Consider answered. [[User:DePiep|DePiep]] ([[User talk:DePiep|talk]]) 13:38, 26 September 2022 (UTC)
 
== 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==
== getWebsite error ==
Is there a way to filter a property with many values by two or more qualifiers? [[User:Serresmap|Serresmap]] ([[User talk:Serresmap|talk]]) 00:18, 10 April 2024 (UTC)
 
:@[[User:Serresmap|Serresmap]]: I don't think so. I recommend using [[Module:Wd]] instead, e.g. <code><nowiki>{{#invoke:wd|properties|Q55|P7295|P518=Q762943|P1365=Q11184}}</nowiki></code>. [[User:LennardHofmann|LennardHofmann]] ([[User talk:LennardHofmann|talk]]) 12:55, 12 April 2024 (UTC)
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.
 
==Option to get 'raw value'==
<pre>{{#invoke:WikidataIB|getWebsite|url=www.google.com}}</pre>
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{{!}}...}}}}.
currently produces: {{#invoke:WikidataIB|getWebsite|url=www.google.com}}
 
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}}.
&mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 06:36, 3 October 2022 (UTC)
 
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.
:@[[User:MSGJ|MSGJ]] <s>Which infobox? This may be a template-level issue.</s> Nevermind I'm dumb, I missed your example because it's literally blank :) Taking a glance... -- [[User:Ferret|ferret]] ([[User_talk:Ferret|talk]]) 14:20, 3 October 2022 (UTC)
:@[[User:MSGJ|MSGJ]] The culprit is the line {{tq|if not qid then return nil end}}. If the page has no qid, the function ends early. I think this should probably be something like {{tq|if not qid and not url then return nil end}}. That should allow it to continue if a locally defined url is set. -- [[User:Ferret|ferret]] ([[User_talk: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. &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 15:41, 3 October 2022 (UTC)
::I've got some code which seems to work in [[Module:WikidataIB/sandbox]] &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 14:35, 4 October 2022 (UTC)
:::Deployed &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 16:10, 6 October 2022 (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)
== Using "unknown value" in queries ==
 
== open and close quotation mark ==
Is there any way to query items with "[[wikidata:Help:Statements#Unknown_or_no_values|unknown value]]" in their statemennts?
 
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)
For example:
::Ouch.Please Thissee hurts..[[MOS:CURLY]]. Thx. [[User:DePiepJonesey95|DePiepJonesey95]] ([[User talk:DePiepJonesey95|talk]]) 1801:57, 2627 SeptemberMarch 20222025 (UTC)
<pre>{{#invoke:WikidataIB |getQualifierValue |qid=Q104417487 |P4032 |pval="Unknown"|qual=P585 |name=xyz |fetchwikidata=ALL |onlysourced=no |noicon=true |df=YMD}}
::/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)
</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)