Community Wishlist Survey 2021/Archive/Search Wikidata items from Lua

From Meta, a Wikimedia project coordination wiki

Search Wikidata items from Lua

  • Problem: There is impossible to look for Wikidata item if no article is associated with the item. However many of the items are filled with properties of type 'external identifier'. The identifiers are mostly (I hope) unique by design. I wish to use them for searching.
  • Who would benefit: Template designers.
  • Proposed solution: Provide new API function in Lua interface: mw.wikibase.getEntityIdForExternalId( propertyId, externalIdValue )
  • More comments: The ability for searching gives us opportunity to create generic citation template, which might be easier to use.
  • Phabricator tickets:
  • Proposer: Paweł Ziemian (talk) 23:09, 27 November 2020 (UTC)[reply]

Discussion

  • @Paweł Ziemian: I'm not sure I quite understand. Do you mean for when you want to use Wikidata in a page with no sitelink, but you do have an external identifier? In that situation, why wouldn't you be able to use a Wikidata ID instead? That could then be used to retrieve the external ID as well as anything else. You mention a generic citation template — is something like {{Cite Q}} what you have in mind? —Sam Wilson 00:17, 4 December 2020 (UTC)[reply]
    • Some external identifier are much easier to find. Let compare Qid to RFC or DOI number. The Q is magic and not easy available. In contrast, DOI or RFC are printed in the document. Paweł Ziemian (talk) 19:57, 4 December 2020 (UTC)[reply]
      • That's true, but even if you already know the DOI, the Wikidata item needs to have been created, and then searching Wikidata with the relevant identifier works perfectly well. For example, if you want to cite the DOI Handbook but only know it's DOI of 10.1000/182, then searching Wikidata for that finds it, at which point you can cite Q69415441 instead. —Sam Wilson 02:23, 7 December 2020 (UTC)[reply]
        • But this method is very inconvinient for Wikipedia editors. Needs some additional work. More effective solution is to write article related content and put dot and reference to cited document as easy as possible. As far as RFC is concerned, I was able to manage it via private map from RFC id to Qid. But this solution is possible only for cases when the whole set of identifiers is relatively small. Paweł Ziemian (talk) 20:37, 8 December 2020 (UTC)[reply]