Module talk:WikidataIB/Archive 6: Difference between revisions

Content deleted Content added
m Archiving 1 discussion(s) from Module talk:WikidataIB) (bot
m Archiving 1 discussion(s) from Module talk:WikidataIB) (bot
Line 122:
:
: {{re|IceWelder}} Thanks for spotting that and for the accurate fix. I've updated to main module to include it. Cheers --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 17:27, 14 April 2020 (UTC)
 
== Bug? ==
 
Hello. {{Property|P1559}} is a value in {{Q|Q33823}}, on {{Q|Q15397819}}. But:
* <code><nowiki>{{#invoke:WikidataIB|getLang|P1559|qid=Q15397819|fwd=ALL|spf=none|osd=no}}</nowiki></code> → <code>en</code>
Is this a bug, or am I doing something wrong? [[User:Rehman|<span style="font-variant:small-caps; font-weight:bold; color:darkblue">Reh</span>]][[User talk:Rehman|<span style="color:green">man</span>]] 14:54, 28 March 2020 (UTC)
: {{re|Rehman}} Sorry I'm a bit late. The getLang function simply gets the language of the current wiki, not a value from Wikidata:
:* <code><nowiki>{{#invoke:WikidataIB |getLang}}</nowiki></code> → {{#invoke:WikidataIB |getLang}}
:* <code><nowiki>{{#invoke:WikidataIB |getLang |style=full}}</nowiki></code> → {{#invoke:WikidataIB |getLang |style=full}}
: I don't recall writing a function that returns the language that a value is in, although I think we were doing something that passed a language code when we were working on PSunits, but my memory is poor.
: There is a function called getValueByLang which gets the value of a property which has a qualifier P407 ("language of work or name") whose value has a given language code.
: There is a function called getValueByQual which gets the value of a property which has a qualifier with a given entity value, so it could get a value which has a {{q|P1559}} equal to {{q|Q33823}}
: But it's hard to know what to recommend without seeing what you're trying to do. Cheers --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 22:53, 7 April 2020 (UTC)
 
::Thank you, [[User:RexxS|RexxS]]. I'm trying to work my way though cleaning up {{tl|Infobox mountain}} and making it Wikidata compatible. Is there a better way to add wd support for the <code>native_name_lang</code> parameter? [[User:Rehman|<span style="font-variant:small-caps; font-weight:bold; color:darkblue">Reh</span>]][[User talk:Rehman|<span style="color:green">man</span>]] 05:13, 14 April 2020 (UTC)
:::{{Property|P1559}} is monolingual text, I am not sure {{ml|WikidataIB|getValue}} works properly for monolingual text beyond the current wiki's language. What are you trying to do? One thing I notice is that {{Property|P1559}} seems to be for names of people not mountains. Shouldn't you be using {{Property|P1705}}?
:::<code><nowiki>{{#invoke:WikidataIB|getValue|qid=Q39231|P1705|fwd=ALL|spf=none|osd=no}}</nowiki></code> → <code>{{#invoke:WikidataIB|getValue|qid=Q39231|P1705|fwd=ALL|spf=none|osd=no}}</code>
:::<code><nowiki>{{#invoke:Wd|property|eid=Q39231|P1705}}</nowiki></code> → <code>{{#invoke:Wd|property|eid=Q39231|P1705}}</code>
:::<code><nowiki>{{#invoke:Wd|property|multilanguage|eid=Q39231|P1705}}</nowiki></code> → <code>{{#invoke:Wd|property|multilanguage|eid=Q39231|P1705}}</code>
:::You might be able to use {{ml|Wd|property}} with {{para||multilanguage}} as I demonstrate above where I pull the {{Property|P1705}} claim from {{Q|Q39231}}. I am not sure how to get the actual language code with either module though and for an article one probably does not want to use such text without properly marking it in its language, e.g., Japanese on English Wikipedia should always be marked with the proper HTML attribute via something like {{tlx|lang|ja}}. [[User:Uzume|Uzume]] ([[User talk:Uzume|talk]]) 06:27, 16 April 2020 (UTC)
::::Thank you. I will look into this suggestion, and comment again. Cheers, [[User:Rehman|<span style="font-variant:small-caps; font-weight:bold; color:darkblue">Reh</span>]][[User talk:Rehman|<span style="color:green">man</span>]] 07:12, 16 April 2020 (UTC)