Template talk:Wikidata Infobox/Archive 3

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Language handling

@Mike Peel: There's a rather intractable problem with languages and monolingual text. Take the example of birth name (P1477) for Bebe Rexha (Q16185856), which is specified in Wikidata as "en". The current implementation looks for the user language if not specified and returns the value that matches the language of the monolingual text. That would allow a birth name to have a transcription into Cyrillic script or Arabic, Hindi, etc. and the user would then see the birth name in their language. The problem then is that when we don't have a birth name version in German or French, we won't get anything.

Testing getDescription
Bebe Rexha (Q16185856) {{#invoke:WikidataIB/sandbox |getValue |P1477 |qid=Q16185856 |fwd=ALL |osd=no}} Bleta Rexha Edit this on Wikidata
Bebe Rexha (Q16185856) {{#invoke:WikidataIB/sandbox |getValue |P1477 |qid=Q16185856 |fwd=ALL |osd=no |lang=}} Bleta Rexha Edit this on Wikidata
Bebe Rexha (Q16185856) {{#invoke:WikidataIB/sandbox |getValue |P1477 |qid=Q16185856 |fwd=ALL |osd=no |lang=en}} Bleta Rexha Edit this on Wikidata
Bebe Rexha (Q16185856) {{#invoke:WikidataIB/sandbox |getValue |P1477 |qid=Q16185856 |fwd=ALL |osd=no |lang=en-gb}} Bleta Rexha Edit this on Wikidata
Bebe Rexha (Q16185856) {{#invoke:WikidataIB/sandbox |getValue |P1477 |qid=Q16185856 |fwd=ALL |osd=no |lang=de}} Bleta Rexha Edit this on Wikidata
Bebe Rexha (Q16185856) {{#invoke:WikidataIB/sandbox |getValue |P1477 |qid=Q16185856 |fwd=ALL |osd=no |lang=zh-mo}} Bleta Rexha Edit this on Wikidata

It would be a lot of complication to implement fallbacks in the code, so maybe it would be better to switch monolingual text to look for the content language (i.e. "en" on Commons), which cuts out the chance of displaying Cyrillic script or Arabic, Hindi, etc. where they exist. Optionally, you could specify |lang=en in the infobox design for certain fields that you expect to only have an English version of something like birth name. I'm not sure what the best line would be. The latter one would improve the compatibility of the module with other language wikis, but requires special considerations for infoboxes on Commons. What do you think? --RexxS (talk) 21:39, 1 June 2018 (UTC)

@RexxS: Hmm, I don't like the idea of just using English here, as that won't work in cases where there isn't an English birth name. Maybe it could fall back to showing the first (and/or only) entry in that case? Or Wikidata has the concept of 'fall-back languages' (although I can't find the documentation for that beyond d:Help:Navigating_Wikidata/User_Options#Language_fallback_chain), maybe those could be used in these cases? Pinging @Lydia Pintscher (WMDE): for help/pointers here. Thanks. Mike Peel (talk) 21:48, 1 June 2018 (UTC)
@Mike Peel: I know how to get the list of fallback languages for a given language, but the code works by looping through each of the values available and adding it to the list of items to return or not - it's a big complication to say "only take this one if some other one isn't there" because the values are kept in random order on Wikidata. I mean when the code encounter an English value, it doesn't know that there might be a German or Arabic one later. That's not easy to work around but I'll try. It wouldn't help when the only monolingual test is in Russian, say, because we can either display that or nothing. What do we do when there are two monolingual texts available, but they are in Russian and Chinese? What algorithm do we use to choose? --RexxS (talk) 22:08, 1 June 2018 (UTC)
@Mike Peel: Well, it was a pain, but I think I have a solution. Here's the algorithm:
  • If there's only one value, return that;
  • Otherwise, make a table of languages from the user's default and all its fallback languages, then see if each one in turn matches one of the languages in the property - if so use that;
  • Otherwise, WTF? - might as well just return the first one.
Seems to work - see the table above now - but I have very few test cases to try out. Do you know of any for me? --RexxS (talk) 00:01, 2 June 2018 (UTC)
Side note for interested users: If this is following the MediaWiki fallback pattern, then the list of fallback languages will always include English. (I'm now curious how many items would actually reach that last step.) Whatamidoing (WMF) (talk) 19:05, 30 May 2019 (UTC)

Disable map option?

Routes (such as Interstate 696) defined by OSM relations doesn't appear to be displayed on the Infobox map. In those cases creating a "custom" mapframe (width, height, zoom + extra POI's) often appears to make sense though, so to save space & clutter I'd like an option to disable the Infobox map.— Preceding unsigned comment added by Hjart (talk • contribs)

@Hjart: We could, but I'd like to see if there's a way of doing what you're thinking of automatically, as we could then use that across all routes. Can you set up a demo (or point to where one already exists) that I could have a look at? Thanks. Mike Peel (talk) 00:05, 7 June 2018 (UTC)
My first attempt at visualizing a veteran railroad: Category:Haderslevbanen. There are a few long distance cycle- and hiking routes I'd like to do something similar with. --Hjart (talk) 13:24, 7 June 2018 (UTC)
This section was archived on a request by: Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 13:51, 7 June 2019 (UTC)

Please don't display Q-IDs to the end user!

I don't know if this has been addressed before, but I don't think it is ok to display Q-IDs to the end user even if there isn't a localized label, even worse if the Q-ID isn't clickable to at least lead to the Wikidata item that might tell more. Example is the last spouse here. Please make it clickable and replace the Q-ID with for example an italic name missing or one of the foreign language names with a dotted underline (if no fallback exists, than try to fallback to same script, if still no label matches and there is more than one label, more complex heuristics could be used, e.g. here reading of country of citizenship (P27) could indicate that Russian is the most relevant language, but all that is not necessary), but anything will still be better than a Q-ID. Thanks in advance, --Marsupium (talk) 13:29, 13 June 2018 (UTC)

@RexxS: Curious to know what you think might be possible here. (It connects to Francis's comments on enwp, but I'm not going to comment there!) Personally I like showing the Q-number as it's a call-to-action to add the English label on Wikidata (since that's the base fall-back language that all other languages end up at where their labels are missing), but a number of suggestions here would still do that while making things more user-friendly. Thanks. Mike Peel (talk) 11:56, 17 June 2018 (UTC)
Anything is possible. It just depends on how much effort we want to put into it. It would be trivial to replace the entity-id ("Q-ID") that is returned when there is no sitelink or label available in the user's language. We could have an error message like "name missing in your language", but how would that be better for the reader than the entity-id?
Other options are not so easy. Unfortunately, there is no convenient mechanism exposed to Lua by the Extension:Wikibase Client (that I am aware of) to return the collection of available labels for a given entity-id. That means that we would need to have a list of all available languages and try each of them in turn to see if each one returned a label, which would be an expensive search. Let's say there were labels in Belorussian (old style), Japanese, Hebrew and Hindi: how would we algorithmically determine which one to return for a given user/reader/topic? What if there is no country of citizenship (P27)?
As for the link, the option is already there for each field to have an "edit on Wikidata" link (a pen-icon with tooltip on hover). But if we turn that on, we get some editors complaining that it adds "clutter" to the infobox. In Category:Sergei_Yesenin, the infobox has a pen-icon linking the Wikidata entry at the bottom of the infobox. Why wouldn't we use that to see more? If we turn a piece of text into a clickable link to the Wikidata entry, we have editors complaining that it comes as a surprise to the reader who doesn't expect to be taken to "a different site". Now we have complaints that we need clickable linked text potentially in each field. I have to ask, shouldn't we be establishing a consensus for which option is wanted, rather than trying to guess which option is most desirable? --RexxS (talk) 18:29, 17 June 2018 (UTC)
This section was archived on a request by: Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 13:51, 7 June 2019 (UTC)

Removing of {{MainW}}

Is removing mainw well thought? I received on my talk page some questions about it. Rudolphous (talk) 17:39, 18 June 2018 (UTC)

My view is that it makes sense where the sitelinks aren't available and where we don't have this infobox, but where either of those are true then it's just unnecessary clutter presenting a duplicate link, so should be removed. The template can't be completely deleted (yet), though, since it is still useful where we don't have the sitelinks/infobox. Thanks. Mike Peel (talk) 18:19, 18 June 2018 (UTC)
I restored some mainw's and will wait now for other opinions about this. Rudolphous (talk) 19:55, 18 June 2018 (UTC)
This section was archived on a request by: Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 13:51, 7 June 2019 (UTC)

start time - end time on occupation qualifier seem to be inverted

Look here, for instance: Category:Carlos de Almeida Pereira. Should be 1910 - 1913, but it's inverted.-- Darwin Ahoy! 23:36, 20 June 2018 (UTC)

@RexxS: This seems to be an odd one. They display the correct way around on Wikidata, but not in the infobox. Switching to 'qual=DATES' would probably solve this, but that will hide the other qualifiers. Any ideas? Thanks. Mike Peel (talk) 23:43, 20 June 2018 (UTC)
@Mike Peel: When Lua traverses a table, it does it in a non-specific order. So as far as the Lua code is concerned, there is no "correct way around". I could re-write the code to specifically use the same order as in this dump of the property, but we have no guarantee that all qualifiers are the "correct way around" in other entities. I'll have to make use of the ["qualifiers-order"] to fix order of the qualifiers - which I can see how to implement. However, that will need a pretty big revision (as I need to ensure that all qualifiers have a qualifier-order and provide a fall-back if they don't), so you may have to bear with me for a while. Here's what we have to work with:
Here's what we have to work with:
table#1 {
    table#2 {
        ["id"] = "Q55112623$f83561ca-481c-d892-4779-a71131621448",
        ["mainsnak"] = table#3 {
            ["datatype"] = "wikibase-item",
            ["datavalue"] = table#4 {
                ["type"] = "wikibase-entityid",
                ["value"] = table#5 {
                    ["entity-type"] = "item",
                    ["id"] = "Q10669499",
                    ["numeric-id"] = 10669499,
                },
            },
            ["property"] = "P106",
            ["snaktype"] = "value",
        },
        ["qualifiers"] = table#6 {
            ["P642"] = table#7 {
                table#8 {
                    ["datatype"] = "wikibase-item",
                    ["datavalue"] = table#9 {
                        ["type"] = "wikibase-entityid",
                        ["value"] = table#10 {
                            ["entity-type"] = "item",
                            ["id"] = "Q588089",
                            ["numeric-id"] = 588089,
                        },
                    },
                    ["hash"] = "cac177afbb9491e87cd43a9c2f90f8717bd6dd93",
                    ["property"] = "P642",
                    ["snaktype"] = "value",
                },
            },
        },
        ["qualifiers-order"] = table#11 {
            "P642",
        },
        ["rank"] = "normal",
        ["type"] = "statement",
    },
    table#12 {
        ["id"] = "Q55112623$b5dac161-4848-9762-efff-74e5ab03ba51",
        ["mainsnak"] = table#13 {
            ["datatype"] = "wikibase-item",
            ["datavalue"] = table#14 {
                ["type"] = "wikibase-entityid",
                ["value"] = table#15 {
                    ["entity-type"] = "item",
                    ["id"] = "Q54366548",
                    ["numeric-id"] = 54366548,
                },
            },
            ["property"] = "P106",
            ["snaktype"] = "value",
        },
        ["qualifiers"] = table#16 {
            ["P580"] = table#17 {
                table#18 {
                    ["datatype"] = "time",
                    ["datavalue"] = table#19 {
                        ["type"] = "time",
                        ["value"] = table#20 {
                            ["after"] = 0,
                            ["before"] = 0,
                            ["calendarmodel"] = "http://www.wikidata.org/entity/Q1985727",
                            ["precision"] = 9,
                            ["time"] = "+1910-00-00T00:00:00Z",
                            ["timezone"] = 0,
                        },
                    },
                    ["hash"] = "8ffa963f124d126dffac07366687d8c578b078b7",
                    ["property"] = "P580",
                    ["snaktype"] = "value",
                },
            },
            ["P582"] = table#21 {
                table#22 {
                    ["datatype"] = "time",
                    ["datavalue"] = table#23 {
                        ["type"] = "time",
                        ["value"] = table#24 {
                            ["after"] = 0,
                            ["before"] = 0,
                            ["calendarmodel"] = "http://www.wikidata.org/entity/Q1985727",
                            ["precision"] = 9,
                            ["time"] = "+1913-00-00T00:00:00Z",
                            ["timezone"] = 0,
                        },
                    },
                    ["hash"] = "4362eb2d46c233a37ab5e69c290b66030f9428e0",
                    ["property"] = "P582",
                    ["snaktype"] = "value",
                },
            },
        },
        ["qualifiers-order"] = table#25 {
            "P580",
            "P582",
        },
        ["rank"] = "normal",
        ["type"] = "statement",
    },
    table#26 {
        ["id"] = "Q55112623$e2946681-4d5f-24a0-4b32-01cfdd93ccfa",
        ["mainsnak"] = table#27 {
            ["datatype"] = "wikibase-item",
            ["datavalue"] = table#28 {
                ["type"] = "wikibase-entityid",
                ["value"] = table#29 {
                    ["entity-type"] = "item",
                    ["id"] = "Q82955",
                    ["numeric-id"] = 82955,
                },
            },
            ["property"] = "P106",
            ["snaktype"] = "value",
        },
        ["rank"] = "normal",
        ["type"] = "statement",
    },
}
Cheers --RexxS (talk) 00:15, 21 June 2018 (UTC)
@RexxS: Ah, OK. So even though they appear in the right order in the source, the Lua parsing changes the order? Would ordering by the property number be easier, as that would solve things in this case? Thanks. Mike Peel (talk) 11:51, 21 June 2018 (UTC)
No, Mike. The order that Lua transverses a table of key-value pairs is not specified, so no amount of jiggling around with what you see on Wikidata will guarantee a particular order. What you see in Wikidata, or in that printout above, is not the source. That's merely a human-readable representation of what's in the database in RDF-format. I could traverse the table by using numerical indices, but that's less efficient and still leaves us vulnerable to changes that look innocuous, but which actually alter the order. --RexxS (talk) 17:26, 21 June 2018 (UTC)
@DarwIn and Mike Peel: Okay, Mike, it wasn't as straightforward as I thought. I now have the code in place to ensure the qualifiers are presented in the order dictated by the ["qualifiers-order"] table (see the printout above). Unfortunately, I don't have any way of writing to that table directly to change the order if it's wrong. We still have to remove qualifiers and replace them in what looks like the right order in the Wikidata interface to affect that table. That's really hacky, but it's the only way I can see of setting the qualifier order definitively.
  • {{wdib |P26 |qid=Q151973 |fwd=ALL |osd=no |qual=ALL |list=ubl}}
(15 March 1964, 26 June 1974)
Sally Burton (3 July 1983, 5 August 1984)
Sybil Christopher (5 February 1949, 5 December 1963)
Suzy Miller (1982, 21 August 1976)
(10 October 1975, 29 July 1976) (Edit this on Wikidata)
  • {{wdib |P106 |qid=Q55112623 |fwd=ALL |osd=no |qual=ALL |list=ubl}}
navy officer ()
Governor of Portuguese Guinea (1910, 1913) (Edit this on Wikidata)
Can we figure out a better way? --RexxS (talk) 22:05, 21 June 2018 (UTC)
@RexxS: Is that table linked to d:MediaWiki:Wikibase-SortedProperties somehow? So if there are issues with the order, we can look at asking for a tweak to be made to that list? Thanks. Mike Peel (talk) 22:25, 21 June 2018 (UTC)
@Mike Peel: I don't see how it could be, as I've just edited Richard Burton (Q151973) to "massage" the start/end times of his spouse (P26) so that they are in the "right order", which changed the ["qualifiers-order"] table. It seems that the last qualifier property edited goes to the end of that table. --RexxS (talk) 22:50, 21 June 2018 (UTC)
  • Note - markup fix: I removed the template {{Wdib}} and copied, exactly, the text generated by it (including the link edit this on Wikidata). The problem was that {{Wdib}} categorized this page into the categories Elizabeth Taylor, Navy of Portugal and Politicians. As you can see, my solution reproduces exactly the same text generated using wdib (exept for the Wikidata link icon, a sort of pencil). Regards. --Dэя-Бøяg 10:57, 27 June 2018 (UTC)
    • Thanks, DerBorg, for spotting my omission. On Commons, making the link adds the current page to the category, rather than displaying the item linked to the category. The usual solution is to set |linkprefix=":", which adds a colon before the link text thus allowing the display instead of adding the page to the category:
      • {{wdib |P26 |qid=Q151973 |fwd=ALL |osd=no |qual=ALL |list=ubl |linkprefix=":"}}
    • --RexxS (talk) 12:46, 29 June 2018 (UTC)
This section was archived on a request by: Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 13:51, 7 June 2019 (UTC)

Displaying of "construction" and "renovation"

