This template is within the scope of WikiProject Wikidata, a collaborative effort to improve Wikipedia's integration with Wikidata. If you would like to participate, please visit the project page.WikidataWikipedia:WikiProject WikidataTemplate:WikiProject WikidataWikidata
Why does this template generate links as external links, when Wikilinks should work perfectly well? For instance, {{q|42}} emits
[https://www.wikidata.orghttps://demo.azizisearch.com/lite/wikipedia/page/Special:EntityPage/Q42 Douglas Adams <small>(Q42)</small>]
which looks like this: Douglas Adams (Q42)
But it could yield
[[d:Q42|Douglas Adams <small>(Q42)</small>]] which looks like this Douglas Adams (Q42)
This template did generate interwiki links as shown above until 7 September 2017 it was changed to generate external links using {{#invoke:Wikibase|wdurl}}. I have updated the template so it displays interwiki links again, while also retaining the other functionality that was added to use the template without a parameter (as shown in the template's updated documentation). -- Zyxw (talk) 03:18, 19 January 2019 (UTC)[reply]
What exactly is the benefit of using interwiki links over external links or vice versa? Aren't external links easier to search for? It looks like this was using mw.wikibase.getEntityUrl (via {{#invoke:Wikibase|wdurl}} as mentioned before). Also this template is named "Wikidata entity link" but it does not link to the entity but to its data description (You can learn about the difference at Linked Data interface and Wikidata identifiers). We should probably link to either the real entity link (via https://www.wikidata.org/entity/ ; notice this cannot be reached via interwiki links) or use the entity data link d:Special:EntityData/, e.g., https://www.wikidata.org/entity/P31 or d:Special:EntityData/P31. Notice prefixes like "Property:" and "Lexeme:" are not necessary in these cases. It should also be noted that the current template does not handle all entity types, e.g., {{Wikidata entity link|L3}} fails to properly link to d:Special:EntityData/L3 (I am not sure this matters yet as lexeme entities do not have labels for such links anyway but it should be something to think about). 17.226.15.91 (talk) 01:18, 21 June 2019 (UTC)[reply]
I was thinking it would be nice if a second parameter could be added to this template, allowing users to choose label text for the link. For example, {{Wikidata entity link|1=Q42|2=Information about Douglas Adams on Wikidata <small>(Q42)</small>}} would yield something like this: Information about Douglas Adams on Wikidata (Q42). Thoughts?
Edward-Woodrow (talk) 00:40, 22 May 2023 (UTC)[reply]
When the Label value for EnglishLanguage is blank, then his should be attempting to retrieve the Label value for default for all languagesLanguage. See what is there for English & default for all languages for Q42. Peaceray (talk) 23:26, 29 August 2024 (UTC)[reply]
This template uses Module:Wd to get the entity label from Wikidata:
@Peaceray: I personally would prefer moving to a solution based upon Module:Wikidata label (Q22050722) which does not have this problem (unless one specifies a specific language and then it does not fallback to mul). This is what Wikidata, Commons, Mediawiki and even Meta (sadly despite using that module to obtain the label this template messed up and it does not fallback to using mul there forcing label lookups to default to the page language) use and why they to not see this issue for this template (except Meta as previously commented on). The problem is many Wikidata modules (like Module:Wd (Q24733825)) think they are doing you a service by fetching a specific language label using mw.wikibase.getLabelByLang() instead of using a different interface that implements proper language fallbacks, see mw.wikibase API. For this issue you can clearly see the issue at Module:Wd#L-704 (in particular see the comment). —Uzume (talk) 13:58, 30 August 2024 (UTC)[reply]
It would be useful if the output of this template append to the title attribute the description from Wikidata. For example for Birmingham (Q2256), that would (at the time of writing) render as "d:Special:EntityPage/Q2256 - city in West Midlands, England" (maybe we could drop the "d:Special:EntityPage/" part?). This would be useful for disambiguating the target from others with the same title, such as in my example, Birmingham, Alabama. The same should be done for properties (e.g. ORCID iD (P496))). Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits13:21, 1 September 2024 (UTC)[reply]
I disagree. I don't think it is good to complicate a simple template with a well-defined scope. The displayed QID and the linked entity are, in my opinion, a sufficient disambiguators. Of course, a separate template with the behavior you described could be created. Janhrach (talk) 18:35, 12 September 2024 (UTC)[reply]
@Janhrach: I think Andy means he wants {{wde|Q2256}} to display more like Birmingham (Q2256) (notice the difference when hovering over the link) vs. the current Birmingham (Q2256). I manually created this link leveraging some code from {{tooltip}} but we will want to be a little more robust like that template does (i.e., using {{#invoke:string|replace|description|"|"}}) in case the WD description contains quotation marks. —Uzume (talk) 00:15, 13 September 2024 (UTC)[reply]
Wikidata descriptions are intended to be short. Note the first sentence of d:Help:Description (English language version); and the second of three bullet points in the "This page in a nutshell" box at the top of that page. The page continues "In most cases, the proper length is between two and twelve words... If the description goes onto a second line it is probably too long, and if it goes onto a third line, it is almost definitely too long.". Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits18:53, 17 September 2024 (UTC)[reply]