Content deleted Content added
m Archiving 1 discussion(s) from Module talk:Wd) (bot |
m Archiving 1 discussion(s) from Module talk:Wd) (bot |
||
Line 822:
:::::::{{re|Thayts}} I see no issue there. Such things just came about while working on the issues presented here and a little cleanup while trying to understand and make such modifications. Properties have no sitelinks (local or otherwise) but they link to Wikidata. It seemed to me it made sense to return a link when a link is requested even when there was no local sitelink available. If that assumption was wrong, I have no issues discussing and fixing things. You will notice that such a change was introduced while I was attempting to fix the "nowiki" escaping for labels that contain valid wikitext markup. —[[User:Uzume|Uzume]] ([[User talk:Uzume|talk]]) 17:38, 23 February 2022 (UTC)
::::::::Properties are specific to Wikidata, so it's logical to link them to Wikidata. However, the purpose of linking (non-raw) entity labels was to link to their respective Wikipedia articles, if they exist. This because the idea was to make it possible to enrich Wikipedia with data from Wikidata by using this module. Nevertheless, perhaps a new flag can be added to allow linking to Wikidata in such cases. I also don't really understand how nowiki escaping is dependent on either linking or not. [[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:32, 23 February 2022 (UTC)
== Help for YouTube infobox ==
I'm in the process of converting the sandbox of {{t|Infobox YouTube personality}} to rely on Wikidata subscriber counts, which [[wikidata:Wikidata:Requests for comment/Frequency of YouTube follower count data|are now being updated]] every time they change by 10% or reach a new factor of 10 milestone. The WikiProject [[Template_talk:Infobox_YouTube_personality/Archive_1#Proposal:_Move_subscriber_counts_to_Wikidata_and_update_using_bots|has expressed interest]], too. I'm not sure how to get {{t|Wikidata}} to work correctly with it, though. I'd like to have it so that it returns {{wpl|8687}} but only when the qualifier {{wpl|2397}} is present (doesn't matter what it's set to). Help? <span style="color:#AAA"><small>{{u|</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}}</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 07:40, 19 March 2022 (UTC)
:@[[User:Sdkb|Sdkb]]: Currently, there is just one way to do it without showing the qualifier (as far as I know):
:<code><nowiki>{{wd|property|qualifier|:Barack Obama|P8687|P2397|format=%p<![]--%q--[]>}}</nowiki></code> → {{wd|property|qualifier|:Barack Obama|P8687|P2397|format=%p<![]--%q--[]>}}
:This requires the qualifier to be present, but puts it inside an HTML comment so that it's not rendered. [[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:54, 19 March 2022 (UTC)
::@[[User:Thayts|Thayts]], thanks for that workaround! It's pretty clunky, though, and unfortunately it gets thrown off as soon as I try to use it with {{t|Format price}}, which doesn't seem to be able to handle hidden comments within the input. Would it be possible to modify {{t|Wikidata}} to provide a more direct solution? This would be one of the bigger uses of Wikidata on Wikipedia to date, and would be a huge plus for those whose watchlists are cluttered with subscriber count updates (or who are spending time doing the updates), but we'll have to overcome this obstacle in some way to get it to work. It seems rather silly that Wikidata decided to lump together Twitter followers/YouTube subscribers/etc. in the same property, but given that, we definitely don't want Twitter followers to accidentally show up as YouTube subscribers. The edits so far to the sandbox are [[Template:Infobox YouTube personality/sandbox|here]]. <span style="color:#AAA"><small>{{u|</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}}</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 19:04, 19 March 2022 (UTC)
:::@[[User:Sdkb|Sdkb]], here's another workaround for now:
:::<code><nowiki>{{Format price|{{#titleparts:{{wd|property|raw|qualifier|:Barack Obama|P8687|P2397|format=%p/%q}}|1}}}}</nowiki></code> → {{Format price|{{#titleparts:{{wd|property|raw|qualifier|:Barack Obama|P8687|P2397|format=%p/%q}}|1}}}}
:::Perhaps it's easier to make a template out of this. [[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>]] 21:06, 19 March 2022 (UTC)
::::Thanks! I tried plugging it in [[Special:Diff/1078717148|here]], but I'm not sure how to fetch the value for {{para|subscriber_date}} with this approach. Ack. <span style="color:#AAA"><small>{{u|</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}}</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 00:51, 23 March 2022 (UTC)
:::::This is the first time you've mentioned needing the subscriber date! And I'm not clear why you're using {format price} because it isn't a price? It might help if you could be clearer on exactly what output you are seeking. It seems a rather strange way to structure the data on Wikidata. A more traditional structure might be something like this:
:::::* {{Q|Q76}} → {{Q|P553}} → {{Q|Q866}} → {{Q|P3744}} → 574000
:::::If this structure is becoming common we should perhaps look at supporting it with this module. PS, I've just seen your post on WD and completely agree! — Martin <small>([[User:MSGJ|MSGJ]] · [[User talk:MSGJ|talk]])</small> 09:35, 23 March 2022 (UTC)
::::::Indeed, if the only reason to use {{t|format price}} is to add delimiters, then you can simply use {{t|wd}} without the <code>raw</code> flag as shown above. If you mean you also need {{q|P585}} as the subscriber date, then you can use the same approach as I showed last time and you could even use the raw followers value to pinpoint the right claim like so:
::::::<code><nowiki>{{#titleparts:{{wd|qualifier|qualifier|single|:Barack Obama|P8687|{{#titleparts:{{wd|property|raw|qualifier|:Barack Obama|P8687|P2397|format=%p/%q}}|1}}|P2397|P585|format=%q2/%q1}}|1}}</nowiki></code> → {{#titleparts:{{wd|qualifier|qualifier|single|:Barack Obama|P8687|{{#titleparts:{{wd|property|raw|qualifier|:Barack Obama|P8687|P2397|format=%p/%q}}|1}}|P2397|P585|format=%q2/%q1}}|1}}
::::::By the way, I am still working on a version that allows you to select claims that have ''some'' value for a particular qualifier. [[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>]] 08:28, 24 March 2022 (UTC)
::::::: The reason I used {{t|format price}} is since I wanted e.g. {{tq|47 million}} rather than {{tq|47,000,000}}. <span style="color:#AAA"><small>{{u|</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}}</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 08:34, 24 March 2022 (UTC)
::::::::FYI, infoboxes should be using [[:Module:WikidataIB]] with the default value for {{para|onlysourced}}. See the RFC link in that template's documentation for more information. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 14:56, 28 March 2022 (UTC)
:::::::::Well, if this module is a better fit for certain use cases then why not use it. Using the <code>sourced</code> flag you can also get just properties that have a reference. [[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>]] 16:38, 29 March 2022 (UTC)
:::::::::@[[User:Jonesey95|Jonesey95]], I'm fine with either. If you can get a version of {{t|Infobox YouTube personality/sandbox}} working with WikidataIB, I'd love to see it! <span style="color:#AAA"><small>{{u|</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}}</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 00:58, 30 March 2022 (UTC)
|