I propose to change the displaying of the "start time"/"end time" qualifiers in the same way it was changed for "owned by" (see #Displaying of "owned by"). See Category:Langer Eugen as an example. Thanks--Leit (talk) 19:36, 21 June 2018 (UTC)

@Leit: It's in the sandbox, try {{Wikidata Infobox/sandbox}}. However, that doesn't support "point in time", so the dates are no longer shown for e.g. the opening ceremony on that page. So perhaps it's best to leave this as it currently is? Thanks. Mike Peel (talk) 22:29, 21 June 2018 (UTC)

(talk) 19:36, 21 June 2018 (UTC)

(Edit conflict) If you're quite certain that no qualifiers other than start and end times will be wanted, then it's just a matter of replacing |qual=ALL with |qual=DATES in the 'significant event' section of Template:Wikidata Infobox. Here is a comparison for Langer Eugen (Q884122):
For many event-related qualifiers, I expect that start time (P580) and end time (P582) are going to be the only ones. Perhaps using qual=DATES is a better bet in general? Optionally, I could check the qualifiers available when qual=ALL is specified, and if P580/P582 are there, then I could treat those two as if DATES were specified. That would be a bit more work. --RexxS (talk) 22:43, 21 June 2018 (UTC)
It might be good to always format P580/P582 as a range since they are so heavily used on Wikidata to show a date range. Or have point in time (P585) in DATES, which would resolve this, but probably not other cases (particularly preceeded/follows). Thanks. Mike Peel (talk) 10:51, 24 June 2018 (UTC)
This section was archived on a request by: Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 13:51, 7 June 2019 (UTC)

Problem with {{Object photo}}

I tried to find out why File:Logitech ScanMan Color-P4191190-black.jpg is in Category:Uses of Wikidata Infobox with problems.

Ping Zolo and Jarekt in regard to the "Object photo" template. Hope someone finds a solution. --Te750iv (talk) 12:16, 26 June 2018 (UTC)

Use of {{Object photo}} is often a bad idea as the template pretends that a category pages are templates and it transcludes content of the category page. For it to work category page has to be properly set and Category:Logitech ScanMan Color-Musée Bolo is not. As a result {{Wikidata Infobox}} is transcluded into File:Logitech ScanMan Color-P4191190-black.jpg but it is not connected to any wikidata pages through a sitelink (it is not supposed to be). I assume user:Rama was planning to set up Category:Logitech ScanMan Color-Musée Bolo to be compatible with {{Object photo}}. --Jarekt (talk) 12:32, 26 June 2018 (UTC)
This infobox is not compatible at all with object photo. My view is that the latter needs to be deprecated in favour of using Wikidata directly in the file pages, but I haven't looked into this enough yet to propose a solution. For now it's best to avoid adding the infobox to categories that are used by object photo. Thanks. Mike Peel (talk) 13:25, 26 June 2018 (UTC)
My version of Category:Logitech ScanMan Color-Musée Bolo used "User:Rama/Catdef", a draft and proof of concept for functionalities that are now in {{Artwork}}, which works fine with {{Object photo}}. User:Alexis Jazz changed this in favour of {{Wikidata Infobox}}, but I have reverted his edit, since it breaks the documentation of the files. Rama (talk) 14:53, 26 June 2018 (UTC)
@Rama: Because templates that are used in main space (and yours seems to be used on 7451 pages..) should never ever be in user space. - Alexis Jazz ping plz 15:07, 26 June 2018 (UTC)
Things that do not work should be used even less. Rama (talk) 17:38, 26 June 2018 (UTC)
This section was archived on a request by: Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 13:51, 7 June 2019 (UTC)

Twitter integration

I would like to see better twitter integration. If I share a Wikicommon category with a Infobox I would like to see more than a text link see tweet of Category:Post Rotemuseum - Salgo60 (talk) 06:51, 3 July 2018 (UTC)

@Salgo60: It seems that this is an issue with the configuration of MediaWiki here - mw:Extension:PageImages doesn't seem to be enabled for categories, so there is no image provided to twitter/facebook/etc. when someone links to a commons category. This needs WMF dev input, so I've raised that on phabricator, see phab:T198716. Thanks. Mike Peel (talk) 14:47, 3 July 2018 (UTC)
@Mike Peel: thanks I have been out biketouring.... I guess then we get a Twitter card. We did that on another site portrttarkiv-kcb.se ==> Tweet
   <meta name="twitter:card" content="summary_large_image" />
   <meta name="twitter:site" content="portrattarkiv" />
Is there no possibility to do that from a template?!?!? see Extension:Add_HTML_Meta_and_Title - Salgo60 (talk) 10:59, 13 July 2018 (UTC)
@Salgo60: Sorry for not replying quicker to this. I don't think that extension is available here? As per my comment on phabricator, I think PageImages uses the more general approach rather than something that's twitter-specific, but I might be wrong. Thanks. Mike Peel (talk) 08:54, 16 July 2018 (UTC)
This section was archived on a request by: Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 13:51, 7 June 2019 (UTC)

"stated as" used as the piped end to a link....

I have old books who are using some name or another that has a different name now. "American Ornithological Union" vs the current "American Ornithological Society" now. [[:Category:Current name|Stated as]] Category:The Auk --RaboKarbakian (talk) 22:16, 7 July 2018 (UTC)

@RaboKarbakian: I'm not sure I see the problem, can you explain/show a demo of how it should look please? Thanks. Mike Peel (talk) 20:36, 10 July 2018 (UTC)
At source, it is probably going to be the Union, here it is going to be the Society. I don't know when the Society started and the Union ended, but it is still a Union in 1920, I think.... I just want to be able to wrap the old name (red letters) around the new name (blue letters). It is easier for linking the publications. Thanks for answering. @Mike Peel: --RaboKarbakian (talk) 20:56, 10 July 2018 (UTC)
Ah, so you want the link to appear as American Ornithologists' Union rather than American Ornithological Society? Looks like this would need some Lua from @RexxS: . Thanks. Mike Peel (talk) 21:02, 10 July 2018 (UTC)
Yes! The link to the right place, but the name being the one that was published. Thank you for working through this!--RaboKarbakian (talk) 02:34, 11 July 2018 (UTC)
"stated as" takes a string value rather than a link value, so one might expect modern name as a blue link, stated name as black text. That might be a clearer representation of what is at the wikidata item. Or do you specifically want both to be linked as blue links to the category for the modern entity? Jheald (talk) 21:07, 10 July 2018 (UTC)
I should add that I've been working quite a lot on some of these journal items recently, where there are scanned copies in the Biodiversity History Library, so do talk to me if you think there is anything not right or that could be systematically improved with their Wikidata items. Jheald (talk) 21:10, 10 July 2018 (UTC)
I would also tend to be wary about this because I have been using object named as (P1932) to record how names (eg of book authors) have been stated in the source I am citing, which (at least for the BHL index) tends not to what is written on the title-page, and probably is also not how we would want to primarily state them in the infobox.
(See eg: Category:Bird-life; a guide to the study of our common birds. So far we only have categories for about a dozen books with scans from the BHL linked to wikidata; but potentially there could be many tens of thousands, all of which this would apply to.) Jheald (talk) 17:09, 11 July 2018 (UTC)
There is going to be a problem similar to this when source starts doing taxonomy. Stated as is the best way to point to which taxon name and if known system being used. Plants, birds, reptiles, amphibians, probably more. Same problem, really.--RaboKarbakian (talk) 20:00, 11 July 2018 (UTC)
"Stated as" should be used differently per thing (or item). It is safe and good to use author, and publisher stated as this way. Taxonomic names also.--RaboKarbakian (talk) 20:05, 11 July 2018 (UTC)
While trying to fix a similar error reported below, I realised that we're better off not trying to link string values by default, and specifically link them only in rare cases, so I've suppressed the links. --RexxS (talk) 17:15, 24 July 2018 (UTC)
This section was archived on a request by: Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 13:51, 7 June 2019 (UTC)

Another idea

Hello @Mike Peel: . now the feels a bit lonely.
Why not moving it to the sitelinks section (looking like " Wikidata"?) ?
Perhaps first of them as it is the source.
It will allow you to suppress all the first "if" part (because there would always be a wikidata link).
Cheers Liné1 (talk) 15:45, 14 July 2018 (UTC)

This section was archived on a request by: Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 13:51, 7 June 2019 (UTC)

Links on grave information is odd

Example Category:Gunnar_Sträng Wikidata Gunnar Sträng (Q354112)

- Salgo60 (talk) 13:41, 19 July 2018 (UTC)

The reason why the value of burial plot reference (P965) is linked is because the template sets |qlinkprefix=":" in the call for "place of burial". That triggers linking for qualifiers that are of type 'string', such as burial plot reference (P965). As the qualifiers for place of burial (P119) are unlikely to be linkable wikibase items, it's probably best not to set the qlinkprefix – unless anybody knows of any examples of wikibase-items that are categories being used as qualifiers for place of burial (P119)? If so, I could always create yet another parameter like qlinked to control linking of qualifier values, although I'd rather not unless there's a demonstrable need. --RexxS (talk) 14:26, 24 July 2018 (UTC)
[Update:] It seems we rarely need qualifiers which are strings to be linked, so I've suppressed linking of qualifiers when the linkprefix is just ":" (i.e. used to suppress categorisation when category links are made). The template seems to be behaving better when there are qualifiers with datatype string now. Let me know if there are any consequential problems arising. --RexxS (talk) 17:19, 24 July 2018 (UTC)
This section was archived on a request by: Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 13:51, 7 June 2019 (UTC)

P39 qualifiers

Displaying all P39 qualifiers is a bit excessive (see Category:Andrej Babiš for example). I think none or P580 only is enough.--Jklamo (talk) 08:50, 5 August 2018 (UTC)

We should use small letters (80 %) to generally display all qualifiers, it will permit to have a king of hierarchy in informations. Jérémy-Günther-Heinz Jähnick (talk) 09:47, 5 August 2018 (UTC)
We should never use small letters in any element that's already reduced in size. Any text that less than about 85% of the normal font size for the page is going to be unreadable by most folks with visual impairments, including older readers like me. --RexxS (talk) 18:37, 13 August 2018 (UTC)
@Jklamo: Apologies for the delayed response. I've set qual=DATES (so that only start time (P580) and end time (P582) are shown) in the sandbox at {{Wikidata Infobox/sandbox}} - how does that look? Thanks. Mike Peel (talk) 23:37, 28 August 2018 (UTC)
Much better, thanks.--Jklamo (talk) 07:23, 29 August 2018 (UTC)
It's now live. Thanks. Mike Peel (talk) 21:38, 29 August 2018 (UTC)
@Mike Peel: I just see the change, if it is good for dates, it always lacks the display of of (P642) or electoral district (P768). I often add Wikidata infobox for French mayors and deputies, and it is with the dates the major information. See the example with Nestor Danquigny. Jérémy-Günther-Heinz Jähnick (talk) 12:25, 30 August 2018 (UTC)
@Jklamo and Jérémy-Günther-Heinz Jähnick: The current options available here are to show one qualifier (e.g., P462); the date properties; or all qualifiers. It doesn't seem to be possible to select 4 qualifiers ([1] doesn't work, unless @RexxS: can help). So, which should we do? Thanks. Mike Peel (talk) 13:11, 30 August 2018 (UTC)
I am not a pro in algorithmes. Is it possible to exclude some properties ? (It can be the other solution, but I propose that without having knowledge on this). Jérémy-Günther-Heinz Jähnick (talk) 13:34, 30 August 2018 (UTC)
@Mike Peel and Jérémy-Günther-Heinz Jähnick: I can see how to do what's required, but it will take a bit of a re-write of the code that handles qualifiers. Essentially, we could use something like |qual=P580, P582, P642, P768 and I could then detect the list and arrange for the code to loop through the supplied qualifiers, checking if each one existed in turn, and processing each one found. How would you envisage that the display should handle multiple values for each qualifier? --RexxS (talk) 15:14, 30 August 2018 (UTC)
Normally we can have one and only one value for of (P642), idem for electoral district (P768). And these two properties cannot be present together in one statement. Jérémy-Günther-Heinz Jähnick (talk) 16:27, 30 August 2018 (UTC)
This section was archived on a request by: Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 13:51, 7 June 2019 (UTC)

Improvement to "location" field with hierarchical information

Hello,

I have had a thought about the "location field", which I will illustrate with an example.

In cases such as Category:Near Eastern Antiquities in the Louvre - Room B, we see things like "Located in: Sully Wing, France". The field takes information directly from the item, in properties "located in" (P276) and "country" (P17). This has obviously been designed with large locations in mind such as cities or regions ("London, UK" or "Kantō, Japan" make sense), but as precision increases the outcome becomes absurd: if you know that the Sully Wing is one of the main subdivisions of the Louvre, you do not need to be told that it is in France; and if you do not know what it is, "France" is too vague.

In the case of Category:Near Eastern Antiquities in the Louvre - Room A, we see a more reasonable hierarchy of locations, generated by a similar list in the Wikidata item for Room A. This sounds sub-optimal as the Wikidata item then contains several locations, more and more precise, instead of the most precise of these.

Would it be possible to perform hierarchical queries to parent items, as to obtain "Sully Wing, Louvre Palace, 1st arrondissement of Paris, France" (with the rule: Room 300 (Q30083572) located in (P276) Sully Wing (Q17309954); Sully Wing (Q17309954) located in (P276) Louvre Palace (Q1075988); Louvre Palace (Q1075988) is in the administrative unit (P131) 1st arrondissement of Paris (Q161741); 1st arrondissement of Paris (Q161741) country (P17) France (Q142)" ?

Thank you very much in advance! Rama (talk) 07:57, 28 August 2018 (UTC)

That sort of thing is easy to do in database query but is hard to do by a code traversing multiple items. Each loaded item is another expense in time and memory. A while ago I wrote phabricator:T167521 proposing a solution, but without changes to the software I do not think it is feasible. --Jarekt (talk) 16:56, 28 August 2018 (UTC)
@Rama: It can partly be done by code that @RexxS: drafted (but I haven't yet implemented in the infobox) that follows located in the administrative territorial entity (P131) down the line, e.g. for Room 300 (Q30083572) it gives Sully Wing, Louvre Palace, 1st arrondissement of Paris, Paris Centre, Paris, Grand Paris. That doesn't help with going from Sully Wing (Q17309954) to Louvre Palace (Q1075988) though... Thanks. Mike Peel (talk) 22:04, 28 August 2018 (UTC)
@Mike Peel and Rama: Since I moved the main code in Module:WikidataIB over to using mw.wikibase.getAllStatements instead of mw.wikibase.getEntity, the expense has been greatly reduced, so much so that these sort of chains are now perfectly feasible. I could develop the location function to check for location (P276) whenever located in the administrative territorial entity (P131) is empty, which would allow Sully Wing (Q17309954) to link to Louvre Palace (Q1075988) and that then produces 1st arrondissement of Paris, Paris Centre, Paris, Grand Paris. Are there any other likely properties we ought to be catering for? --RexxS (talk) 22:21, 28 August 2018 (UTC)
@RexxS: That sounds good. Perhaps it could also check located in/on physical feature (P706). Thanks. Mike Peel (talk) 22:27, 28 August 2018 (UTC)
@Mike Peel and Rama: yer, that works, it seems. Following Sully Wing (Q17309954):
It would be a big help if folks had a chance to test it out on a number of test cases and let me know if any problems arise. Cheers --RexxS (talk) 23:16, 28 August 2018 (UTC)
@RexxS: I've added it to {{Wikidata Infobox/sandbox}} (it now basically replaces {{Wikidata location}}) and have been testing it in a few categories. Using it at Category:Lovell Telescope / Lovell Telescope (Q555130) throws an error, though - "Lua error in Module:WikidataIB at line 1002: attempt to index field 'datavalue' (a nil value)." Thanks. Mike Peel (talk) 23:31, 28 August 2018 (UTC)
@Mike Peel: That's because the geniuses over at Wikidata decided that United Kingdom (Q145) is located in/on physical feature (P706) of British Isles (Q38272), which is located in/on physical feature (P706) of Europe (Q46), which is located in the administrative territorial entity (P131) of no value. I've simply disabled following located in/on physical feature (P706) for now, as we really don't want this sort of crud:
Eventually some clever bugger will link Europe as located in/on physical feature (P706) of Earth (Q2), which has a location (P276) in the Solar System (Q544), which is already located in/on physical feature (P706) of the Orion Arm (Q33187), which is is already located in/on physical feature (P706) of the Milky Way (Q321), which is located in the Local Group (Q3944), located in the Virgo Supercluster (Q175760) or the Laniakea Supercluster (Q17863945), etc. eventually finding itself located in the Universe (Q1). That will embiggen your infoboxes somewhat. Hopefully, I'll have figured out how to stop the chain at an appropriate place before that particular apocalypse occurs. I'll put some more thought into it. --RexxS (talk) 18:29, 29 August 2018 (UTC)
[Update] I figured that we could also terminate the chain when the item is an instance of (P31) of country (Q6256), so I've re-instated P706 and implemented that termination condition. A side-effect is that we can find higher-level chains now:
What's not to like about that, eh? You radio-astrologers will be over the moon about it. --RexxS (talk) 19:12, 29 August 2018 (UTC)
@RexxS: Looks good. It's now live, let's see how it goes. Thanks. Mike Peel (talk) 21:37, 29 August 2018 (UTC)

A huge thank you to all for your attention, your swift answer, your impressive efforts and for the splendid solution! Rama (talk) 06:26, 29 August 2018 (UTC)

I've noticed for some time that located in/on physical feature (P706) is no longer displayed (See i.e. Dagmarsgade watertower (Q12307030)) Do you have plans to reinstate it? --Hjart (talk) 12:57, 4 September 2018 (UTC)
@Hjart: It should still display, but only if located in the administrative territorial entity (P131) isn't present. Thanks. Mike Peel (talk) 13:22, 4 September 2018 (UTC)
Ok, I understand. I added it here because the smallest administrative area here is quite a bit a larger than the town this example is in, so for a lot of cases in Denmark I'd really like to have both though. --Hjart (talk) 13:36, 4 September 2018 (UTC)
This section was archived on a request by: Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 13:51, 7 June 2019 (UTC)

Aircraft registration

{{Editprotected}} Please add a line to display property P426 (aircraft registration) with date qualifiers. This will allow WD Infobox to supercede Template:Individual aircraft. Thanks, Josh (talk) 16:38, 5 September 2018 (UTC)

@Joshbaumgartner: Done, how does that look? I can run a bot through the existing uses of {{Individual aircraft}} to move them over to the infobox, if you'd like. Thanks. Mike Peel (talk) 23:24, 5 September 2018 (UTC)
@Mike Peel: It looks perfect, thanks, and in fact a bot job to go through them would be fantastic! By the way, I really appreciate the infobox and I know you've put a lot of work into it, so, thank you! Josh (talk) 06:51, 6 September 2018 (UTC)
@Joshbaumgartner: I've run the bot through the ones that are linked to from Wikidata (and added the sitelinks for the others that I could). There are still a few that the bot couldn't migrate as their wikidata entries are already linked to another item, perhaps you could have a look through those manually? Thanks. Mike Peel (talk) 22:25, 6 September 2018 (UTC)
@Mike Peel: No problem, I can take care of the sticky ones. There are some aircraft which have multiple categories on Commons but one entry on Wikidata. Thanks! Josh (talk) 22:28, 6 September 2018 (UTC)
Moin Moin Josh, is this part done? Could you then please set {{Section resolved|1=~~~~}} to this part? Thanks --Crazy1880 (talk) 13:06, 28 April 2019 (UTC)
This section was archived on a request by: Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 13:51, 7 June 2019 (UTC)

Text wrap

@Mike Peel: Mass implementation of Wikidata Infobox cause graphical disruption of category pages because the infobox pushes other templates, description and content of the category out of the screen. Some solution should be developed:

  • wrap text, all other templates and section titles around the infobox
  • a bot task which would manage pernamently an optimal order of templates and boxes to minimalize unwanted effects. --ŠJů (talk) 12:44, 8 September 2018 (UTC)
@ŠJů: Pi bot has been adding the templates below the last }} for this reason. I'm not aware of anything that can be done with the infobox code to fix this - the other templates' codes need to be fixed so that they no longer insist on 100% of the screen width (which is why browsers then display them below the infobox). Or hopefully the functionality of those templates is now in the infobox, and the other templates can simply be removed. Thanks. Mike Peel (talk) 19:32, 9 September 2018 (UTC)
Only several templates are fully replaced by Wikidata infobox. Some other (as "cat see also", "do not confuse", naviboxes, warning and maintenance templates etc.) should remain in the head of the page. --ŠJů (talk) 19:45, 9 September 2018 (UTC)
Most of those should work OK (e.g., {{Categorise}} can be put after the infobox and it displays fine). Others need to be fixed. If they use mbox, then I think the trick is to use auto width, e.g., see {{Categorise/layout}} (I don't know why that's not the default). Thanks. Mike Peel (talk) 19:57, 9 September 2018 (UTC)

@Mike Peel: As I noticed now, it is a problem with [Mark this page as patrolled] link. It displays below the infobox and pushes all content below. However, this problem affects "patrollers" only. --ŠJů (talk) 19:50, 12 September 2018 (UTC)

@ŠJů: I have patrol rights, and I see that link, but it appears to the left of the infobox for me, and doesn't push the content down... Can you link to a case where it does push it down for you? Maybe there's something else that's also going on there. Thanks. Mike Peel (talk) 20:27, 12 September 2018 (UTC)
@Mike Peel: File:Patrol link bug.jpg, Commons:Village pump#Infobox Wikidata interactions. --ŠJů (talk) 20:30, 12 September 2018 (UTC)
@ŠJů: Ah, you're using Monobook still. If I add "?useskin=monobook" onto the end of the URL, then I can reproduce the problem. If you want to try "?useskin=vector", then it should look OK. It seems to track back to a div.patrollink {clear: both;} *somewhere* in the CSS for Monobook - if that can be removed then the problem should go away. Thanks. Mike Peel (talk) 23:09, 12 September 2018 (UTC)
Found it - it's in the 'skins.monobook.responsive' module, see [2] (search for 'patrollink'). I have no idea what Mediawiki namespace page that corresponds to, though, so I don't know how to fix it. Thanks. Mike Peel (talk) 23:23, 12 September 2018 (UTC)
It seems that interaction with {{Commons nudity (category header)}} is also broken, e.g. Category:Clitoris. —⁠andrybak (talk) 02:17, 13 September 2018 (UTC)
@Andrybak: I think that's fixed with this edit. Thanks. Mike Peel (talk) 21:39, 23 September 2018 (UTC)

@Mike Peel: It’s defined at phab:diffusion/SMNB/browse/master/resources/screen-common.less;ac0ac079baf2$262 and has been added in phab:rMW01eb893b778d. In phab:T14857, it was said to be an issue that floating boxes float past the patrol link. (It’s Monobook skin itself, patches can be submitted using Gerrit.) —Tacsipacsi (talk) 16:26, 13 September 2018 (UTC)

@Tacsipacsi and ŠJů: I've filed a bug report on phabricator at phab:T205230. Thanks. Mike Peel (talk) 21:47, 23 September 2018 (UTC)
This section was archived on a request by: Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 13:51, 7 June 2019 (UTC)

Integrating {{VN}}

@Liné1: I'm trying to embed {{VN}} into the infobox, but have run into a couple of problems. For the implementation, see [3]. However, at Hymenaster the VN module gives the error "Error: Incorrect parameter(s) "qid"" - can that be fixed? Also, for cases where there are many VNs, can you implement show/hide, like is done at Category:Iron Man (film) for "Cast member"? Also pinging @Christian Ferrer to be aware of this discussion. Thanks. Mike Peel (talk) 22:53, 24 September 2018 (UTC)

