Content deleted Content added
m Archiving 2 discussion(s) from Module talk:Wd) (bot |
m Archiving 1 discussion(s) from Module talk:Wd) (bot |
||
Line 500:
:{{ping|Sophivorus}} Thanks! The separation exists because they serve different purposes. [[Module:Wd/aliasesP]] used to be integrated in [[Module:Wd]], but then I wanted to make use of the aliases list in [[Module:Wd/i18n]] too so I took it out of the main module. [[Module:Wd/aliasesP]] is not dependent on locale, so it doesn't really fit in an internationalization submodule. That's why I made it a separate submodule. [[User:Thayts|<span style="color:#466383;font-family:Georgia;font-style:italic;letter-spacing:1px">Thayts</span>]] [[User talk:Thayts|<span style="color:#7892A5">•••</span>]] 22:47, 18 April 2020 (UTC)
:Actually, I figured we don't need to have the aliasesP in a separate submodule. So I've made an update to include it in the main module again and requested to delete [[Module:Wd/aliasesP]]. [[User:Thayts|<span style="color:#466383;font-family:Georgia;font-style:italic;letter-spacing:1px">Thayts</span>]] [[User talk:Thayts|<span style="color:#7892A5">•••</span>]] 10:49, 19 April 2020 (UTC)
== Not most recent value if point-in-time is missing for one of the values ==
:<code><nowiki>{{wd|properties|Q180445|P1240|P585}}</nowiki></code> -> {{wd|properties|Q180445|P1240|P585}}
gave 2,3, i.e. two values. I want the most recent value, 3, which is from point-in-time 2019, and is the last in the list. I have tried the current, normal, normal+, best and single options but none of them helps. Probably because the older and first value in the list does not have a point-in-time (P585). My only solution is to apply {{template|last word}}, which gives {{last word|{{wd|properties|Q180445|P1240|P585}}}}. But that is an ugly solution - the most recently entered value is to my understanding typically but not always the last in the list, and should be the default if there is no timing info.
However, your module gives the correct date if I enter
:<code><nowiki>{{#invoke:wd|qualifier|normal+|single|Q180445|P1240|P585}}}</nowiki></code> -> {{#invoke:wd|qualifier|normal+|single|Q180445|P1240|P585}}.
(I would prefer a y or yyyy option to only get the year. Now I have to apply {{template|last word}} to get the year.) I need value and date separated from each other, since the value is visualized graphically, and need to be sure that correct date is shown for correct value. [edited afterwards]
[[User:Tomastvivlaren|Tomastvivlaren]] ([[User talk:Tomastvivlaren|talk]]) 02:07, 23 November 2019 (UTC)
:We're always dependent on the quality of the data in Wikidata for accuracy. We can make assumptions, but those are often also inaccurate. Assuming that the claim that was added last is the most up-to-date, for example, does not always hold if historic information was added later. Instead, Wikidata offers tools that allow us to select the most relevant information. In this case the rank tool can be used to mark 3 as the preferred claim. This module sorts claims based on this rank, from preferred to deprecated, so you will see that <code><nowiki>{{wd|property|Q180445|P1240}}</nowiki></code> [-> {{wd|property|Q180445|P1240}} ] returns the preferred value.
:The qualifier command gives the date value that you want since that is the only matching qualifier it could find. If claim 2 also had a qualifier of the same type, then that would also be returned. You could even use the (raw) qualifier value to select the claim that you want, but that is not a reliable solution since claim 2 could be assigned the qualifier in the future. Instead, the best way to go is to set the preferred rank in Wikidata which I just did.
:Regarding the date, you could also do this: <code><nowiki>{{#time:Y|{{wd|qualifier|raw|Q180445|P1240|P585}}}}</nowiki></code> [ -> {{#time:Y|{{wd|qualifier|raw|Q180445|P1240|P585}}}} ]. If you want to get the value together with the year (and <code><nowiki> {{wd|property|qualifier|Q180445|P1240|P585}}</nowiki></code> [ -> {{wd|property|qualifier|Q180445|P1240|P585}} ], which also returns the month, is not good enough), then you could make two separate calls to construct value+qualifier. However, it's then depending on the rank and the presence of the qualifier if it is selected from the same claim as the value, so it would be best to keep it in a single call (like the <code><nowiki>{{wd|property|qualifier|...</nowiki></code> I just gave). And then an option to get only the year would indeed come in handy. I'll put it on my to-do list. [[User:Thayts|<span style="color:#466383;font-family:Georgia;font-style:italic;letter-spacing:1px">Thayts</span>]] [[User talk:Thayts|<span style="color:#7892A5">•••</span>]] 12:36, 23 November 2019 (UTC) [I added the current code response in your answer, within brackets]
::Thankyou [[user:Thayts]] for prompt reply. However, then a bot should change the ranking to preferred value on thousands of Wikidata Items, or add point-in-time to the old values. If I restore the ranking for this item, the problem seems to return. You have not considered an option that allows the user to omit values without point-in-time - or to default prioritize those values that have a point-in-time? At Swedish Wikipedia, I just found out that the Swedish [[:sv:module:Wikidata2]] offers such an option, and solves my problem for now. At other wikipedias, where Wikidata2 is not installed, I really would like to use your module. (It is a petty that different Wikipedias cannot agree on a standardized set of modules, and that every Wikipedia has its own local culture regarding what module that people expect us to use.) [[User:Tomastvivlaren|Tomastvivlaren]] ([[User talk:Tomastvivlaren|talk]]) 23:42, 23 November 2019 (UTC)
:::{{ping|User:Tomastvivlaren|user:Thayts}} Hello! I have been trying to solkve exactly the same issue. For Covid-19 related articles it would be very useful to get the current, most recent property using the Wd module. Properties like P1120 (death counts) are updated every day for hundreds of items via the quickstatements tool, which does not support prefferred rank. It would be great for standardizing sources in the covid-19 situation if we could retrieve the latest (or highest) modification. [[User:TiagoLubiana|TiagoLubiana]] ([[User talk:TiagoLubiana|talk]]) 11:35, 27 April 2020 (UTC)
|