Template talk:Wikidata entity link

(Redirected from Template talk:Q)
Latest comment: 1 year ago by Edward-Woodrow in topic Add title parameter?
WikiProject iconWikidata
WikiProject iconThis 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.

Rename edit

This template will give links to items and properties. With that in mind, is there a better name for it? — Martin (MSGJ · talk) 10:49, 18 September 2015 (UTC)Reply

Suggest Template:Wikidata entity link — Martin (MSGJ · talk) 11:53, 21 September 2015 (UTC)Reply
  Done — Martin (MSGJ · talk) 13:56, 23 September 2015 (UTC)Reply
I am not sure how I feel about this. Template:Q at least should always redirect here. Blue Rasberry (talk) 14:04, 23 September 2015 (UTC)Reply
It does and it will :) — Martin (MSGJ · talk) 15:40, 23 September 2015 (UTC)Reply

Matching property template edit

Is there a matching property template on English Wikipedia? Pigsonthewing, do you know? Blue Rasberry (talk) 21:47, 3 December 2015 (UTC)Reply

This will do both. I've added an example to the documentation. — Martin (MSGJ · talk) 21:52, 3 December 2015 (UTC)Reply
Oh! Thanks. Blue Rasberry (talk) 21:54, 3 December 2015 (UTC)Reply

Generating Wikilinks from Wikidata edit

Is there a template that produces a link to the relevant Wikipedia article if you enter the Wikidata item? i.e. Q666063 would produce National Library of Wales instead of National Library of Wales (Q666063) and Q17735890 would produce Old College instead of Old College (Q17735890). I'm translating a long list of links from English into Welsh for Wikipedia:WikiProject Wales/Awaken the Dragon but most of the Welsh translations already exist on Wikidata. Ham II (talk) 09:47, 12 February 2016 (UTC)Reply

Ham II, This does seem like it would be useful at times. I noticed that Spanish Wikipedia seems to have such a template, es:Plantilla:Q obra. I don't know if the Lua syntax could simply be carried over. Rigadoun (talk) 23:43, 27 February 2018 (UTC)Reply
Hi Ham II and Rigadoun. This can be done with {{wikidata|label|linked|Q...}}:
I believe Template:LinkedLabel ought to provide this functionality in a more convenient way, which would also match the Wikidata equivalent, but it seems to produce an edit link, for some reason. Pinging its creator D1gggg for further commentary. --Waldir talk 12:23, 5 June 2018 (UTC)Reply

Link format edit

Why does this template generate links as external links, when Wikilinks should work perfectly well? For instance, {{q|42}} emits

  • [https://www.wikidata.org/wiki/Special:EntityPage/Q42 Douglas Adams <small>(Q42)</small>] which looks like this: Douglas Adams (Q42)

But it could yield

I'm no Lua expert, but surely this would be possible. --Redrose64 🌹 (talk) 22:05, 6 February 2018 (UTC)Reply

Ask 50.53.1.33 (talk · contribs · WHOIS) -- no wait, they haven't edited since October. {{3x|p}}ery (talk) 23:00, 7 February 2018 (UTC)Reply
It uses Module:Wikibase function wdurl. Indeed it should better generate interwiki links! --Marsupium (talk) 11:10, 18 May 2018 (UTC)Reply
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
  Thank you --Redrose64 🌹 (talk) 16:46, 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

Wikilink to the French article? edit

When I know the QID, can I link to the French article via WD, automatically?

On enwiki:
Douglas Adams == Douglas Adams (Q42)
Then {{some template or module|lang=fr|qid=Q42}}fr:Douglas Adams
... and zh:道格拉斯·亚当斯

-DePiep (talk) 18:01, 28 October 2020 (UTC)Reply

This obviously will only work if there are appropriate sitelinks for associated Wikidata item but methinks you are looking for: d:Special:GoToLinkedPage/frwiki/Q42 and d:Special:GoToLinkedPage/zhwiki/Q42Uzume (talk) 20:57, 2 November 2020 (UTC)Reply
 Y good for me. -DePiep (talk) 21:04, 2 November 2020 (UTC)Reply

Removing Wikidata entity link edit

Someone is massively removing enwiki code using this template, eg https://en.wikipedia.org/w/index.php?title=Corumb%C3%A1_International_Airport&oldid=1041289573&diff=prev Is there clear enwiki rule to ban Wikidata entity link inside an article ? Bouzinac (talk) 19:24, 29 August 2021 (UTC)Reply

As I said in my edit summary, Wikipedia talk:Manual of Style/Archive 204#New RFC on linking to Wikidata is the clear enwiki rule you are looking for. The claim you keep making that that RfC [is] without clear conclusions (quote from Wikipedia:Village pump (idea lab)#Create template/link for things that have Wikidata items, but not articles) is wishful thinking unsupported by the actual closing statement of the RfC. * Pppery * it has begun... 15:18, 30 August 2021 (UTC)Reply
Wikipedia:Wikidata#Appropriate usage in articles - specifically this point: "Wikidata should not be linked to within the body of the article except in the manner of hidden comment(s) as to mentioning the Q-number." 192.76.8.74 (talk) 16:51, 30 August 2021 (UTC)Reply

Add title parameter? edit

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