Hello Mike Peel
You needed an intermediary template like {{VNNoDisplay}} because Module:Wikidata4Bio reads the calling templates parameters.
I will see later if we can improve the display.
Regards Liné1 (talk) 20:02, 25 September 2018 (UTC)
Thanks! If possible, suppressing the "No common name has yet been provided in this user nor in wikidata 'Dytaster'" text would be good (that way the row just doesn't show in the infobox). Thanks. Mike Peel (talk) 20:55, 25 September 2018 (UTC)
I think {{VN}} or/and "common name" should be removed from the infobox, see User:Christian Ferrer/sandbox3. Christian Ferrer (talk) 12:35, 30 September 2018 (UTC)
@Christian Ferrer: I've added show/hide for that line in {{Wikidata Infobox/sandbox}}, which is set to be hidden by default. Does that improve things? Thanks. Mike Peel (talk) 13:37, 30 September 2018 (UTC)
Yes it does a lot, IMO you can replace by taxon common name (P1843) by this collapsible VNNoDisplay, but not the both in order to avoid the redundancy. Christian Ferrer (talk) 16:12, 30 September 2018 (UTC)
@Liné1 and RexxS: There is still an issue here that when VN returns nothing, the line still shows in the infobox. Live example is at Hymenaster, where {{Wikidata Infobox/sandbox/line {{!}} Q502895 |2={{VNNoDisplay|useWikidata=Q3463442}}| showhide=y}} returns
[[:Template:Wikidata Infobox/sandbox/line|{{Q502895
Some sort of hidden character must be being returned in order to pass the if statements, which remains even using {{Trim}}. Any ideas? Thanks. Mike Peel (talk) 13:57, 19 October 2018 (UTC)
Aah, that actually returns values ... so something else is wrong here, potentially the inclusion of the template in the line template... More investigation needed. Thanks. Mike Peel (talk) 14:00, 19 October 2018 (UTC)
@Mike Peel: Is it the hidden category Category:Biology pages with wikidata item specified in VN or perhaps Category:Interwiki from wikidata - both of which are being generated by the {{VNNoDisplay|useWikidata=Q3463442}} in this section. Preferences → Appearance → Advanced options → Show hidden categories. Cheers --RexxS (talk) 16:32, 19 October 2018 (UTC)
That could be it ... it doesn't look like the 'nocat' parameter does much, sadly. I suspect the Lua code needs some work... Thanks. Mike Peel (talk) 17:21, 19 October 2018 (UTC)
This section was archived on a request by: Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 13:51, 7 June 2019 (UTC)

Wikidata infobox in "categories"

Hi! When showing data from a "category item"... would it be possible borrowing a locator map image (P242) value from another item, linked in category combines topics (P971) (and displaying the map in the infobox, of course)?

Thus, maps such as these could be removed here in Commons. Strakhov (talk) 20:45, 10 October 2018 (UTC)

 Comment Nah. I "semi"withdraw the proposal, since category contains (P4224) is apparently the way-to-go with regard to describing categories in Wikidata. Strakhov (talk) 13:16, 11 October 2018 (UTC)

Per above: Would it be possible showing category contains (P4224) instead of category combines topics (P971) in the infobox? Here, for example Category:Fountains in Paris / d:Q8470436. It would need displaying subject ("P4224 item") and predicate ("qualifier property name"+"qualifier value"). That would lead to...

"fountain" + "located in the administrative territorial entity" + "Paris"
"Fântână" + "situat în unitatea administrativă" + "Paris"
"fontanna" + "znajduje się w jednostce administracyjnej" + "Paryż"

...(sort of automatic category name translation). Strakhov (talk) 15:01, 13 October 2018 (UTC)

This section was archived on a request by: Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 13:51, 7 June 2019 (UTC)

P669 implementation (and P969)

Hi, if I understand correctly, current located on street (P669) implementation is fetching label of the street only. I think it would be nice to have also link to a street category in a case of presence of located on street (P669) only, but even in a case of presence of both located on street (P669) and P969 (P969). I am not sure about how to implement the second case, maybe real splitting "located at street address" row to "located at street address" and "located on street" can be the solution.--Jklamo (talk) 09:19, 17 October 2018 (UTC)

This section was archived on a request by: Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 13:51, 7 June 2019 (UTC)

Wrong image

Have a look at Category:Stemmen (Landkreis Rotenburg). There's a picture in the infobox that is from a different place called "Stemmen". The image is not in the Commons category and also not on Wikidata, so the error must be in the template, I guess!? --Slomox (talk) 11:28, 7 June 2019 (UTC)

Moin Slomox, nee, mit Wikidata ist alles richtig in die Box gekommen. Wenn du dir das verknüpfte Wikidata-Objekt aufruft und dann auf "Thema der Kategorie" schaust, ist Stemmen hinterlegt. Das ist das Thema. Wenn dann müsste da etwas anderes verbunden werden. --Crazy1880 (talk) 12:29, 7 June 2019 (UTC)
Danke! Ich habe die beiden Wikidata-Objekte von Kategorie und Ort verwechselt und deswegen den Fehler nicht erkannt... Ich habe es korrigiert. --Slomox (talk) 12:36, 7 June 2019 (UTC)
Okai, ich habe noch einmal den Seitencache geleert, Bild ist raus ;) mfg --Crazy1880 (talk) 12:48, 7 June 2019 (UTC)
This section was archived on a request by: Crazy1880 (talk) 12:48, 7 June 2019 (UTC)

Sortkey for (surname) category

Hi, just wondering how I can fix the sorting for Category:Berenice Abbott in Category:Abbott (surname) (for example). I come across these at times, and I thought maybe it has to do with the fact that she did not have a given name property, which 1) existed and 2) I added, but that didn't fix it? Thanks, -- Deadstar (msg) 15:34, 12 June 2019 (UTC)

@Deadstar: You fixed it correctly, but the cache was stale. I've made a null edit to the category (click 'edit', then save without making any changes), and that's refreshed the cache, and the sort order in the category. Thanks. Mike Peel (talk) 16:21, 12 June 2019 (UTC)
Ah, perfect! Thank you. -- Deadstar (msg) 22:31, 12 June 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Crazy1880 (talk) 08:03, 23 June 2019 (UTC)

Hard to distinguish multiple values

Eastern
European
Time
Central
Africa
Time
Israel time
zone
South
African
Standard
Time

I noticed this problem at Category:UTC+02:00, where the "Said to be the same as" items are hard to distinguish from each other (see right for how I see it in my browser), but it applies to other properties, as well. When there are multiple items listed under one property, there is no visual indication of where one item ends and the next begins. This is particularly problematic when (as here) the items are getting wrapped across muliple lines and capitalization cannot be used to visually separate the items. This needs improving. - dcljr (talk) 03:47, 5 June 2019 (UTC)

@Dcljr: Does it look better with commas separating each point, rather than new lines? See the version currently in Category:UTC+02:00. Thanks. Mike Peel (talk) 07:36, 5 June 2019 (UTC)
Sure, but what if the items themselves contain commas? (I can't provide an example at the moment). Perhaps a parameter could be added to specify a separator (or an override to a default separator). Hmm… What if different separators are necessary on different properties? This could get very complicated! (But, yeah, I do prefer the commas in this particular case.) - dcljr (talk) 08:38, 5 June 2019 (UTC)
@Dcljr: It's even more complicated than that. What separators make sense when the infobox is displaying Chinese or Japanese characters, for example? A new line is the simplest option, maybe a comma is the next simplest. Thanks. Mike Peel (talk) 20:24, 5 June 2019 (UTC)
Eastern
European
Time
Central
Africa
Time
Israel time
zone

South
African
Standard
Time

There's already a "newline" at the end of each item (I assume, since they are "‎<li>" elements). Do you mean a blank line (i.e., additional vertical whitespace)? As for non-Latin based languages, as you know, each has it's own convention(s) for separating items in a list (for example, there is a Japanese comma: 、). Anyway… other comparatively "language agnostic" options include middots [•] and horizontal rules of some sort (see left for a simple example). - dcljr (talk) 00:42, 6 June 2019 (UTC)
  • Personally, I tend to use ";" or " // ".
    Maybe some "different from" don't need to be displayed in the infobox, e.g. the statement pointing to an item for disambiguation pages at Category:John (given name) (same on every other category for given names).
    Besides that, personally I wouldn't mind smaller print for some of the infobox content. Jura1 (talk) 12:03, 6 June 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. - dcljr (talk) 00:42, 25 June 2019 (UTC)

New properties to add ?

Hi! IMHO it would be nice having crosses (P177) & carries (P2505) included in the template, for categories of bridges mostly. Thanks in advance! Strakhov (talk) 13:22, 7 June 2019 (UTC)

Moin Moin Strakhov, on witch position you want to show this? Do you habe an example article, where I can look for the right position? Thanks --Crazy1880 (talk) 17:36, 8 June 2019 (UTC)
Hi, @Crazy1880: . I do not have a strong preference on the position issue. Let's say being displayed above dates would be fine. An example would be Category:Puente de la Constitución de 1812. La Constitución de 1812 Bridge (Q6464357). Cheers. Strakhov (talk) 21:10, 18 June 2019 (UTC)
Moin Moin Strakhov, Please try {{Wikidata Infobox/sandbox}} and give me a feedback. Thanks --Crazy1880 (talk) 08:17, 23 June 2019 (UTC)
Hi, @Crazy1880: . It works nice. Thanks, Strakhov (talk) 08:42, 23 June 2019 (UTC)
Moin Strakhov, its live --Crazy1880 (talk) 05:24, 25 June 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Crazy1880 (talk) 05:24, 25 June 2019 (UTC)

Hi,

Something is strange on Category:Grand Rond (jardin) the coordinates are correct on Wikidata (and precision is also correct apprently, I put a greater precision and purge but it doesn't change anything) but for some reason the coordinates seems incorrect when reused on Commons... @Mike Peel:

Cheers, VIGNERON (talk) 11:19, 21 July 2019 (UTC)

@VIGNERON: I can't see the problem? The coordinate displays here as "43° 36′ 00″ N, 1° 27′ 00″ E", which is the same as in Grand Rond (Q3114560), and the map looks the same. Are you sure it's not a caching issue? Thanks. Mike Peel (talk) 11:59, 21 July 2019 (UTC)
Well, to be honest I was a bit lost and there seems to be indeed some caching issue on top of it. The correct coordinate is "43° 35′ 44.88″ N, 1° 27′ 9″ E" but there was something wrong with the precision on the Wikidata side (original walue was 43.5958 1.4525 0.01 which is incorrect, I changed it to 0.0001 but it changed the lat and long too for some reason and because of the cache I didn't saw it). It seems to be ok now. Cdlt, VIGNERON (talk) 12:14, 21 July 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. VIGNERON (talk) 12:14, 21 July 2019 (UTC)

Coexistence with another templates

Hi everyone,

I am adding Wikidata infoboxes, but doing this task I have noticed that the infobox already has many data that it is in another templates (e.g., {{Object location}}). So my question is, what we have to do if the Wikidata infobox already has the data that it is in another template (like the one mentioned)? This can be observed in this category.

And, another case of coexistence. Should be the multilingual descriptions templates (e.g., {{Es}} or {{En}}) being removed from the category if it doesn't contribute considerably to explain the category?

I did a fast reading of the FAQ but I didn't find the answers to my questions. If someone might help me to clarify this, I would be very thankful.

Regards, Ivanhercaz (talk) 12:10, 23 June 2019 (UTC)

@Ivanhercaz: My view is that it's best to remove those templates where they duplicate what's now provided through the infobox. Others probably disagree, though. Thanks. Mike Peel (talk) 16:04, 23 June 2019 (UTC)
@Mike Peel: Thank you for your comment! I have your point of view: if those templates have the same data than the ones shown in the infobox, the additional templates should be removed. But I wanted to be sure that more users are making this. I am going to remove those kind of templates.
Regards, Ivanhercaz (talk) 17:45, 23 June 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 08:43, 28 July 2019 (UTC)

Lines in map

I noticed that sometimes there are white lines in the dynamic map of the infobox. This is due to the templatestyle:

#wdinfobox img {
    max-height: 250px;
    width: auto;
}

The tiles of the map are larger than 250px. The css should be made more specific, so that it doesn't accidently match the map tiles. —TheDJ (talkcontribs) 10:54, 25 July 2019 (UTC)

@TheDJ: Can you suggest some new code? The sandbox is at Template:Wikidata Infobox/sandbox/styles.css. Thanks. Mike Peel (talk) 16:45, 25 July 2019 (UTC)
@TheDJ: Thanks! I've made the change live. Thanks. Mike Peel (talk) 08:40, 28 July 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 08:40, 28 July 2019 (UTC)

Customizing displays of contents of Wikidata infoboxes used in the Commons

Hi, guys!

At Ottoman Empire I want to customize the display of infobox contents from Wikidata based on language.

In Turkish I want "Edirne" to display as only such, but in other languages to display as "Adrianople (Edirne)". This is because the city was known as Edirne in Turkish but Adrianople in French. Is it possible to customize displays of contents by language in this way? WhisperToMe (talk) 15:09, 25 July 2019 (UTC)

@WhisperToMe: That's not possible / not going to happen. If you want language-specific changes, then you should make them on Wikidata. Thanks. Mike Peel (talk) 16:44, 25 July 2019 (UTC)
Thanks for the answer! I noted the answer at Wikidata:Wikidata:Project_chat#How_to_display_names_for_the_capitals_of_the_Ottoman_Empire? WhisperToMe (talk) 17:34, 25 July 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 08:38, 28 July 2019 (UTC)

Award received field

See Category:Rickie Lee Jones: "Award received Grammy Award for Best New Artist (Christopher Cross, A Taste of Honey, 1980)". That's three consecutive Grammies crammed together - A Taste of Honey (1979), Rickie Lee Jones (1980), Christopher Cross (1981). The wikidata record seems correct; it has follows and followed by qualifiers, and these are displayed here as part of Rickie Lee's award. Retired electrician (talk) 23:27, 15 January 2019 (UTC)

Sometimes I think the Wikidata infobox is trying to become a mini Wikipedia article unto itself. There are a lot of fields that have no use in helping people find media on Commons (e.g. factoids with no links). The data-obsessed overlords continue to pad it, and we're stuck with it. --Animalparty (talk) 00:40, 16 January 2019 (UTC)

@Mike Peel: Hi Mike, simply change |qual=ALL by |qual=P585 for field "Award received", when you have the chance. Thanks Laddo (talk) 03:14, 16 January 2019 (UTC)

Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Laddo (talk) 04:01, 4 August 2019 (UTC)

Removal of interwiki links

Hi everyone, there are several categories with WD-Infobox and interwiki links.[4]. Is it ok to remove them with a bot, if the same link comes from WD? --Arnd (talk) 07:27, 16 December 2018 (UTC)

@Aschroet: They should no longer be needed (and will only rot over time as pages elsewhere get moved around) so I'd say go for it. I know @Gabrielchihonglee: and @Zhuyifei1999: were working on this with Gabrielchihonglee-Bot, but I'm not sure if that's running at the moment. I guess if you can bot-work through the ones that you can, we can start working through the remaining ones manually using that search query. Thanks. Mike Peel (talk) 16:51, 16 December 2018 (UTC)
if there is maybe an already working bot in place i will wait. --Arnd (talk) 20:11, 16 December 2018 (UTC)
The bot seems hang since 2018-10-02 19:40:32. I restarted it. --Zhuyifei1999 (talk) 21:20, 16 December 2018 (UTC)
Zhuyifei1999, seems that it do not really run longer this time. Maybe something has to be fixed. --Arnd (talk) 06:10, 17 December 2018 (UTC)
@Aschroet: Could you clarify? It seems still running to me. It scans the dumps so each scan can take a long time (like a day). --Zhuyifei1999 (talk) 07:26, 17 December 2018 (UTC)
Zhuyifei1999, i just checked Special:Contributions/Gabrielchihonglee-Bot and saw the edits stopped and that only very few interwiki link edits took place. --Arnd (talk) 08:19, 17 December 2018 (UTC)
Hmm... Looking at the current situation, am I correct that this template {{Wikidata Infobox}} no longer calls {{Interwiki from Wikidata}}? The bot only works on pages that transcludes the latter, and with the current scheme, invocation of Module:Wikidata alone is not sufficient evidence that Module:Wikidata.interwiki is called, and very complex logic might have to be added to figure out the parameters that are used to invoke the Lua module. I can notify Gabriel to extend the bot, but I don't understand why this separation is done. CC @Mike Peel: --Zhuyifei1999 (talk) 18:06, 17 December 2018 (UTC)
@Zhuyifei1999: It now calls Module:Interwiki directly, which removes a dependency on the template, and means that the tracking category at Category:Uses of Wikidata Infobox providing interwiki links can be populated (to try to see which cases are using the infobox, and which aren't yet but could in the future). If you can check to see if Module:Interwiki is called, that should be sufficient. Thanks. Mike Peel (talk) 18:27, 17 December 2018 (UTC)
Ok I'll notify Gabriel. We are in different timezones so it'll probably be a few hours / tomorrow before I get a chance to catch him. --Zhuyifei1999 (talk) 19:09, 17 December 2018 (UTC)
@Aschroet: should be fixed for now. Updated the script to look for interwiki links provided by Module:Interwiki --Gabrielchihonglee (talk) 05:36, 18 December 2018 (UTC)
Gabrielchihonglee, seems to work fine. Thank you. However, can it be that your bot only considers interwiki links of languages with two letter codes. I ask because of the remaining links as for example here: [5]. --Arnd (talk) 15:09, 18 December 2018 (UTC)
@Aschroet: This is an old bug relating to some leftover inconsistent state in wikimedia configuration / database from the be-x-old -> be-tarask move. So as far as pywikibot is concerned, neither be-x-old nor be-tarask is an interlanguage prefix. --Zhuyifei1999 (talk) 18:14, 18 December 2018 (UTC)
As far as I know that is the only exception. Other codes should work fine (eg). --Zhuyifei1999 (talk) 18:16, 18 December 2018 (UTC)
The bot ran out of memory. I increased the memory threshold and reran it. @Gabrielchihonglee: FYI. --Zhuyifei1999 (talk) 23:19, 18 December 2018 (UTC)
Did the bot finish the task? I ask because i want to clean up the remaining iw-links. --Arnd (talk) 11:05, 25 December 2018 (UTC)
No, not yet. The bot was restarted a few days ago due to venv rebuilding, with a Python version upgrade. --Zhuyifei1999 (talk) 12:39, 27 December 2018 (UTC)
Seems that the bot does not do mass edits anymore, only a few over the last days. --Arnd (talk) 07:55, 4 January 2019 (UTC)
Yeah, it was running through its second run (I think). --Zhuyifei1999 (talk) 08:10, 4 January 2019 (UTC)
A lot of the remaining langlinks are on those categories that link directly to an article item on Wikidata. Gabriel's bot won't remove them since they aren't expanded by Module:Interwiki, and my bot won't remove them because they are cross-namespace. They need some help on Wikidata side (probably Pi bot?). --Zhuyifei1999 (talk) 15:30, 4 January 2019 (UTC)
Zhuyifei1999, is it really so? When i run the search query from the beginning of this thread and randomly chose some categories like e. .g. Category:Lower South Falls (Silver Falls State Park), Category:Küssow family, Category:St Kieran's College i don't see a reason why the bot cannot remove the iw-links. Can you give an example category to what you have said? --Arnd (talk) 21:48, 4 January 2019 (UTC)
@Aschroet:
oh and to clarify, neither of the two bots edit Wikidata. They rely on Wikidata being in a good state before they are 'confident enough' to perform its tasks. We have bots like Pi bot that I link is fixing these category <-> article linking on wikidata, but since I haven't really looked at how that bot (or pretty much any other wikidata bot) works, @Mike Peel: --Zhuyifei1999 (talk) 02:39, 5 January 2019 (UTC)
@Zhuyifei1999: Can you drop the cross-namespace exclusion from your bot (or at least the category -> article part)? That doesn't really make sense, since category items here correspond with articles on Wikipedias, and there's no plan to mass-create category items just for a commons sitelink that currently sits well in the topic item (pi bot just makes use of category items that already exist). Thanks. Mike Peel (talk) 07:45, 5 January 2019 (UTC)
@Mike Peel: I'm thinking of this scenario: say if my bot removes such link on a category page, but the page does not call Module:Interwiki; later, someone moves the sitelink on wikidata from the topic item to a category item, then the category page would no longer have langlinks to wikipedia articles... which would be bad. How about this: I'll make it drop this requirement iff the page calls Module:Interwiki? --Zhuyifei1999 (talk) 07:55, 5 January 2019 (UTC)
@Zhuyifei1999: The infobox should automatically deal with that scenario by including Module:Interwiki if it becomes necessary (providing P301 is present, as there's an if statement that then invokes the module), so I don't think that situation's something we need to worry about. Thanks. Mike Peel (talk) 08:04, 5 January 2019 (UTC)
@Mike Peel: I mean, what if the category does not transclude infobox? --Zhuyifei1999 (talk) 08:06, 5 January 2019 (UTC)
@Zhuyifei1999: We're at the point where nearly every category linked to wikidata has an infobox, so that shouldn't be a frequent issue. But how about removing them iff the category calls the infobox? Thanks. Mike Peel (talk) 08:34, 5 January 2019 (UTC)
✓ Done and re-submitted the job. Let's see how it goes --Zhuyifei1999 (talk) 09:11, 5 January 2019 (UTC)

Hm, not many activities of Gabrielchihonglee-Bot and YiFeiBot the last days although many iw-links remaining. --Arnd (talk) 09:03, 20 January 2019 (UTC)

Gabrielchihonglee-Bot seems to have logged out (we are investigating). YiFeiBot... I just fixed a bug in it a few days ago and it is now doing much more --Zhuyifei1999 (talk) 19:59, 28 January 2019 (UTC)
@Zhuyifei1999: Just to say thank you for working on this! Please keep it up. :-) Thanks. Mike Peel (talk) 23:21, 28 January 2019 (UTC)

@Aschroet: YiFeiBot finally finished one complete run. Your search query... doesn't work any more (not sure if coincidence) --Zhuyifei1999 (talk) 02:21, 23 February 2019 (UTC)

Finished second run. Now returning to the weekly schedule --Zhuyifei1999 (talk) 22:16, 25 February 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Laddo (talk) 23:37, 5 August 2019 (UTC)

UK locations

This displays place, district, local government county and ceremonial county so some of the names are there twice - "Lancaster, Lancaster, Lancashire, Lancashire". For the first repetition it would be better to display the name used in the category for the district if possible; for the second there is one with no category which is unnecessary. Another problem is that North Yorkshire (ceremonial county) is in two regions - Wikidata uses "applies to" for this but it looks like the infobox displays North East England for all, when it only applies to the part formerly in Cleveland. Peter James (talk) 20:10, 4 January 2019 (UTC)

@Peter James: Can you point to some example categories/wikidata items, please? Thanks. Mike Peel (talk) 20:17, 4 January 2019 (UTC)
The first (Category:Lancaster Castle) shouldn't have been there and I've corrected in the Wikidata page but there are others such as Category:Lichfield Cathedral and Category:St Helen's Church, Sefton. Category:Skipton Castle is an example of the second, and of the region error. There are also Category:Borough of North Lincolnshire and Category:Borough of North East Lincolnshire which are in Yorkshire and the Humber, not East Midlands. Peter James (talk) 20:57, 4 January 2019 (UTC)
@Peter James: According to Wikidata: Lichfield Cathedral (Q510389) is located in the administrative territorial entity (P131) of Lichfield (Q207371), which is located in the administrative territorial entity (P131) of Lichfield (Q1823259), which is located in the administrative territorial entity (P131) of Staffordshire (Q21694786), which is located in the administrative territorial entity (P131) of Staffordshire (Q23105), which is located in the administrative territorial entity (P131) of West Midlands (Q48038), which is located in the administrative territorial entity (P131) of England (Q21), which is located in the administrative territorial entity (P131) of United Kingdom (Q145), which is an instance of (P31) of a country (Q6256).
So the call that follows that chain gives: Lichfield Cathedral, Lichfield, Staffordshire, West Midlands, England. I have difficulty constructing an algorithm that is smart enough to eliminate all duplicates, unless someone can produce an exhaustive list of the instances (like ceremonial county of England (Q180673)) that should never be displayed.
When you try to change the located in the administrative territorial entity (P131) value on Wikidata to skip the inaccurate ones, you get reverted because apparently it's more important to be able to find places in the city or ceremonial area than it is to accurately portray what an administrative territorial entity is.
According to Wikidata, Skipton Castle (Q7535853) is located in the administrative territorial entity (P131) of Craven (Q1139085), which is located in the administrative territorial entity (P131) of North Yorkshire (Q21241814), which is located in the administrative territorial entity (P131) of North Yorkshire (Q23086), which is located in the administrative territorial entity (P131) of North East England (Q47983), but is also located in the administrative territorial entity (P131) of Yorkshire and the Humber (Q48063). That means the algorithm that follows the located in the administrative territorial entity (P131) chain needs to read multiple values at each step whenever they exist, and then look back at the applies to part (P518) to find which one is correct. That's quite a bit more work, so it may take time to implement. --RexxS (talk) 16:14, 5 January 2019 (UTC)
@RexxS: Perhaps a way to simplify the string a little might be to check if the next string is the same as the previous string, and to not display it if it is (or, if one has a link but the other doesn't, to display the one with the link? That would avoid things like "Staffordshire, Staffordshire". Thanks. Mike Peel (talk) 17:06, 5 January 2019 (UTC)
@Mike: I considered that, but then had reservations about displaying the ceremonial county Staffordshire (Q23105), which is linked, rather than the administrative entity Staffordshire (Q21694786), which isn't. But if you think it's okay, I'll implement the logic of testing whether a location is the same as the previous location in the chain, then displaying the one that is linked if there's only one linked, or picking one location if both are either linked or unlinked. Let's see how that goes. --RexxS (talk) 17:43, 5 January 2019 (UTC)
@Mike Peel and Peter James: [Update:] how does this look?
The repeated "Sefton" is because the first category is called Category:St Helen's Church, Sefton, and it's quite hard to do anything about that. In an infobox, the first one won't be displayed, though. I'll have a crack at the applies to part (P518) tomorrow. --RexxS (talk) 18:59, 5 January 2019 (UTC)
Thanks RexxS! this edit has removed the duplicate Sefton. Thanks. Mike Peel (talk) 19:28, 5 January 2019 (UTC)
Yes that's an improvement, but there's one thing I'm not sure about. There was another Sefton there, the civil parish which is called Sefton Village in Commons but "village" was missing as it isn't in Wikidata (or officially in the name). Should the district be changed to "Metropolitan Borough of Sefton" in Wikidata (and similar for Knowsley)? If not, could it be specified in Wikidata to use an alternative name here? Peter James (talk) 20:08, 5 January 2019 (UTC)
Feel free to edit Wikidata and change the labels to whatever you think best. Everybody else does. I don't think Wikidata will want to have an alternate name just for use on Commons. I'm not inclined to create a substitution lookup table in the code to change "Sefton" to "Sefton Village". How many villages would I have to have in the table to catch every one? --RexxS (talk) 20:42, 5 January 2019 (UTC)

[Update:] Some locations (like North Yorkshire (Q23086)) have multiple values for located in the administrative territorial entity (P131), etc. So I've implemented a check in the sandbox for qualifier applies to part (P518) to pick the right parent.

Selby (Q527846)
{{#invoke:WikidataIB |location |Q527846 |first=y}}Selby, North Yorkshire, Yorkshire and the Humber, England ✘[No]
{{#invoke:WikidataIB/sandbox |location |Q527846 |first=y}}Selby, North Yorkshire, Yorkshire and the Humber, England ✓[OK]
Immingham (Q1013574)
{{#invoke:WikidataIB |location |Q1013574 |first=y}}Immingham, North East Lincolnshire, Lincolnshire, Yorkshire and the Humber, England ✘[No]
{{#invoke:WikidataIB/sandbox |location |Q1013574 |first=y}}Immingham, North East Lincolnshire, Lincolnshire, Yorkshire and the Humber, England ✓[OK]

The logic has greatly complicated the algorithm in WikidataIB/sandbox|location, so it will need checking and monitoring when implemented. Cheers --RexxS (talk) 18:05, 12 March 2019 (UTC)

Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Laddo (talk) 23:39, 5 August 2019 (UTC)

Media legend for images

In case there is no "media legend" in English for images in Wikidata, why media legend for other language is shown on this template? For example in Category:Sus scrofa domesticus media legend is shown in Catalan language (Truja amb porcells), because it's the only language for this image in wikidata, but i would prefer to see media legend in English if there is one, or no legend at all. --Smooth O (talk) 13:10, 16 January 2019 (UTC)

I vote for no media caption displayed in any language. --Animalparty (talk) 14:19, 16 January 2019 (UTC)
I agree with you. Is there a possibility to remove it? One of the example can also be seen here with description in Greek (Category:Kastel fortress (Banja Luka)). --Smooth O (talk) 09:15, 31 January 2019 (UTC)
I disagree that captions should be removed. When used properly it establishes context and gives information about the subject. For instance, the age or location of the subject are information that should be display when the information is available. For certain countries like Norway, it's also mandatory by law and the practice of the language project to display attribution (photographers' moral rights). Toresetre (talk) 15:52, 31 January 2019 (UTC)
It's an incredibly annoying feature to have. More unfiltered data clutter. It should be self-evident that a portrait in a person's infobox is that person, and true-but-trivial info like the year or setting is just extraneous for the purpose of Commons. I'm sure some OCD, data-loving folks would want to add the photographer, historical context, and every minor thing in the image, which doesn't realistically aid users on Commons. It's even more useless when there are red-links inserted into the caption. If we MUST have this crud shoved in our faces, it should at least be hidden unless it's in the language specified by users. I don't want to see English captions, and I definitely don't want to see Swedish, Korean, or German captions. User:Mike Peel any thoughts? --Animalparty (talk) 20:23, 4 February 2019 (UTC)
I am hoping that the media legend can be replaced with the structured data on commons caption when that is accessible through Lua (hopefully later this year). Until then, the work-around is to add the media legend in your preferred language and/or English. Thanks. Mike Peel (talk) 20:43, 4 February 2019 (UTC)
File:Jean-Luc Picard as Borg.jpg
Your culture will adapt to service us. Resistance is futile.
Ah yes, Wikidata, the ever-hungry beast whose demands to be fed grow stronger every week. Caption me! Make categories! One day humans won't even need to write articles, or curate photographs, we'll just feed raw data into Wikidata, who will recreate the world in Its image. Everything in the universe controlled from a single point. Because individuality is inefficient. --Animalparty (talk) 02:28, 5 February 2019 (UTC)
I would like to respond to User:Animalparty's argument but it's so many straw man arguments there so I'll leave it be. In the meantime there are some good thoughts on how captions in infoboxes serves a purpose over at the English project's Manual of Style. Toresetre (talk) 09:42, 7 February 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Laddo (talk) 23:47, 5 August 2019 (UTC)

Years & months by start date

Can the template please add categories for the start day of each year and month?

For example to 2017 and Category:2017, add Category:Year starting on Sunday (or, if preferred, Category:Common year starting on Sunday; and to Category:January 2017, Category:January on Sunday (or, if preferred, Category:Gregorian January starting on Sunday)?

Note that 2017 (Q25290) has a instance of (P31) value of common year starting and ending on Sunday (Q235670).

The months' start days may need to be calculated; which is more complicated. Perhaps there is a library for this available online?

I started doing this manually then came to my senses ;-) Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 00:24, 2 February 2019 (UTC)

@Pigsonthewing: I think that should be relatively straightforward using {{#invoke:WikidataIB|checkvalue}}, but it's going to have to be a lookup table saying "if this QID is in P31, then add this category". Do you have a list of the QIDs for the items like common year starting and ending on Sunday (Q235670), and their corresponding categories? You would then need to make sure that the P31 value is set on Wikidata for all months/years, but that's a problems that someone else might be able to solve on Wikidata. Thanks. Mike Peel (talk) 09:38, 3 February 2019 (UTC)
It’s way easier without involving Wikidata: {{#time:l|1 February 2019}} → Friday. The category name can be tested using a regexp to decide whether it’s a month/year, or Wikidata can be used at this tiny part (searching for appropriate P31 values; I’d advise in this case wrapping the whole #time call in an {{#iferror:…}} guard, just in case the category name is not a valid date for some reason). I don’t see, however, why this categorization is useful at all, so I’d like to see some use cases before implementataion. —Tacsipacsi (talk) 19:35, 3 February 2019 (UTC)

@Mike Peel:

We might also usefully use Category:Leap year starting on Sunday etc., where applicable. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 11:10, 7 February 2019 (UTC)

@Mike Peel: Nudge ;-) @RexxS: Can you help? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 22:19, 9 April 2019 (UTC)

@Pigsonthewing: It's now in the sandbox for testing. @Tacsipacsi: Thanks for the suggestion, but I'm not keen to add more dependencies for the module, as it affects portability to other wikis. Thanks. Mike Peel (talk) 06:51, 30 July 2019 (UTC)
@Mike Peel: Thank you. worked as expected though on reflection I think all of the categories should be named as "Category:Common years starting on...", with plural "years". Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 13:09, 30 July 2019 (UTC)
This is now live. Thanks. Mike Peel (talk) 14:16, 14 August 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 14:16, 14 August 2019 (UTC)

Small request

Can you make the title of the Wikidata Infobox appear in bold type? I think that's more consistent with other infoboxes. - PKM (talk) 23:19, 21 April 2019 (UTC)

@PKM: Done. Thanks. Mike Peel (talk) 18:53, 23 April 2019 (UTC)
In my opinion, it's not an improvement. --Animalparty (talk) 20:04, 23 April 2019 (UTC)
I agree with Animalparty. Strakhov (talk) 18:21, 24 April 2019 (UTC)
I'm waiting for more comments here before keeping/removing this change. Thanks. Mike Peel (talk) 18:21, 2 May 2019 (UTC)

I'm keeping the change for now, if anyone wants to revisit this please start a new section. Thanks. Mike Peel (talk) 14:34, 14 August 2019 (UTC)

Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 14:34, 14 August 2019 (UTC)

P2009, etc.

Please add this sandbox change to the live version. Jura1 (talk) 17:14, 10 May 2019 (UTC)

Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 14:34, 14 August 2019 (UTC)

What is the the practical use for this autogenerated category. Do we need to categorize every single facet of the universe and shoehorn it into this ever more expansive template? --Animalparty (talk) 05:37, 18 May 2019 (UTC) Category:People frustrated by the ever more pointless expansion of Wikidata Infobox

@Animalparty: There were four cases where award received (P166) had been used instead of academic degree (P512). I've sorted those out [6] [7] [8] [9]. While you raise valid points, and I appreciate that you post them here, the tone that you use to do so is not acceptable. Please can you be more civil in the future? Thanks. Mike Peel (talk) 21:12, 20 May 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 14:33, 14 August 2019 (UTC)

bad coordinates

Mike, {{Wikidata Infobox}} in Category:New Town (Toruń) shows different locations on the map than location shown in d:Q11793603. --Jarekt (talk) 13:01, 19 May 2019 (UTC)

@Jarekt: this edit should have fixed it - in particular, the coordinate precision on Wikidata was malformed. Thanks. Mike Peel (talk) 13:37, 19 May 2019 (UTC)
So what was wrong with the old coordinates and their precision? I guess that Wikidata and your code used different approaches to rounding it up, and if you change precision from +-1 mile to +-3 meters there will be less discrepancy in rounding approaches. Most cities, countries, and other large regions should not use precision measured in meters. I do not know if the issue was with your map or with Wikidata map but they should look similar even if you have less precise location. --Jarekt (talk) 14:47, 19 May 2019 (UTC)
@RexxS: can you comment here? I'm guessing it's something along the lines of one rounding down, and another using the central value? Thanks. Mike Peel (talk) 06:55, 20 May 2019 (UTC)
@Jarekt and Mike Peel: Before Mike's edit, the coordinates given had a precision of 0.014930716856725. Wikidata stores its coordinates and precisions as decimal degrees, so that old value represents a distance of up to 1.6 kilometres. When WikidataIB retrieves a latitude or longitude, it rounds the value to a decimal number in line with the precision (see lines 240 to 260). The algorithm used is to round the precision to the nearest power of 10; then to divide the lat or long by that precision; then round the value to the nearest integer; then multiply that integer by the precision. That gives a decimal value truncated with no more significant figures than the precision suggests. This avoids spurious decimal places that are not warranted by the given precision. The effect can be visualised by imagining the area in question broken up into a grid of a size given by the precision. An object can then effectively only have a location at the intersection of these grid lines. Of course if you give a precision of more than a kilometre, it's not surprising that the point on the map shown could be a considerable distance away from the real location. Mike's edit reduced the size of the grid squares to around 3 metres, so you will get a building pretty much where you expect it to be. It would, however, be ridiculous to give that much precision to, say, the location of a mountain.
The other option would be to completely ignore the precision setting when retrieving coordinates, which would lead to New Town (Q11793603) displaying a longitude of 18.611639722222 deg W (an implied precision of around 70 nanometres). I think I prefer the current system of fixing nonsensical precisions on Wikidata by making them something sensible (which benefits everyone), rather than the alternative of displaying coordinates with ludicrous precisions. YMMV --RexxS (talk) 17:22, 20 May 2019 (UTC)
@RexxS and Mike Peel: , I was contacted by a a user who likes to set town location coordinates right in the central square (if one exist) so they look nice on Wikidata, and he did not like that his handcrafted coordinates were in a incorrect spot on identical looking maps on Commons. I am quite familiar with rounding based on precision as I do exactly the same in my Module:Coordinates. I think the little pin should be exactly in the same place as on map on Wikidata where the coordinates coming from however numbers displaying this location can (and should be) rounded to the correct precision so that we do not give impression of 1 m accuracy when we display location of a continent. Would that be acceptable? --Jarekt (talk) 20:05, 20 May 2019 (UTC)
@Jarekt: That all depends on what editors choose to consider "correct precision". If they decide to enter the location of a town's small central square with a precision of 300 metres (10 arcseconds), they shouldn't be too surprised if the pin shows up 200 metres away from the centre. I don't think it's our job to try to compensate for that sort of error. --RexxS (talk) 20:41, 20 May 2019 (UTC)
@RexxS: Users are surprised if map on Commons has a little tag at different location then almost identical looking map on Wikidata. As long as position on both maps is the same we should be fine. --Jarekt (talk) 02:17, 22 May 2019 (UTC)
@Jarekt: You can have the the little tag in the same place on any map if you ignore the precision. Retrieving the coordinates from Wikidata is not only used for maps but also for display as numeric values. Users are entitled to complain if we imply that the location of a building is known to less than a micron. --RexxS (talk) 03:10, 22 May 2019 (UTC)

I have just encountered this problem with Category:Sophia Gardens Pavilion, where the pushpin in the infobox was about 250 m away from the pushpin shown in the map in d:Q17020690. I fixed the problem by setting the Wikidata coordinate precision to 0.0001 (which I think is about 11 m). I have edited the Wikidata infobox help accordingly, please check this edit. Verbcatcher (talk) 23:01, 11 June 2019 (UTC)

Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 14:30, 14 August 2019 (UTC)

Inappropriate passing of categories

Hello! I'm not sure where would be best to post this if not here, but I've found an odd instance of the infobox inappropriately passing categories. In this specific case, for Category:Apollo 9 and Category:Apollo 12, their Wikidata pages include the Callsign parameter. For whatever reason, this is causing the Callsign's components (in this case, "Gumdrop *applies to part* Apollo Command/Service Module" and "Spider *applies to part* Apollo Lunar Module" for Apollo 9) to pass the Commons categories for Apollo Command/Service Module and Apollo Lunar Module on to the mission category. I know this is the *reason* these categories are showing up, but I don't begin to understand why Wikidata:Property:P2317 would be causing this. Any help would be appreciated, as this is obviously not a desirable behaviour. Huntster (t @ c) 01:59, 22 June 2019 (UTC)

From the empty parentheses, it’s pretty obvious that some code doesn’t prefix links intended to link to category pages with a colon. The only question is what code is this, but that will be answered by someone who knows this template more in detail than me. —Tacsipacsi (talk) 20:14, 22 June 2019 (UTC)
@Huntster and Tacsipacsi: Please try {{Wikidata Infobox/sandbox}} - hopefully this will have fixed it there. Thanks. Mike Peel (talk) 06:24, 23 June 2019 (UTC)
Mike Peel, yes, the sandbox fixes it. Thank you! I don't understand how that happened on the Wikidata side, but at least it won't impact things here. Huntster (t @ c) 08:10, 23 June 2019 (UTC)
@Huntster: OK, it's now live. The difference is in the coding here, while [[:Category:Blah]] displays a link, if it's [[Category:Blah]] then it's included in the category. If you still see this happening in other categories, try a null save (click edit then save without making changes) to see if that fixes it - if not, let me know. Thanks. Mike Peel (talk) 08:38, 23 June 2019 (UTC)
Sure, I know how the wikicode works; I just thought something weird was happening on the Wikidata side that caused our code to display in this manner. Sorry for the questions, I like to try and understand the whole of the problem in case I see it happening elsewhere and can avoid punting it to someone else. Huntster (t @ c) 13:57, 23 June 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 14:27, 14 August 2019 (UTC)

One more qualifier for "position held"

Hi, I believe it is worth improving the "position" field to fix occurrences such as position held (P39)=mayor (Q30185) with dates... and nothing else. See this case that shows:

It would be worth adding info from qualifier "of (P642)", to indicate for which entity the statement applies; I suggest changing the template code as follows:

position held -->{{Wikidata Infobox/line | P39 | {{#invoke:WikidataIB | getValue | rank=best | P39 | name=position held | linkprefix=":" | qlinkprefix=":" | list={{{liststyle|ubl}}} | qid={{#invoke:WikidataIB |getQid |qid={{{qid|}}} }} | spf={{{spf|}}} | fwd={{{fwd|ALL}}} | osd={{{osd|no}}} | noicon={{{noicon|yes}}} | qual=DATES P642,P580,P582,P585 | collapse=6}} }}<!--

To rather bring:

Thanks - Laddo (talk) 01:31, 26 June 2019 (UTC)

I made the change in the sandbox and tested with Category:Hans Rampf (Politiker). Pending deployment. Laddo (talk) 04:10, 4 August 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 14:24, 14 August 2019 (UTC)

Bug with P669

Bug with P669 (https://www.wikidata.org/wiki/Property:P669):

The value is no longer displayed, only the qualifier (if registered, for example street number (P670)) is visible.

Atamari (talk) 20:05, 28 June 2019 (UTC)

Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 14:23, 14 August 2019 (UTC)

value = unknown, with qualifier "stated as"

There was a thread somewhere about showing qualifiers when value is somevalue ("unknown"), but I have lost it.

Anyway, in the special case that there is a object named as (P1932) qualifier on a somevalue, it would be nice to show the P1932 qualifier text, rather than "unknown". This pattern is used a used as a fairly standard mechanism when there is no wikidata item for the value (and for notability reasons, probably won't be), but we know the name.

See eg the spouses in the infobox on Category:Fred Buchanan.

Thanks, Jheald (talk) 17:51, 12 July 2019 (UTC)

Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 14:20, 14 August 2019 (UTC)

Hello. Can this property be displayed? This is useful in archaeology, among other fields. Thierry Caro (talk) 06:56, 13 July 2019 (UTC)

@Thierry Caro: Implemented in {{Wikidata Infobox/sandbox}} - does that look OK? Thanks. Mike Peel (talk) 18:35, 17 July 2019 (UTC)
@Mike Peel: It's perfect. Thank you. Can we move that to the actual template? Thierry Caro (talk) 03:16, 29 July 2019 (UTC)
@Mike Peel: Can we get this when you are back? That would be perfect. Thierry Caro (talk) 00:25, 8 August 2019 (UTC)
@Thierry Caro: It's now live. Thanks. Mike Peel (talk) 14:11, 14 August 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 14:11, 14 August 2019 (UTC)

Translation

Please add a way to translate next phrases (into user interface language):

  • NO WIKIDATA ID FOUND!
  • Search for {{PAGENAME}} on Wikidata
  • Create new Wikidata item

--Kaganer (talk) 18:57, 15 July 2019 (UTC)

@Kaganer: This is #1 in the #Wishlist - can you suggest how we could do this? As it's text rather than Wikidata items, it's rather more difficult to translate this than the infobox content! Thanks. Mike Peel (talk) 18:23, 17 July 2019 (UTC)
@Mike Peel: See Template:Wikidata Infobox/i18n. --Kaganer (talk) 18:39, 17 July 2019 (UTC)
@Kaganer: That's interesting. Can you demo how that would be included in {{Wikidata Infobox/core/sandbox}} please? Is there a way to access the strings separately, e.g., if we wanted to add one in a different part of the infobox code? Thanks. Mike Peel (talk) 18:47, 17 July 2019 (UTC)
@Mike Peel: . See diff. This is some magic - translation items in the translatable page was named directly (instead default numbering - see code). Naming pattern is optionally, "msg-" prefix may be cleaned if desired.--Kaganer (talk) 19:33, 17 July 2019 (UTC)
Please note: with this way you cannot use <tvar> tag in the translatable page. --Kaganer (talk) 19:40, 17 July 2019 (UTC)
@Kaganer: Thanks for this! It's now live. Thanks. Mike Peel (talk) 14:11, 14 August 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 14:11, 14 August 2019 (UTC)

Infoboxes doesn't show all Items

The Infobox shows the values of wikidata:Property:P2789 espacially in Commonscats of streets and squares. It doesn't show alle items in Category:Albertplatz oder Category:Stresemannplatz, Dresden. Is it my fault or a bug? Greetings --Z thomas 09:09, 2 August 2019 (UTC)

@Z thomas: I can recommend the "Page Purge" gadget ;-) --Hjart (talk) 13:04, 9 August 2019 (UTC)
I can see all the items (11 and 8 respectively), so I think it's a caching error. I've made a null edit to the categories to see if that helps. If you still can't see all the items, can you try adding "?action=purge" to the category URL to clear the cache in your language? Thanks. Mike Peel (talk) 17:11, 2 August 2019 (UTC)
@Mike Peel: thanks. The purge worked. Greetings --Z thomas 06:55, 3 August 2019 (UTC)
@Z thomas: I can recommend the enabling the "Page Purge" gadget in your settings ;-) --Hjart (talk) 13:04, 9 August 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 13:37, 14 August 2019 (UTC)

preferred status for population

Somebody is removing the preferred status on poulation entries. Thats the effect: Category:Heilbronn. Is there a ule on WD how to record population information? We have the same problem on WV. -- DerFussi 18:34, 8 August 2019 (UTC)

@DerFussi: The editor that changed it was @Martin Urbanec: [10]. You may want to raise it at d:Wikidata:Project chat. Thanks. Mike Peel (talk) 19:34, 8 August 2019 (UTC)
I think that setting up maxvals=1 for population (P1082) should be reasonable as well to prevent further problems. Jklamo (talk) 09:11, 9 August 2019 (UTC)
I'm not sure that's a good idea, as there might be cases where several different values might want to be displayed with different qualifier clarifications. So I'm going to leave this as it is for now, if that's OK. Thanks. Mike Peel (talk) 13:37, 14 August 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 13:37, 14 August 2019 (UTC)

Wikipedia link

While there are already Wikipedia links in the Wikipedia sidebar, this template could have a link to the corresponding Wikipedia article in the current displayed language. This would advantageously replace the hard links currently seen in some categories. The RedBurn (talk) 09:39, 17 August 2019 (UTC)

@The RedBurn: It should already do so - there should be a link to Wikipedia and the other sister projects just below the image when there is a relevant sitelink. Is it not working in some cases? Thanks. Mike Peel (talk) 16:16, 21 August 2019 (UTC)
@Mike Peel: I guess I looked wrong, and then I checked the template which didn't show the link either. The RedBurn (talk) 10:39, 22 August 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 17:50, 24 August 2019 (UTC)

Hello. We should probably display this as it would be useful for mountain ranges, trails and whatever else. Thierry Caro (talk) 05:24, 18 August 2019 (UTC)

@Thierry Caro: It's now in the sandbox, please give it a go. Thanks. Mike Peel (talk) 16:34, 21 August 2019 (UTC)
@Mike Peel: It works fine. It's ready to be implemented. Thierry Caro (talk) 20:19, 21 August 2019 (UTC)
Trails would also benefit from having terminus (P559) displayed, by the way. Thierry Caro (talk) 11:23, 22 August 2019 (UTC)
Moin Moin Thierry Caro, it is in the sandbox, too. Please check this out. Regards --Crazy1880 (talk) 17:28, 22 August 2019 (UTC)
@Crazy1880: Works fine. Thank you. Thierry Caro (talk) 12:33, 26 August 2019 (UTC)
@Thierry Caro and Crazy1880: These changes are now live. Thanks. Mike Peel (talk) 18:19, 30 August 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 18:19, 30 August 2019 (UTC)

errors

They are timeout errors on the following pages, which strangely flicker on and off. Page sometimes shows timeout and sometimes does not.

--Jarekt (talk) 13:15, 23 August 2019 (UTC)

@Jarekt and RexxS: The thing they have in common is that they use a lot of country items - e.g. "France (Q142) Other (Statements), Some labels, Title" - and those are typically big Wikidata items. Is there any Lua optimisation that could be done to reduce the amount of information fetched for each country? Otherwise I can try setting maxval to a lower number, and removing some of the qualifiers. Thanks. Mike Peel (talk) 13:47, 23 August 2019 (UTC)
@Jarekt and Mike Peel: The problem is simply the time it takes to retrieve information from each country just to display a link when there are lots of countries. I checked Category:Teenage Mutant Ninja Turtles (2014 film) and found that an edit-preview took as much as 9 seconds out of the 10 seconds allowed before time-out. The cached view naturally didn't have the same problem. So I added |linked=no to the WikidataIB call in the line that does the publication date (line 476) in the sandbox. Using the sandbox version in Category:Teenage Mutant Ninja Turtles (2014 film) reduced the preview time to under 2 seconds at the cost of unlinking all of the countries in that huge list.
  • {{#invoke:WikidataIB | getValue | rank=best | P577 | name=publication | linkprefix=":" | qlinkprefix=":" | list={{{liststyle|ubl}}} | qid=Q9653404 | spf={{{spf|}}} | fwd={{{fwd|ALL}}} | osd={{{osd|no}}} | noicon={{{noicon|yes}}} | qual=ALL |linked=no}}
    • 3 August 2014 (Los Angeles)
    • 6 August 2014 (New York City)
    • 7 August 2014 (Azerbaijan, Chile, Hong Kong, Mexico, Malaysia, Peru, Russia, Singapore)
    • 8 August 2014 (Canada, Estonia, Iceland, Kazakhstan, Latvia, Norway, Poland, Taiwan, Vietnam, Sweden, United States of America)
    • 9 August 2014 (Kosovo)
    • 13 August 2014 (Indonesia, Philippines, Serbia)
    • 14 August 2014 (Albania, Argentina, Brazil, Colombia, Cambodia, Pakistan, Slovenia, Ukraine, Uruguay)
    • 15 August 2014 (Sri Lanka)
    • 21 August 2014 (Czech Republic, Netherlands, Slovakia, Thailand)
    • 22 August 2014 (Bulgaria, Finland, Romania)
    • 26 August 2014 (Seoul)
    • 28 August 2014 (Costa Rica, Hungary, South Korea, Lebanon, North Macedonia)
    • 29 August 2014 (Cyprus, Honduras, India, Lithuania, Nepal, Panama)
    • 3 September 2014 (Egypt, Kuwait)
    • 4 September 2014 (United Arab Emirates, Denmark, Croatia, Iraq, Jordan)
    • 5 September 2014 (Bangladesh, Turkey)
    • 11 September 2014 (Australia, Papua New Guinea)
    • 12 September 2014 (Venezuela)
    • 18 September 2014 (Switzerland, Italy, New Zealand)
    • 11 October 2014 (Scotland)
    • 15 October 2014 (Belgium, France, Luxembourg)
    • 16 October 2014 (Austria, Germany)
    • 17 October 2014 (Spain, United Kingdom, Republic of Ireland, Kenya, South Africa)
    • 22 October 2014 (Malta)
    • 23 October 2014 (Greece)
    • 30 October 2014 (Portugal)
    • 31 October 2014 (People's Republic of China)
    • 2 February 2015 (ward area of Tokyo)
    • 7 February 2015 (Japan)
You can see the difference in the above call by changing to |linked=yes. I couldn't do a permanent fix in the sandbox because it's presently unsynchronised. I suggest, though, that any field where you are likely to get more than about 50 linked items ought to compromise by unlinking those items. TMNT has about 80 countries in its publication date field.
I could make the code run faster by skipping the parts where it looks for a short name and where it uses the sitelink when available, etc. so that it just gets a label, but I'd need yet another parameter to turn on the skipping because folks asked for the present functionality. --RexxS (talk) 14:51, 23 August 2019 (UTC)
@Jarekt and RexxS: OK, I've updated the current version of the sandbox to unlink those items, and also collapse the list when it gets very long. I'll probably deploy the new version tomorrow after a bit more work, so please test it to make sure it looks OK! Thanks. Mike Peel (talk) 17:34, 24 August 2019 (UTC)

This is now live, hopefully that's fixed it! Thanks. Mike Peel (talk) 18:17, 30 August 2019 (UTC)

Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 18:17, 30 August 2019 (UTC)

Magnus tool leverages Infobox Data to add Depicts Statements

FYI, all, Magnus recently deployed a cat-a-lot like tool that allows you to add depicts statements that intuits the Q# from the Interwiki link, etc: User:Magnus_Manske/sdc_tool.js. Its really nifty, and very easy to use. Sadads (talk) 19:11, 20 September 2019 (UTC)

@Sadads: Great tool! Thanks for sharing! Do you know why it is so slow? Or is it just me? I just ran a set and it took me forever... Is there anything we can do about it? --Joalpe (talk) 20:20, 20 September 2019 (UTC)
@Joalpe: its quicker than Help:Gadget-ACDC -- but I think it has the same kind of challenge/opportunity that Quickstatements and other tools have in the Wikidata/Wikibase ecosystem: each edit is done through an API and probably throttled. @Magnus Manske: might be able to speak to that. Sadads (talk) 20:24, 20 September 2019 (UTC)
@Sadads, Magnus Manske, and Joalpe: "Depicts" statements cannot be used by templates, so I can't see the point in adding them right now. That will hopefully change when we can access the information via Lua, but I don't know when that might become available. Thanks. Mike Peel (talk) 21:02, 20 September 2019 (UTC)
Hi Mike: its less about the current utility and more getting a set of data that is useful once we have access to the SPARQL endpoint and tooling like Lua as you mention (both of which are on the SDC roadmap now). Just because we can't exploit it right now, doesn't mean that its useless. Sadads (talk) 21:24, 20 September 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 13:32, 28 September 2019 (UTC)

Error: Lua error in Module:Wikidata_label at line 24: attempt to call method 'getSitelink' (a nil value).

[11] --Arnd (talk) 18:08, 12 December 2019 (UTC)

Nothing to do with this template. It's being discussed at Module_talk:Wikidata_label#Lua_error_in_Module:Wikidata_label_at_line_24:_attempt_to_call_method_'getSitelink'_(a_nil_value).. Thanks. Mike Peel (talk) 18:29, 12 December 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 19:06, 14 December 2019 (UTC)

Could you please add the identifier of a National cultural monument in Slovakia (register of real estate NKP (P7170)) to the Infobox? Thanks --LacoR (talk) 12:35, 22 October 2019 (UTC)

@LacoR: It's now in the sandbox, please could you test {{Wikidata Infobox/sandbox}} to make sure it works as expected? Thanks. Mike Peel (talk) 19:09, 31 October 2019 (UTC)
@Mike Peel and Multichill: Thank you very much. It seems to work as expected, the only problem is - the API is not working now. I tested it on Category:Lutheran church in Koceľovce. --LacoR (talk) 16:07, 2 November 2019 (UTC)
@LacoR: It's now live. Thanks. Mike Peel (talk) 15:50, 9 November 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 14:23, 1 January 2020 (UTC)

Add Petscan link?

What would be great from an editing perspective would be a small link to the petscan query for the category page when the template is on the category (maybe near the upload button). This would make it a lot easier to edit via quickstatements, evaluate the files for other charachterisitcs (I.e. template usage or missing properties) and generate lists of files. Sadads (talk) 09:48, 2 November 2019 (UTC)

@Sadads: Adding a link at the bottom, along with the other tools, should be OK. Do you have an example category + link to test? Thanks. Mike Peel (talk) 16:55, 2 November 2019 (UTC)
Hey @Mike Peel: ! Sure :) Category:Ryan Lavarnway, which can be generated with generate this link. Note the variables that need to be in place are ns =1 (which indicates the namespace for files), project = wikimedia (which gives us the initial project prefix), and language = commons. The categories field gives you the category. All the other url fields that get generated in other spaces are optional, and something you would have to tweak per the application you have for the list. Sadads (talk) 19:59, 4 November 2019 (UTC)
@Sadads: OK, it's now in {{Wikidata Infobox/sandbox}} for testing. Thanks. Mike Peel (talk) 20:06, 4 November 2019 (UTC)
Appears to work :) Thanks! If you could push that into the live template, I am going to be teaching at WikiConference North America this weekend and want to show it to folks :) Sadads (talk) 20:10, 4 November 2019 (UTC)
@Mike Peel: Realized I forgot to ping, Sadads (talk) 16:23, 5 November 2019 (UTC)
@Sadads: Sorry for the delay, I was hoping to do one update to the infobox that included the new image code, but that got stalled. I've now done a partial update that adds the petscan link. Thanks. Mike Peel (talk) 15:46, 9 November 2019 (UTC)
The, 18.21.148.20 16:20, 9 November 2019 (UTC)
  • How does this relate to Infoboxes particularly? AIUI your boilerplate Petscan query, that would apply to any Category on Commons – no relation to Infoboxes or Wikidata. In which case, wouldn't that be a gadget for the LHS sidebar? Andy Dingley (talk) 17:30, 9 November 2019 (UTC)
    • You're right, it doesn't depend on Wikidata, but perhaps it makes sense to have it grouped with the other tools in the infobox? Either way, you could do a gadget for the left-hand toolbar. Thanks. Mike Peel (talk) 15:53, 10 November 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 14:22, 1 January 2020 (UTC)

Graphics of chemical compounds

For chemical compounds the most important illustration is usually P117 not P18. Maybe it's possible to add P117 to be displayed if it exists in WD, and P18 if there is no P117? Wostr (talk) 18:42, 27 November 2019 (UTC)

@Wostr: I've implemented it in {{Wikidata Infobox/sandbox}} - P18 will still show by default, but P117 should now also show if it's present. Can you confirm that it shows, or point to an example if there are issues? There's a new image switcher coming soon, so the visual look will change - turn on the infobox gadget in your preferences to see the future version. Thanks. Mike Peel (talk) 19:45, 14 December 2019 (UTC)
Thanks, the structure shows correctly in several categories I've tested. If it's not possible to prioritise P117 over P18, then the current situation P18>P117 is better than not showing P117 at all. There is, however, one issue: if there's P2096 qualifier (image description), both image description and property description are shown (e.g. in Category:Proline that would end with the following description: "structure of proline without indicated stereochemistry /next line/ chemical structure". Wostr (talk) 09:14, 21 December 2019 (UTC)
@Wostr: I've tweaked the logic so that the "chemical structure" label only shows up when image (P18) is also present - it should at least then have a radio button in front of it to mark it separate from the text. Does that look better? Thanks. Mike Peel (talk) 13:31, 21 December 2019 (UTC)
That looks nice, thanks. Wostr (talk) 14:33, 21 December 2019 (UTC)
@Wostr: This is now live. Thanks. Mike Peel (talk) 14:21, 1 January 2020 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 14:21, 1 January 2020 (UTC)

Error: "wrong name because wikipedia doesnt care about facts"

https://commons.wikimedia.org/w/index.php?search=%22wrong+name+because+wikipedia+doesnt+care+about+facts%22&title=Special%3ASearch&go=Seite&ns0=1&ns6=1&ns9=1&ns12=1&ns14=1&ns100=1&ns106=1 --Arnd (talk) 13:51, 9 December 2019 (UTC)

@Aschroet: This one was vandalism, see [12]. It should clear up itself. (I've seen the ones above, but haven't had time to investigate them yet - thanks for reporting them!) Thanks. Mike Peel (talk) 18:07, 9 December 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 14:21, 1 January 2020 (UTC)

Link to search "depicts"

A link to a search with depicts (P180) with the item could be useful.

For Category:Horizon_Field (item: Horizon Field (Q1628128)) that would be Special:Search/haswbstatement:P180=Q1628128 (btw, Q1628128 is an installation of 100 statues, not an individual sculpture as Wikidata might suggest). Jura1 (talk) 07:06, 13 December 2019 (UTC)

@Jura1: It's in the sandbox for testing. One issue is what text to display - at the moment it just says "Search depicted" in English, is there a QID that we could use the translated labels from? Also, @Keegan (WMF): , this might be of interest to you. Thanks. Mike Peel (talk) 19:05, 14 December 2019 (UTC)
Thanks. I doubt there is an item, but you could create one and make it an instance of d:Q17442446. Jura1 (talk) 16:30, 15 December 2019 (UTC)
Useful, except when it's not. When eager editors pile on numerous trivial elements (and let's face it, Wikidata like all Wikimedia projects, tends to often attract people more concerned with intricate details and trivia than common sense), we get unfiltered data vomit as can be seen at Miss Dorothy Quincy Roosevelt by John White Alexander. More famous painting like Washington Crossing the Delaware have somewhat more useful depictions, but an open-ended field will eventually attract more unwanted cruft. I think we should eliminate the data-regurgitation of depicts (P180), and let COM:DEPICTS handle that. Wikicommons is NOT Wikidata. Let's not forget that. --Animalparty (talk) 05:35, 29 December 2019 (UTC)
@Animalparty: I worry about this issue as well - it's an issue on Wikidata, but it could be a lot worse through depicts statements here. On Wikidata, there is one entry for the painting, and you can describe what it depicts once in that entry. Here, however, we might have 10 images of that painting. So for each of those, you can either say "this is that painting", pointing to Wikidata for the information, or you can set 10 copies of the same depicts information locally. Then if you disagrees with the existing depicts statements, you have to do 10x the number of edits to change them. Thanks. Mike Peel (talk) 07:26, 29 December 2019 (UTC)
@Jura1: This is now live. I've left it untranslated for now. Thanks. Mike Peel (talk) 14:19, 1 January 2020 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 14:19, 1 January 2020 (UTC)

Why does wdib add

Category:Public to Category:Funeral of Karel Gott?--Roy17 (talk) 13:32, 13 December 2019 (UTC)

d:Q69568386#P276 currently has a qualifier "applies to part: public (Q2388316)". Not sure where the infobox does it though. Jura1 (talk) 05:46, 14 December 2019 (UTC)
@Roy17 and Jura1: it actually came in through point in time (P585), this tweak should fix it. I've switched the category to the infobox sandbox for now, can you confirm it's OK? Thanks. Mike Peel (talk) 18:56, 14 December 2019 (UTC)
Yes. Now public is not shown in the cat anymore.--Roy17 (talk) 21:48, 14 December 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 14:18, 1 January 2020 (UTC)

Wikidata Infobox does not follow redirects on Wikidata

When an item on Wikidata has Property:P734 (family name) defined, the template automatically adds appropriate category. However, when the value of P734 is an item which actually is a redirect, the category is not added. I merged Q27870134 into Q21493011 and created redirect. Then e.g. for Q9176777 (Bolesław Krzyżanowski) I had to change P734 in order to Category:Krzyżanowski (surname) be automatically added to Category:Bolesław Krzyżanowski. Anyway, as a result, a bunch of people have disappeared from Category:Krzyżanowski (surname). --jdx Re: 12:18, 24 December 2019 (UTC)

@Jdx: See #following_redirects_on_wikidata above, and phabricator:T157868. There's not much that can be done apart from updating the links to avoid the redirect, which a bot may or may not do. Thanks. Mike Peel (talk) 15:00, 24 December 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 14:17, 1 January 2020 (UTC)

Populations

Take Category:Krimpen aan den IJssel for example. I can't really agree that listing all censuses is desirable. Besides, it assumes the data order from WikiData, instead of a chronological order, but that may be more of a WikiData issue. --HyperGaruda (talk) 20:48, 26 December 2019 (UTC)

@HyperGaruda: In general, the latest value is marked as 'preferred' on Wikidata, so only that one shows up. I'm not sure why that's not the case here. Thanks. Mike Peel (talk) 21:26, 26 December 2019 (UTC)
Easily done. --ghouston (talk) 01:00, 27 December 2019 (UTC)
@Ghouston: thanks, I see you increased the Wikidata rank for this year's value. Would that mean having to modify ranks every year to maintain the currently fixed situation? --HyperGaruda (talk) 17:36, 27 December 2019 (UTC)
Yes, somebody who adds a new value would have to reset the ranks. --ghouston (talk) 22:27, 27 December 2019 (UTC)
I think there's a bot that makes sure that the latest value is set as preferred as well, but I'm not sure why it didn't catch this case... Thanks. Mike Peel (talk) 09:02, 28 December 2019 (UTC)
DeltaBot has done a big batch recently. --ghouston (talk) 22:56, 28 December 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 14:17, 1 January 2020 (UTC)

Europeana Entity P7704

Suggestion: Add Europeana entity (P7704) to the links in the infobox we have connected 160 000 profiles with en:Europeana see T240290 - Salgo60 (talk) 10:35, 1 January 2020 (UTC)

@Salgo60: Done, please let me know if you spot any problems with it. Thanks. Mike Peel (talk) 14:16, 1 January 2020 (UTC)
Thanks excellent is there a way to see on what pages the template is used and Europeana entity (P7704) is shown? I will try with Petscan... - Salgo60 (talk) 16:05, 1 January 2020 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 11:02, 19 January 2020 (UTC)

film poster images

Two suggestions here, the first is purely mechanical, the second involves opinions of aesthetics and pertinence. Currently, it appears that infoboxes for films fail to display film poster (P3383), in favor of image (P18). Compare Category:Ace of Cactus Range to Category:North by Northwest (1959 film). I think that in the event a wikidata item has an image for "film poster" but not for "image" (or logo image (P154)) the film poster should be displayed. Secondly, in the event that both "image" and "film poster" have values (see below), I think it would be preferable to display only the poster image, as "image" is often occupied by arbitrary screen grabs, lobby cards, and less exemplary imagery. In this case, "image" would be suppressed if there is a value in film poster (P3383) (especially important when items have the same image for both values, as in House on Haunted Hill (Q263583)). I'm no fan of infobox clutter creep (i.e. increasingly cramming in as many images/values as possible just because they're 'true'), and I certainly don't think we need two or three images displayed per film. One is plenty. --Animalparty (talk) 21:18, 3 January 2020 (UTC)

@Animalparty: I've added film poster (P3383) to the sandbox, please test {{Wikidata Infobox/sandbox}} to make sure that looks OK. I'd prefer to leave image (P18) as the default. Hopefully that would be the best picture to illustrate the topic, as that's what is often reused elsewhere, e.g., in Wikipedia infoboxes, or Wikidata search query results. Thanks. Mike Peel (talk) 16:40, 13 January 2020 (UTC)
@Animalparty: This is now live. Thanks. Mike Peel (talk) 11:01, 19 January 2020 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 11:01, 19 January 2020 (UTC)

Request: IBDB values

Could the infobox please display Internet Broadway Database identifiers in Authority control, i.e. Internet Broadway Database person ID (P1220) and Internet Broadway Database show ID (P1219)? For productions, performers, and other stage crew who have no IMDB or VIAF-associated profiles, IBDB is one of the major databases for quickly ascertaining identity and finding additional info. Even famous plays like Into the Woods (musical) and Hamilton (musical) have a dearth of external identifiers, to say nothing for obscurities like Agnes Miller or The Case of Becky (play). Playbill.com identifiers like Playbill person ID (P6132), Playbill venue ID (P6113) might also be added: from casual browsing, listings for older, more obscure entities are identical or nearly so between IBDB and Playbill.com, but more contemporary entries seem to have unique content that would warrant displaying both. Thanks, --Animalparty (talk) 05:36, 13 January 2020 (UTC)

@Animalparty: They are now in {{Wikidata Infobox/sandbox}}, please test that to make sure it works as expected. Thanks. Mike Peel (talk) 16:34, 13 January 2020 (UTC)
@Animalparty: This is now live. Thanks. Mike Peel (talk) 11:01, 19 January 2020 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 11:01, 19 January 2020 (UTC)

IWM memorial ID

Can we add IWM memorial ID (P3038), and thereby render {{IWM}} redundant? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 12:08, 16 January 2020 (UTC)

@Pigsonthewing: ✓ Done. Thanks. Mike Peel (talk) 11:00, 19 January 2020 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 11:00, 19 January 2020 (UTC)

"The time allocated for running scripts has expired."

https://commons.wikimedia.org/w/index.php?search=%22The+time+allocated+for+running+scripts+has+expired.%22&title=Special:Search&go=Go&ns0=1&ns6=1&ns9=1&ns12=1&ns14=1&ns100=1&ns106=1 Is this comming from the Infobox? --Arnd (talk) 20:33, 25 November 2019 (UTC)

Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 10:30, 19 April 2020 (UTC)

Family relations show up as Q values

The infobox for Category:Bransby_Blake_Cooper shows family relations as Q values rather than names? "Father Q75622600" - can someone check? thanks -- Deadstar (msg) 08:52, 7 February 2020 (UTC)

@Deadstar: This seems to be phab:T244529 - a major cross-wiki issue with labels from Wikidata. Pinging @RexxS: in case there's any debugging that can be done on this side, but I think this is something the devs have to fix (and urgently!). Thanks. Mike Peel (talk) 10:26, 7 February 2020 (UTC)
@Deadstar: It seems to be working again now (see the ticket), but you might need to add "?action=purge" onto the URL to see the correct version. Thanks. Mike Peel (talk) 17:33, 7 February 2020 (UTC)
@Mike Peel and Deadstar: Yeah, it was the label bug. Normally the code looks for a local sitelink (an article on a wikipedia) and uses that (stripping out dab qualifiers, etc.), rather than using the label. It's only for entities that have no Wikipedia article that it falls back to the label, and then the Q-value if there's no label. That's why most values remained unaffected. Cheers --RexxS (talk) 18:21, 7 February 2020 (UTC)
Thanks all. -- Deadstar (msg) 10:36, 8 February 2020 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 10:28, 19 April 2020 (UTC)

Taxonomy box has text running outside the WD infobox

Hi! I just want to notify that the text under "taxonomy" in the {{Wikidata Infobox}} is not breaking the text, but lets the text cross the borders. Example: Category:SARS-CoV-2. Regards - Premeditated (talk) 09:34, 25 February 2020 (UTC)

@Premeditated: I think I've fixed this, please can you test {{Wikidata Infobox/sandbox}} to see if it looks OK for you now? Thanks. Mike Peel (talk) 10:27, 19 April 2020 (UTC)
@Mike Peel: Nice, now it keeps the text inside the box. Only thing that annoys me a little is the strict width of the infobox. This cut words last letter to a new line (like Coronavirida-e). Last but not least line-wrapping should be done with hyphenation (-). - Premeditated (talk) 10:42, 19 April 2020 (UTC)
@Premeditated: I'm using css "word-wrap: break-word;", I don't think that supports hyphenation, and I can't change how browsers work. I am tempted to widen the infobox a little, as this does seem to make a good case for that, but it's a balancing act keeping it small enough on the page that it doesn't distract from the media files, while still clearly displaying the most useful info. Thanks. Mike Peel (talk) 11:55, 19 April 2020 (UTC)
@Mike Peel: With hyphens: auto; this should be passible.[13] - Premeditated (talk) 13:40, 19 April 2020 (UTC)
@Premeditated: Added to sandbox, does that work? Thanks. Mike Peel (talk) 14:14, 19 April 2020 (UTC)
@Mike Peel: Yeah, that was much better. Thanks. - Premeditated (talk) 14:22, 19 April 2020 (UTC)
@Premeditated: OK, this is now live [14], let's see how that goes. Thanks. Mike Peel (talk) 14:48, 19 April 2020 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 14:48, 19 April 2020 (UTC)

Category:2019–20 coronavirus outbreak

The infobox template in this category gives a lot of "The time allocated for running scripts has expired" error messages, see this version before the template was removed. Behanzane (talk) 12:47, 9 March 2020 (UTC)

@Behanzane: Thanks for the heads up. It was because there are so many different countries in the item, which take a long time to load. I've added a new limit of up to 10 countries being displayed, and that seems to have resolved this issue. Thanks. Mike Peel (talk) 15:04, 9 March 2020 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 09:55, 19 April 2020 (UTC)

"Number of dead: 72 000 000 1"

Why does did an extra "1" show up as directly after the number of dead people in Category:Black_Death as well as the corresponding Swedish article sv:Digerdöden? Is it a footnote? Tomastvivlaren (talk) 18:41, 6 April 2020 (UTC)

The extra figure disappeared when a warning issue was solved in Wikidata. (Someone had entered a web address as unit, which was an illegal unit.) So perhaps this behaviour of the template was expected. Tomastvivlaren (talk) 20:30, 6 April 2020 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 09:29, 19 April 2020 (UTC)

Imperial unit abbreviations

I noticed on BP-1101A that the abbreviations given for pounds and inches were displayed in the somewhat non-standard characters # and ″, respectively. I don't think this is something being passed by Wikidata, as both of these are marked deprecated. If possible, can these be changed back to "lb" and "in" when displayed here? Huntster (t @ c) 17:55, 20 March 2020 (UTC)

@Huntster: @RexxS: I think this needs a tweak in Module:WikidataIB. pound (Q100995) has two values of unit symbol (P5061), one 'preferred' the other 'deprecated', but WikidataIB is somehow using the deprecated one. inch (Q218593) is similar - there are more properties, but the deprecated value is being returned. Minimal code to reproduce: {{wdib|ps=1|P2067|qid=Q88093310 | unitabbr=yes}} -> 10,000 lb, 4,536 kg (should return "10,000 lb, 4,536 kg"), and {{wdib|ps=1|P2048|qid=Q88093310 | unitabbr=yes}} -> 127 in, 322.58 cm (should return "127 in, 322.58 cm") - other languages will differ. Thanks. Mike Peel (talk) 09:52, 19 April 2020 (UTC)
@Huntster and Mike Peel: Good catch, although why on Earth anybody feels those symbols are useful is beyond me. I should have fetched the table of best statements instead of all statements. That's fixed now in Module:WikidataIB/sandbox:
  • {{wdib/sandbox|ps=1|P2067|qid=Q88093310 | unitabbr=y}} -> 10,000 lb, 4,536 kg
  • {{wdib/sandbox|ps=1|P2048|qid=Q88093310 | unitabbr=y}} -> 127 in, 322.58 cm
--RexxS (talk) 16:44, 19 April 2020 (UTC)
@Mike Peel and RexxS: Outstanding, thank you both for finding and fixing this issue! Huntster (t @ c) 16:57, 19 April 2020 (UTC)
@Huntster and RexxS: This is now live. Thanks. Mike Peel (talk) 16:56, 22 April 2020 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 16:56, 22 April 2020 (UTC)

Adding BALaT object ID (P3293) and BALaT person/organisation id (P1901) to the supported identifiers in Authority control

Not an urgent request! Whenever you have time, it would be really nice if the identifiers BALaT object ID (P3293) and BALaT person/organisation id (P1901) could be enabled by the Authority control section of the infobox. These refer to a reliable Belgian art historical database, in fact the Belgian equivalent of RKDimages ID (P350) and RKDartists ID (P650). Many thanks and keep up the good work! Spinster (talk) 10:32, 27 March 2020 (UTC)

@Spinster: They're now in {{Wikidata Infobox/sandbox}}, please test that to make sure it works as expected. Thanks. Mike Peel (talk) 09:41, 19 April 2020 (UTC)
@Mike Peel: Thank you! I've included two infoboxes in my own sandbox, one using BALaT object ID (P3293) and the other using BALaT person/organisation id (P1901). Both look good to me. Let me know if I should do other tests and if so, what to look out for :-) Spinster (talk) 15:31, 19 April 2020 (UTC)
@Spinster: This is now live. Thanks. Mike Peel (talk) 16:55, 22 April 2020 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 16:55, 22 April 2020 (UTC)

Taxon author is buggy

If a taxon in Wikidata has either the taxon author or year of taxon publication specified, Wikidata Infobox outputs "Taxon author: " and whatever data was found, often leading to output such as "Taxon author: 1928". See Category:Phintelloides brunne for example. The template code should make sure that taxon author (P405) is actually specified before creating a "Taxon author:" row in the output. The relevant code can be found in Template:Wikidata Infobox/core around line 769. Kaldari (talk) 18:16, 31 March 2020 (UTC)

A smart solution would be to not display the year if no author is given. An even smarter solution would be to only display surnames (regardless of year), to more accurately reflect common usage: the complete formal scientific name of the spider above is Phintelloides brunne Kanesharatnam & Benjamin, 2019, and pedantry like "Nilani Kanesharatnam, Suresh P. Benjamin 2019" is needlessly precise data cruft. Similarly, if a taxon has three or more authors, the standard form of "Surname et al XXXX" would be preferable to listing lots of names. --Animalparty (talk) 20:02, 31 March 2020 (UTC)
@Kaldari and Animalparty: I've made two tweaks: 1) if taxon name (P225) does not have a qualifier of taxon author (P405), the line won't show, which solves the first issue, and 2) if taxon author citation (P6507) is set, the line for that will show, and this line won't be displayed - you can use that property to set custom taxon author lines if you want. Please test {{Wikidata Infobox/sandbox}} to make sure that works OK for you. Thanks. Mike Peel (talk) 09:38, 19 April 2020 (UTC)
@Kaldari and Animalparty: This is now live. Thanks. Mike Peel (talk) 16:54, 22 April 2020 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 16:54, 22 April 2020 (UTC)

Country of registry

For ship categories it would be helpful to display "Country of registry" (P8047) since "Port of registry" can already be shown. Using the "Country" property will render as "Location" in the infobox, which I think is not appropriate as ships can move between countries. So, would it be possible to add P8047 to the list of properties for the box? De728631 (talk) 21:26, 12 April 2020 (UTC)

@De728631: It's now in the sandbox, please test {{Wikidata Infobox/sandbox}}. Thanks. Mike Peel (talk) 09:28, 19 April 2020 (UTC)
@Mike Peel: Thank you, Mike. This is looking good, see User:De728631/workshop. I think it can be implemented at the live template. De728631 (talk) 13:57, 19 April 2020 (UTC)
@De728631: This is now live. Thanks. Mike Peel (talk) 16:54, 22 April 2020 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 16:54, 22 April 2020 (UTC)

Hello. For categories such as Category:WPA Yellowstone National Park poster, it would be nice to have advertises (P6291) displayed. Can someone add this feature? Thierry Caro (talk) 16:56, 18 April 2020 (UTC)

@Thierry Caro: It's now in the sandbox, please test {{Wikidata Infobox/sandbox}}. Thanks. Mike Peel (talk) 09:28, 19 April 2020 (UTC)
@Mike Peel: It seems fine. Thank you. I think we can have it now. Thierry Caro (talk) 09:45, 19 April 2020 (UTC)
@Thierry Caro: This is now live. Thanks. Mike Peel (talk) 16:53, 22 April 2020 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 16:53, 22 April 2020 (UTC)

"Unknown" value in the d:Property:P18 (Image)

If the value of d:Property:P18 (Image) is defined as "Unknown", that related row in the infobox should not be displayed. Currently displayed red link.

See example in the Category:Domenico Trezzini (there are no reliable images of this person). --Kaganer (talk) 01:25, 20 April 2020 (UTC)

@Kaganer: If no image is available, then you don't need to set the image (P18) property. I've removed it from your example accordingly. Thanks. Mike Peel (talk) 19:48, 22 April 2020 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 15:02, 10 May 2020 (UTC)

punctuation for aliases

On top each page, below the heading, there is a display of the applicable Wikidata item with its label, description and aliases. Currently, in English, the aliases are separated by a comma (","). This works fine when the aliases doesn't include a comma, but for those with, its somewhat suboptimal. I wonder if another punctuation mark wouldn't work better, e.g. a semi-colon (";").

It's probably not this template that adds it, but contributors here might know how. Jura1 (talk) 09:07, 23 April 2020 (UTC)

Mobile interface of Wikidata uses the pipe ("|"). Jura1 (talk) 16:06, 23 April 2020 (UTC)
@Jura1: It’s your common.js subpage that adds it (so most people don’t have this at all); more specifically its third line. You can propose changes on the tool’s talk page. (And if you’re already there, I think you should change importScriptURI to mw.loader.load, as the former is deprecated, and will most probably cease to work at some point.) —Tacsipacsi (talk) 21:14, 23 April 2020 (UTC)
Thanks, I had forgotten about that. I had looked at my gadgets ;) . In that case I can fix it myself. Jura1 (talk) 10:44, 26 April 2020 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 15:01, 10 May 2020 (UTC)

Template shows strange text on category pages

Since today this template shows strange text on category pages, i.e. on Category:Real-time clocks: "Realtimeklok

ساعت بلادرنگ Realtidsklocka 실시간 시계 Echtzeituhr リアルタイムクロック Gerçek zamanlı saat Real-time clock 實時時鐘 Rellotge de temps real Reaalajakell Нақты уақыт сағаты Horloge temps réel Часы реального времени Reloj en tiempo real Zegar czasu rzeczywistego Годинник реального часу Hodiny reálného času Hodiny reálneho času Đồng hồ thời gian thực Jam Waktu Nyata Relógio de tempo real Real-time clock "

Either related to a change to this template/Lua modules or the the last deployment of MediaWiki today to release 1.35.0-wmf.30? Raymond 18:54, 29 April 2020 (UTC)

@Raymond and Jarekt: It's an issue with Module:Interwiki, see the talk page of that module. I've reverted that change for now. Thanks. Mike Peel (talk) 19:19, 29 April 2020 (UTC)
Thank you for the fast answer, Mike. Raymond 19:25, 29 April 2020 (UTC)
@Raymond: thanks for quick heads up. I just deploy new version of Module:Interwiki and was monitoring Category:Pages with script errors for any signs of trouble, not caught by testing, but I guess errors did not show up there. I found the issue and re-deployed. --Jarekt (talk) 20:02, 29 April 2020 (UTC)
@Jarekt: Thanks, that's looking better. Thanks. Mike Peel (talk) 20:36, 29 April 2020 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 15:01, 10 May 2020 (UTC)

Only label shown

I'm not sure if this is the right place for the issue. Currently I'll see sometimes only the Q-Label in the infobox and not the acronym of the something behind. Have a look here. It shows Q10454 and not as expected "Landkreis Ansbach". thx for checking. --Derzno (talk) 05:36, 7 May 2020 (UTC)

@Derzno: it's a general problem affecting mutiples templates and not only this one (I noticed it on {{Artwork}} too). It's coming from the Wikidata side. Cheers, VIGNERON (talk) 07:17, 7 May 2020 (UTC)
@Derzno and VIGNERON: phab:T252079, it should be fixed now but caching will take a time to refresh. If there are any cases that urgently need refreshing, let me know and I'll run through them making null edits. Thanks. Mike Peel (talk)
ok it works fine! Thx for your support. --Derzno (talk) 14:37, 7 May 2020 (UTC)
uups one step back. Have a look. The link to german wp came up with Q52 only. Sorry to be the bad guy with my note. --Derzno (talk) 17:23, 7 May 2020 (UTC) –– (category link fix) Apalsola tc 12:45, 10 May 2020 (UTC)
Update, after using "purge" command it works, sorry for confussion. --Derzno (talk) 06:06, 8 May 2020 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 14:58, 10 May 2020 (UTC)

Strange coordinates

Hi,

Could someone explain what is happening with the coordinates on Category:Tour de l'Horloge (Rennes) ?

The coordinates on Wikidata are correct (and with the correct precision AFAIK) but the display on Commons of the *same* coordinates is wrong somehow (around 100 meters too far south).

Cdlt, VIGNERON (talk) 07:17, 7 May 2020 (UTC)

@VIGNERON: It seems to be a precision issue - it's manually set to 0.1° on Wikidata. Trying to manually change that to 1 arcsecond, the map on Wikidata matches the one shown here. I've re-imported the coordinates from frwp to Wikidata, and they should display correctly now. [15]. Thanks. Mike Peel (talk) 07:25, 7 May 2020 (UTC)
Perfect! Thanks @Mike Peel: (I've looked at the precision but didn't catch the problem :/) Cheers, VIGNERON (talk) 07:33, 7 May 2020 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Mike Peel (talk) 14:58, 10 May 2020 (UTC)

Severe problems with Infoboxes and Wikidata queries

  • Since the introduction of recursive infoboxes, there are massive amounts of Lua script errors (time exhauted), and TONS of false autocategorization everywhere.
I repeat what I said to the author of this change : DO NOT RECURSE DOWN into related topics to generate ANY recursive infobox, IF the related topics (lsited at top of the main infobox) ALREADY have a link where they point to the relevant page with the SAME infos.
This change made this wiki incredibly slow foor every update, and is now causing severe degradation of performance and generate a huge load on servers.
Such recursive infoboxes are just duplicating info that is available ON REQUEST of visitors by just following the links displayed in the related topics. We don't need such repetition.
As well almost all these recursive infoboxes are now autocategorizing pages (but with wrong sort keys) and frequently the scripts terminate by an error causing a test for membership not being performed correctly. Tests for existences (which are very costly on the server) for example will be wrong and will cause a page to be categorized even with the scripting error (which is not detected at all).
This change now makes many categories to have random contents collected everywhere. Many become overpopulated with these false categorization.
PLEASE REMOVE these unnecessary recursive infoboxes. And in all cases (if a recursive infobox is still used, because the related topics have no links to a relevant page showing thir own infobox), the autotocategorization of subinfoboxes should ALWAYS be disabled).
This is now dramatic on this site: If the author does not want to do that to remove the subinfoboxes, I will once again disable this change for all subinfoboxes (unconditionnally).
  • Note that there's also a dramatic slowdown in Lua scripting, and another major issue where {{Label}} now uses more than 7MB of memory (a severe new bug in Module:Wikidata) plus about 3-5 MB for each other label added, so many pages now have other errors (because the Lua memory usage is limited to 50MB for redering each page). The maintainers of Module:Wikiata should really monitor their memory usage.

Thanks. verdy_p (talk) 14:53, 11 May 2020 (UTC)

@Verdy p: If you want to be constructive here, please stage your edits in the sandbox so that they can be tested before they go live. I try to keep the number of edits to the template to a minimum, as invalidating the cache of ~3 million categories probably shouldn't be done too often for performance reasons (ironically here!). Issues are being fixed as they are raised, if you can point out more examples then I can look into them. Better if you can help investigate and make things more efficient (in the sandbox again!), as that would be really useful. However, saying things like "I will once again disable this change for all subinfoboxes (unconditionnally)" is not useful nor welcome. Thanks. Mike Peel (talk) 18:02, 11 May 2020 (UTC)
You are not using the sandbox yourself to make tests for your changes. It's a fact that you've severaly degraded this site with tons of errors and severe degradation of performance
This is visible for everyone. You are not constructive because you insist in doing these recursive infoboxes when they are in fact almost never needed (this is jsut duplicating info by copying again and again to tons of unrelated pages, including importing all their categories (that should have never occured), breaking many categories and causing lot of server damages on millions of unrelated categories. Your edits with recursive infoboxes have created this huge maintenance cost everywhere (with millions pages affected and invalidated in the cache).
So apply all what you ordered me here to yourself. I've not made edits that caused these millions pages being invalidated (and then never refreshed later even after errors that this "feature" introduced). You have invalidated millions of pages, many of them broken now.
So I repeat what I said: DO NOT RECURSE DOWN ANY sub-infobox for related topics are already **linked** at top of the box (that link is enough)! This is absolutely never useful, always undesirable pollution, it generated considerable maintenance cost, and this basic rule is simple to apply and will dramatically reduce the damages. verdy_p (talk) 00:29, 12 May 2020 (UTC)
@Verdy p: Every change I make goes in the sandbox first, just look at the histories and the number of times it says 'sync from sandbox'. I'm handling errors as they are pointed out - if you are aware of currently live ones, please point them out and I'll investigate them. You clearly have a strong opinion here, but I think that the recursion is useful in quite a few categories, as a random example, see Category:Milwaukee Clipper (ship, 1905) and Category:IMO 5235375, or Category:Buildings by Elissa Aalto. It definitely needs improvements, though, which we can make incrementally. Thanks. Mike Peel (talk) 07:01, 12 May 2020 (UTC)
No I disagree, for example: the link to Elissa Aalto is self-sufficient, it shows all the details in its own infobox (which is alsu available on hovering if you have enabled this option) without needing to be repeated (and importing false categories about herself and not about some creations she made, which should neve rinherit things, like the place of birth/schools/death or her related family members or other creations she got: there are lot of information about people, there's no need to reimport them each time a person is named).
The same is true for the ship. There are lot of cases where categories are imported incorrectly, and in fact this is unncessary and very costly (as you've seen with all the details about countries, or major sports events, and even about famous people, or large topics with lot of details like vehicles). We don't need that in articles: for details we just lik to the related articles (when they exist) and want to keep things short and simple to read (and there's no risk of ambiguity as the link is there to disambiguate everything).
So again I ask you remove these subinfoboxes for related topics (notably here because there can be several ones, each with their own details) if and only if these topics have a relevant link to their own category (which has its own infoboxes for details) already listed at near the top of the infobox. verdy_p (talk) 07:43, 12 May 2020 (UTC)

Performance questions

The extra information can be nice, but there can also be too high a cost, which I think it is at the moment. A few comments:
  • The Category:Milwaukee Clipper (ship, 1905) page, when I go to edit it, is taking roughly 4.9 to 5.0 *seconds* of *CPU time*, and over five seconds real time, to render. That number is down from 7ish seconds due to a change made per an earlier discussion here, which is great, but not nearly enough. If I disable the infobox template by deleting the first brace character, leaving everything else there, it now takes 0.06-0.07 seconds of CPU time, and 0.1 - 0.14 seconds real time to load. That is fast, and most categories are a bit faster than that (under 0.05 seconds CPU, under 0.1 real).
  • A website's loading time is pretty critical. Once you get above a second to render a page, you can start losing users, more after two seconds, and it's very bad after three. Just doing a google search there is this document, which has several quotes giving various opinions of exactly where it becomes a problem. And it is apparently a factor in Google's site ranking.
  • For the Wikidata Infobox template to take 5 seconds all to itself is singlehandedly taking Commons from a very fast website to an egregiously slow one, at least on pages where the template appears. I would guess image pages are the most common and are unaffected, but browsing category pages has become much worse anywhere this template exists. If cached it's OK, but any time the template is changed, or any time files or categories are added or removed from a given category, it will need to be re-rendered. And those pages are now painful if not recently cached.
  • For people donating their time to categorizing stuff and managing categories, the penalty is now on every "preview" click as well. It's either taking away their time, or reducing the amount of work they can get done in a given time.
  • I do like a lot of the extra information provided, but if the cost is this high, it's not worth it. I would imagine you will get some arguments against particular data being shown, when the real frustration is the performance. If that can be made acceptable, then the information shown becomes a function of screen space really, and more information if not losing significant performance) is usually better.
  • Frankly, a full second of CPU time is an *enormous* amount of processing. Even for a complex template, it seems to me it shouldn't be anywhere near there -- I can't remember other templates anywhere near that performance cost. Something seems really wrong, either some pathological template or Lua code doing way more work than is being realized, or a database index is broken, or something. I really don't know the architecture at all or where the performance problem could be. It's possible there is a quick solution, but I have no real idea.
  • If you get the CPU time down to 0.1 seconds, which would be a tripling of the CPU time for pages without the template, that should be fine. Somewhere between there and 0.5 seconds is probably the point where it's not worth it, and it's time to cut functionality out until the performance can be improved. The current five seconds is far, far beyond that -- I'm finding I have to disable the template if I want to use the "preview" button like I'm used to. And sometimes I may forget to re-enable it. I don't know if the excessive CPU usage is causing server problems or not, but it's definitely causing editing and viewing problems.
  • The template has been around for quite a while, and is very cool -- it's only recently (maybe the last month or two) that something changed and it started taking far, far longer to render than it used to. I have no idea what changes were made to potentially cause that. I definitely like the template and would prefer for the performance to be fixed rather than losing information, but the extra info is certainly not 100x more valuable than the actual category contents which I'm trying to see, and is not worth 100x the rendering time it's currently taking.
In short, would definitely like to know what options there are -- if this recursion is the problem, and disabling it gets the template to at least under a second and preferably closer to a tenth of a second, maybe that would work for now until a way can be devised to make the recursive feature performant. Or maybe the problem is elsewhere, but could experiments be made to see how to drastically reduce the render time? Carl Lindberg (talk) 12:17, 12 May 2020 (UTC)
@Mike Peel: I was just debugging the reason why Category:Pages with script errors takes so long to respond and come to the same conclusion Carl Lindberg just made: It takes 6.9 s to load with {{Wikidata Infobox}} and 0.07 seconds without. 6.9 seconds is way too long, and people will begin to remove those templates. We had issues like this in the past where some people were manually adding creator templates to files while others were removing them with bots because they had some categorization issue. It was very unpleasant. I think we can give up some functionality to speed this template up. --Jarekt (talk) 18:26, 12 May 2020 (UTC)
Also according to page info of Category:Matches_of_the_2014_FIFA_World_Cup the category shows looks up statements from 58 entities. That may by why it takes 12 seconds to load. --Jarekt (talk) 19:25, 12 May 2020 (UTC)
OK, I'm really busy this week (literally going up and down a mountain each day for work), but I can look into this in more detail over the weekend. If you're interested in helping, then please try things out in the sandbox. @RexxS: One thing in particular might help, in Module:WikidataIB around line 650, Commons category (P373) is always fetched, could that logic be changed so that if the commons sitelink is available then that is used, and only if it's not available is Commons category (P373) checked? Or better, just remove Commons category (P373) support now that we're over the critical mass of sitelinks. Thanks. Mike Peel (talk) 06:31, 13 May 2020 (UTC)
@Mike Peel, Jarekt, and Clindberg: I altered Template:Wikidata Infobox/core/sandbox to use Module:WikidataIB/sandbox, where I removed support for P373. Testing a preview of Category:Matches of the 2014 FIFA World Cup a few times using the main {{Wikidata Infobox}} and the sandbox {{Wikidata Infobox/sandbox}}: the random variability in the results is far greater than any saving from disabling that (quite cheap) call. Most of the time, it's timing out on Lua time usage. It also then mis-categorised the page into every available category of year and month type, so there's something that is iterating through qids and calling the infobox code. I've re-enabled P373 support to eliminate that problem.
I tried disabling the SEO, the checks and the categories, which made only a small improvement. I tried disabling the location field, which again did very little.
I restored all of those and tried moving the getQid call to the main template from the core. Removing 586 redundant calls sped things up a bit, but it is still not enough. You can see the changed coding for that in the two template sandboxes. I'll have another look tomorrow if I can. --RexxS (talk) 14:22, 13 May 2020 (UTC)
@RexxS: As a thought, is there a cheap way to retrieve a list of all properties that are set in a Wikidata item? If so, a function that retrieves those, and returns a list of them ("P18,P31,P276,...") that could be passed into the infobox core as a variable, along the same lines as suppressfields (but as a whitelist rather than a blacklist) might reduce the number of checks that need to be made while the infobox is being assembled. Thanks. Mike Peel (talk) 17:14, 15 May 2020 (UTC)
@Mike Peel: No. That would simply call getEntity() as we used to do before getBestStatements() was implemented. Loading the entire entity and then scanning through it for properties that exist completely defeats the savings of using getBestStatements(). If you really want to go down the path of removing the overhead of multiple module calls, then you need to write the entire infobox in Lua. That's perfectly possible, but begs the question of what order you would use for the fields in the infobox? Also how many maintainers would we have for an all-Lua version? --RexxS (talk) 18:45, 15 May 2020 (UTC)
@RexxS: Perhaps we could ask the developers for a Lua call that returns the list of properties without having to resort to getEntity? But perhaps the best approach is to switch to Lua completely - since your Lua course at Wikimania Stockholm I've been picking up various bits of Lua while writing Module:Wikidata Infobox, but switching completely would still be complex. The main issue I think I'd have is the passing of frames to WikidataIB - see the 'formatLine' function in Module:Wikidata_Infobox/sandbox - is there a simpler way to do that? Thanks. Mike Peel (talk) 18:57, 15 May 2020 (UTC)
Yes, Mike. The new infobox would be based on the code in Module:Infobox and Module:WikidataIB, but at the top level, it would simply load the entire entity once, and then loop through all of its statements to generate each html row of the infobox, presumably using the property label as the field name (although you could have a table of substitutions if required); each row's value would then be the call to Wikidata. You'd have to fix some exception cases like the image and caption, and statements that we don't use like instance of (P31), but essentially it would only require a single call to generate the infobox. The only thing in that frame would be the qid (and perhaps fwd and spf if they were to be implemented). The question of sourcing and osd is something to think about. --RexxS (talk) 19:13, 15 May 2020 (UTC)
There are known causes for this lack of speed:
  • the major reason in the Wikibase interface in PHP which lacks functionality to efficiently filter just the properties we want (all properties are retrieved), just the qualifiers we want (all qualifiers are loaded), as well as filter for labels/descriptions we want (too many languages, and we don't care at all about retrieving aliases, only useful in Wikidata), as well as sitelinks (too many site codes for unneeded languages, note that sitecodes for lovalized projects group languages differently, they use interwiki codes and group several distinct languages not using the same BCP47 code as for labels/descriptions/aliases and monolingualtexts). And the JSON returned is MUCH too verbose with lot of redundancy. Wikibase should have a much more efficient way to be quiries instead of using "mw.wikibase.getEntity()" which is very costly, has very badly tuned caches (15 entities are fully cached even if we don't need them completely, but this is still not enough for infoboxes showing more than 15 entities: there are repeated queries to Wikidata for the same entities, which takes a long time; additionally there's a cache for only 50 properties which are also kept entirely with all their own entity data, so we end up with up to 65 entities in memory, using lot of memory, up to 7MB, sometimes even more).
  • Wikibase does not properly intern many Lua strings (this is a limitation of Lua) and many Lua tables have overlong collision lists (also a bug of Lua, with inefficient hashing)
  • Wikibase returns a lot of unnecessary metadata; the entities in caches are not kept with weak references (so we get "out of memory" errors): memory is incorrectly managed in Wikibase.
  • Really we need better and faster way to retrieve more selectively the data we want (probably using by queries by RDF triples, using SPARQL, but without any internal cache in this interface, and with a JSON output that is much better filtered).
  • Several algorithms in Wikibase and in the Module:Wikidata are very inefficient, using slow lookups. There are ways to improve it, but the current Module:Wikibase is wrong, and Module:WikibaseIB is not really much better because it also keeps too much data in memory (then there's also a huge activity of the garbage collector because it uses really too many intermediate objects for various string operations or conversions, plus a very inefficient sort algorithm, which can also reload entities being compared but that are no longer in the Wikibase cache: the big JSON from aech query is reparsed again and again for the same entities).
  • The topologic sort algorithm (for tree-like data, even if they contain loops that can be detected) is also very inefficient (there's absolutely no need to "mark" items with additional tables, in fact this sort can be made in a single visit pass in sequential order without even having to madify the traversed nodes in trees). I've rewritten this algo in a much faster way, using much less memory (only an map of entity ids to entity is sufficient; there's no need to add data for rank in the tree, no recursion, all visits can be made in a single loop: it can be implemented as a simple forward iterator, so no second pass is even needed to format the topologically ordered items; it's even possible to use the iterators in Lua and return to the wiki parser that can recall Lua later with the iterator keeping its progress state: most formatting should be done outside Lua, because the wiki parser is more efficient and has better memory management for processsing templates and non-costly parser functions: a Lua call can be costly and notably Lua calls that use mw.wikibase queries).
  • May be the alternative would be to not use Lua for Infoboxes, but use a custom parser function written directly in "native" PHP (PHP is compiled, unlike Lua which uses a VM for interpreting bytecode and which has numerous memory management issues, very inefficient hash tables, inefficient string hashing functions, very poor garbage collection, inefficient management of the pool of unmutable strings) and that would build a single selective SPARQL query not requiring any cache of full entities. verdy_p (talk) 02:19, 22 May 2020 (UTC)
  • Note: as long as getEntity() can only load full entities, we'll have a problem. We should be able to first build the query we need for all the useful properties/qualifiers/labels/languages, and retrieve only those, then a pass to eliminate conditional properties, before even starting to format everything. verdy_p (talk) 02:25, 22 May 2020 (UTC)
  • But presumably those issues have been there all along -- I don't recall this extreme slowness with earlier versions of the template. Would it be possible to try out older versions of the template (maybe in a sandbox with a test page), to try and narrow down which edits caused the performance to drop? I.e. see if the template as of mid-January is much faster, then keep iterating halfway between the earliest known slow version and the latest known fast version to see when the problematic edits are. If identified, perhaps those edits could be reverted until a much (*much*) faster way of obtaining that functionality can be found (which may indeed involve solving some of the issues that Verdy p is discussing). Carl Lindberg (talk) 18:58, 29 May 2020 (UTC)
  • @Clindberg: Feel free to experiment with the sandbox. RexxS and I have been trying various things, and it is now faster, but not as fast as you'd like. If you can point to specific things that are slowing things down in general (aside from the subinfoboxes), that would be useful to know. Thanks. Mike Peel (talk) 20:19, 29 May 2020 (UTC)

Removing categories

@Mike Peel: : the categories that I removed from the core are fake almost always, never needed. They are only for specific categories (year numbers) that are categorized directly by their own template, separately from the infobox, without even performing any Wikidata query: they are resolved algorithmically and locally). These additional entries in Infobox just create lot of unneeded overhead, and frequent errorsn with fake entries added in these autocategories by year type or by month.
I did not need any sandbox to remove them directly, there was absolutely no degradation of functionality. And their cost is too expensive for all other unrelated pages (infobox/core needs serious optimization, it takes really too much time now, and lot of ressources on server, increased now by multiple subinfoboxes which were also added, multiplying the cost by several factors). Did you even notice any problem with this removal ? Did you ever look at pages with script errors (almost always by categories incorrectly listed as if they were years). We never need such autocategorization for years, all Gregorian years (and months) are categorized dirctly by their own template, with much lower cost. No need to add this for all other categories or pages that have an infobox. Additionally the names of the target categories are clearly wrong and are about to change.
Given the cost of the infobox/core, this unneeded overhead can be removed directly. verdy_p (talk) 16:23, 15 May 2020 (UTC)
@Verdy p: @Pigsonthewing: requested their addition, and they shouldn't take up much processing power. What you did was remove a symptom, not a cause. My plan was to move those higher up in the template code if necessary. In general, the way the development of this template works is that things are discussed here, sandboxed, then deployed in a batch to avoid invalidating cache too often. I've upped the page protection to admin-only edits to enforce that for now, although it hasn't been a problem until now... Thanks. Mike Peel (talk) 16:39, 15 May 2020 (UTC)
So what we need now to fix:
  • Lua needs to have its hash tables fixed (notably for all string keys): they don't work as intended (as a "fast hashed" access), and we've reached a point where the worst case is reached with most lookups for keys used in Wikidata JSON queries are only found by long scans over many nodes (the access time is then proportional to the total number of items in the table! This is no longer a fast hashed table access! Be careful with Lua tables using string keys, and notably any global "hashtable" used for string interning, supposed to save memory but which is very slow with all these scans caused by overlong collision chains, and a very inefficient internal representation of collision chains using additional storage for chaining "next" pointer in every table node!).
  • We need a better more compact representation of JSON query data: there's lot of unnecessary duplication of language codes associated to translated labels/aliases/descriptions, requiring the creation of an additional subtable for only these two items, even if these subtables are values for a specific language (the same) or values in an integer-indexed ordered table used as value for the same language. This is a defect of the current JSON query format (and JSON deserialization in Lua uses way too much memory, especially when loading the full data for a full item). For that we need a new query format (not the current JSON model which is very inefficient and really too much verbose, with overlong desrialization using lot of memory in Lua).
  • We need probably new more selective queries supported by Wikibase/Wikidata to load specific properties, and not the full set of properties with all their qualifiers (using an internal case in Modulewikidata will not solve the problem, everything is still loaded, in inefficient tables indexed by strings with lot of collisions and very slow lookup using scans of long chains).
Seriously, did I make something damageable ???? Consider removing these unnecessary lines in Infoxbox/core given they are never needed, produce lot of fake categorizations (caused by internal memory limits in Lua script), and removing it saves CPU time everywhere (in the wiki parser for templates). Infobox/core template is dramatically too complex and performs really tooo many Wikidata queries (and Module:Wikidata itself has severe performance problems as it is not selecvtive enough about the data it loads from the server). verdy_p (talk) 16:45, 15 May 2020 (UTC)
Module:Wikidata (and also Module:Wd) should be deprecated in favour of Module:WikidataIB, that was one of my plans to look through this weekend. Thanks. Mike Peel (talk) 16:52, 15 May 2020 (UTC)
@Verdy p: What performance increase did you get by removing the categories? I couldn't detect any when I tested it in the sandbox. --RexxS (talk) 18:45, 15 May 2020 (UTC)
It's not a question of "performance" (though it is still true) but memory usage. And definitely this template is too huge. Adding these categories also counts on the number of Wikidata queries performed on ALL pages using infoboxes, and there are still many that experience memorey exhaustion. We can save many unneeded queries and template expansion time on tons of pages that never need these categorizations: these subcategories are jsut for specific categories pages which are ALREADY categorized by their dedicated navbox, without performing any query and not depending at all with Wikidata.
In addition this blocks the renming of these categories (which are named only for their starting day ignoring the fact they are also categorizing the ending days and in fact every date in these years (or months). They are clearly not needed, we don't need the infobox to properly categorize these years and months.
Any way to reduce the cost of infobox by being more selective is a win (and clearly the infobox core is now really slow, and its cost on everypage must absolutely be reduced): 6-7 seconds per page is much too high, the server is now extrmely busy and cannot even refresh the pages correctly: it's busy 100% of the CPU, everyday, at all hours, only because of it (and notably since the introduction of subinfoboxes that were not even needed but added without any form of discussion, causing lot of errors and false categorizations everywhere).
You've not properly used the sandbox, and not thought at all if they were really needed (they are absolutely not needed in ANY of the relevant categories to which they would apply: this is duplicate work, and these also don't properly set the correct sort key, which is correct in the dedicated year and month navboxes).
So you reject my edit which is perfectly safe and goes in the right direction. But really harmful additions that were added without prior talk or any evaluation on a limited set of pages (using a sandbox version only for a subset of categories instead of being applied unconditionally everywhere) have been kept, causing major damages: the sandbox is not used as it should be: it's not intended to test a single page or preview, its effect mist be analyzed on a significant **subset** of real pages and NOT all pages using it (just to see some days laters tons of errors spread everywhere). verdy_p (talk) 06:01, 16 May 2020 (UTC)
verdy_p, It is not OK to be "improving" templates and modules actively maintained by other users, without discussing the proposed changes first and arranging best time to release the changes. You have made twice, without prior discussion, seemingly unnecessary changes to Module:Wikidata label altering 14M pages for unknown reasons. Now you are "fixing" this template against the wishes of its maintainers. I see you just got template editor rights (given to you by User:Magog the Ogre) allowing you to edit highly used templates and modules. That right is usually given to individuals trusted by the community to know and follow rules and traditions of this project. Please follow those rules and traditions or you will loose the template editor right. --Jarekt (talk) 04:17, 18 May 2020 (UTC)
Why the quotes around "improving". I explained above what I did. These were real needs (and related to other talks elsewhere). These were tested first and also after.
This huge template has lot of performance problems and what I did could certainly not hurt except going to the correct direction by a small step. verdy_p (talk) 07:23, 18 May 2020 (UTC)
The "wishes of maintainers " is not a policy. Everyone modifies what other are doing in any wiki, and improves what he thinks appropriate. Only when there are diagreement, there can be discussions. Thanks all Wikimedia wikis are not the property of the initial creator of any page. And Many things I've done have been later modified by others (including templates I create here). Ther is no express "wishes" from authors except the general consensus that these should not break the work of all others (like this Infobox/core now does to everyone, with its huge performance and resource usage problem that affects EVERYONE (and that I modestly wanted to fix as I explained you).
But visibly you continue ignoring all explications and want to keep the bad performances experiences by everyone, and continue to steal massive server ressources by repetedly adding more and more complication and more costs instead of fixing what is now a major problem. You have made repeated edits that have affected millions of pages on this wiki many times (and the server still cannot follow the speed of these additions, most pages are now outdated, and this site has never been as slow as it is today, and this continues to be worse and worse other time).
Can't you make a pause and start profiling this template and cleanup what is not even needed (like these lines that modestly remove things that are not even not needed but that also block other corrections discussed elsewhere). The problem of false cvategorization continues constantly, jut like the number of pages tracked with script errors.
The addition of subinfobox was not discussed and tested, still it has been applied massively (even if it is broken and made the situation very bad for everyone). I do not trust the initial maintainers that constantly want to add more and more compelxity and cost at huge price for servers and for all visitors).
So even if optimizations and removal of unneeded parts are modest, they are a step for a solution that must be progressively made: this goes with small things that you consider minor, but give nthe current costs, winning a bit somewhere is still benificial as there remains little or no ressources for any progress. Initial maintainers don't always have the best solution, they propose something, that can be improved, because they've not seen everything. And I've NOT broken anything in terms of functionality by removing only something that was completely unneeded but just adding more problems. verdy_p (talk) 09:57, 20 May 2020 (UTC)

Photo stretching

File:John Jacob Astor.jpg appears stretched horizontally (too fat) in the Wikidata Infobox on Category:John Jacob Astor, but it looks fine on the file description page and d:Q57423.   — Jeff G. please ping or talk to me 16:16, 24 July 2020 (UTC)

@Jeff G.: Which browser are you using, please? In Firefox on a Mac, I see it at 206px × 250px pixels, which is the same aspect ratio (82%) as the original. Thanks. Mike Peel (talk) 16:40, 24 July 2020 (UTC)
@Mike Peel: Chrome 37.0.2062.60 and Safari 6.1 on my iPad. The image is supposed to be 250 × 304, but ends up about 518 × 518 square.   — Jeff G. please ping or talk to me 17:06, 24 July 2020 (UTC)
@Jeff G.: I can't reproduce it on my computer. Can you try this link and see if it is still a problem? Thanks. Mike Peel (talk) 17:18, 24 July 2020 (UTC)
@Mike Peel: I purged before reporting. I have 2 screenshots and 1 crop I could send or post.   — Jeff G. please ping or talk to me 17:25, 24 July 2020 (UTC)
@Jeff G.: I changed the category to use the sandbox and undid some recent stylesheet changes there, that's what I wanted you to test. Can you try again please? Sorry, this might be a painful process, as I can't reproduce it, so all I can do is change things that might have caused it and ask you to keep testing it... Thanks. Mike Peel (talk) 17:30, 24 July 2020 (UTC)
@Mike Peel: Ok, sorry, I didn't realize you had changed something. It looks the same on both browsers on my iPad, but looks fine in Chrome 83.0.4103.116 (Official Build) (64-bit) (cohort: Stable) on my Windows 10 laptop.   — Jeff G. please ping or talk to me 17:46, 24 July 2020 (UTC)
Thanks. @Verdy p: The changes I undid in the sandbox were your edits to the stylesheet, would you be able to have a look and see what's happening here please? Thanks. Mike Peel (talk) 17:52, 24 July 2020 (UTC)
@Mike Peel: Unfortunately, Verdy p is waiting out his block.   — Jeff G. please ping or talk to me 18:30, 24 July 2020 (UTC)
Oops, it seems I missed that whole discussion. I'll try to look at this again tomorrow (I have other things I want to get on with this evening) to see if I can figure it out. Thanks. Mike Peel (talk) 18:42, 24 July 2020 (UTC)
@Mike Peel: No worries, enjoy your evening.   — Jeff G. please ping or talk to me 18:58, 24 July 2020 (UTC)

Incorrect categorization

Hi! {{Wikidata Infobox}} currently categorizes Category:Alexi Laiho under Category:Death, probably because Wikidata:Q270970 has Wikidata:Q4 as the value of the end cause qualifier in the work period (end) property. ––Apalsola tc 23:07, 4 January 2021 (UTC)

This also applies to items with qualifiers on P2031 values (work period start), e.g., on Category:Kyōko Fukada, Category:Ted White (stuntman), and Category:Shirley Temple. --ghouston (talk) 21:45, 19 January 2021 (UTC)
@Apalsola and Ghouston: This should be fixed in {{Wikidata Infobox/sandbox}}, please could you test it in the affected categories? Thanks. Mike Peel (talk) 11:54, 4 February 2021 (UTC)
Thanks, that version seems good. --ghouston (talk) 12:08, 4 February 2021 (UTC)
@Mike Peel: Thanks, the template still displays empty parentheses after the "Work period (end)" value but categorization is now correct. ––Apalsola tc 15:24, 4 February 2021 (UTC)

Populate categories on Commons based on inception (P571)

Hi!

I think it would be helpful to start adding the category Built in country (P17) in inception (P571) automatically if the value is supplied in Wikidata and at least contains a year value (without any uncertainty qualifiers). Would save a lot of work adding information to Commons that is readily available on Wikidata (with the option to also properly reference the year of construction, which is not the case on Commons right now). Cheers, Braveheart (talk) 22:50, 30 June 2021 (UTC)

inception (P571) is not only for things that are built. For example, an institution/company or a settlement can well have this property, but New York City (Q60) was not built in the US in 1624/1626 (and not only because the US hasn’t existed yet back then); Samsung (Q20716) was not built in South Korea in 1938 etc. —Tacsipacsi (talk) 22:58, 30 June 2021 (UTC)
Don't think this makes sense outside of buildings anyway, sorry if that wasn't clear. The commons categories "built in xyz in 123" should relate to current day countries, otherwise you get into a real muddle. Braveheart (talk) 11:27, 1 July 2021 (UTC)
Not that inception (P571) is use inconsistently even for buildings in a case of construction lasting several years. In some cases inception (P571) is used to indicate end of construction, while in some cases it is used to indicate start of construction. date of official opening (P1619) is more precise.Jklamo (talk) 16:02, 1 July 2021 (UTC)
Either works :-) Braveheart (talk) 16:25, 1 July 2021 (UTC)
@Braveheart, Jklamo, and Tacsipacsi: This was actually previously implemented, but removed after the deployment caused errors. See Template_talk:Wikidata_Infobox/Archive_2#Wikidata_Infobox_adds_irrelevent_categories_to_pages. I'm not sure what needs to change from the previous implementation to work better - perhaps a list of accepted instance of (P31) values? But I can't see an easy way to implement this that wouldn't potentially cause problems. Thanks. Mike Peel (talk) 18:40, 20 August 2021 (UTC)

Bridge number

@Mike Peel: Please display bridge identifier bridge number (P9759) where it exists. --ŠJů (talk) 12:24, 24 July 2021 (UTC)

@ŠJů: It's now in {{Wikidata Infobox/sandbox}}, please test it. Thanks. Mike Peel (talk) 12:31, 24 July 2021 (UTC)
@Mike Peel: I tested it for Category:Charles Bridge and Category:Bridge in Lékařova Lhota and the output is not visible in the output of the infobox. Btw., this property is not an unique identifier linked to any register but rather a supplement or substitute for the bridge name, i.e. it should be rather in the head of the infobox beside (below) the bridge name and label, than in the foot among "authorities". --ŠJů (talk) 13:37, 24 July 2021 (UTC)
@ŠJů: Sorry, it was displaying the wrong label, now fixed. I put it just below location, I can move it to elsewhere in the infobox if you'd prefer. Thanks. Mike Peel (talk) 13:47, 24 July 2021 (UTC)
@Mike Peel: There is a mistake somewhere, it is still not visible anywhere. --ŠJů (talk) 13:54, 24 July 2021 (UTC)
@Mike Peel: I'm sorry, I tested it the wrong way. It seems to be working properly. --ŠJů (talk) 14:08, 24 July 2021 (UTC)
OK, I'll leave this in the sandbox for now, after I've implemented a few other changes I'll deploy them as a batch. Thanks. Mike Peel (talk) 14:41, 24 July 2021 (UTC)

Bridges, POIs, adress format

@Mike Peel: Thank You. Some other ideas:

  • I would like to see Mapy.cz ID (P8988) link in the infobox. This POI identifier is widely used especially for Czech localizable items and it is useful to see at a glance whether this entry is filled out in Wikidata (and it enables also direct leap to that on-line map). If some other notable online maps have similar POIs as properties in Wikidata, their links could be in the infobox as well (is OpenStreetMap relation ID (P402) implemented already?). If Mapy.cz ID (P8988) string (value) starts with "osm&", than OpenStreetMap relation ID (P402) is derrivable from that value. (Google Map probably has not linkable POIs).

Thank You. --ŠJů (talk) 17:15, 26 July 2021 (UTC)

This category seems broken

Category:COVID-19 pandemic in Hungary seems overflowed resulted from the big data of Wikidata. Could anyone help?--迴廊彼端 (talk) 00:43, 17 August 2021 (UTC)

User:Tacsipacsi from Wikidata told me that it's OK in Hungary edition however broken in Chinese edition. --迴廊彼端 (talk) 13:26, 17 August 2021 (UTC)
@Mike Peel: Could you help this?Thanks.--迴廊彼端 (talk) 10:51, 20 August 2021 (UTC)
This seemed to come from the sandbox version of the template which was used in the category. I removed the infobox template there so the category should work again. De728631 (talk) 12:31, 20 August 2021 (UTC)

@迴廊彼端, Tacsipacsi, and De728631: The problem is that COVID-19 pandemic in Hungary (Q87119811) is 4MB(!) of structured data. The infobox can't cope with that without a full recode (planned at phab:T273109, but needs a Lua expert). I've raised this case for discussion at wikidata:Wikidata:Project_chat#Remove_datasets_from_COVID-19_items?. Thanks. Mike Peel (talk) 18:07, 20 August 2021 (UTC)

Links to other projects

Hi

The template presents a link to wikipedia about the subject, but no link to other projects (wikibooks, wikiversity, wikisource, ...). Why only wikipedia ?

-- ◄ David L • discuter ► 09:25, 8 October 2021 (UTC)

Moin Moin User:DavidL,
  • do you have an example? Because in the code I see "wiki, wikiquote, wikisource, wikivoyage, specieswiki"
  • @Mike Peel: Will it be enough, to add the following code in /core under "sidelinks"?
{{#invoke:WikidataIB | getSiteLink | qid={{{qid|}}} | wiki={{#invoke:WikidataIB|siteID}}wikibooks}}<!-- -->{{#invoke:WikidataIB | getSiteLink | qid={{{qid|}}} | wiki={{#invoke:WikidataIB|siteID}}wikinews}}<!-- -->{{#invoke:WikidataIB | getSiteLink | qid={{{qid|}}} | wiki={{#invoke:WikidataIB|siteID}}wikiversity}}
and
{{#if:{{#invoke:WikidataIB | getSiteLink | qid={{{qid|}}} | wiki={{#invoke:WikidataIB|siteID}}wikibooks}}<!-- --> | <br />[[File:Wikibooks-logo.svg | 18px | link=]] [[:wikibooks:{{#invoke:WikidataIB|projID}}:{{#invoke:WikidataIB | getSiteLink | qid={{{qid|}}} | wiki={{#invoke:WikidataIB|siteID}}wikibooks}} | {{#invoke:WikidataIB | getLabel | Q367}}]]}}
Regards --Crazy1880 (talk) 19:03, 8 December 2021 (UTC)
@DavidL and Crazy1880: Sorry for the delay. I think the code you suggest is good, except it copies existing checks a bit too much. I've implemented this (copy-pasting the existing code and then tweaking it, so it might not exactly match your code) at [16], please double-check it, I'll deploy it soon. Thanks. Mike Peel (talk) 19:39, 26 December 2021 (UTC)
Moin Mike Peel, no problem for the delay. Could it be, that I see in your Diff that you added wikibooks two times? And what will we do with wikinews and wikiversity? Regards --Crazy1880 (talk) 19:44, 26 December 2021 (UTC)
@Crazy1880: Oops, this edit should add the other two. Thanks. Mike Peel (talk) 20:17, 26 December 2021 (UTC)