Page MenuHomePhabricator

Convert Template:Authority_control to Lua and use Wikidata
Closed, ResolvedPublic

Description

https://commons.wikimedia.org/wiki/Template:Authority_control is currently a classic template, this should be converted to Lua at https://commons.wikimedia.org/wiki/Module:Authority_control. We don't have to start from scratch, https://en.wikipedia.org/wiki/Module:Authority_control could probably be used as a basis.

The point of doing this would be to add support for pulling information not given in the template call from the item given in the wikidata parameter; the only impact this should have on a fully filled-in invocation of the template is to (potentially) add it to some hidden tracking categories.
(Though it could be tricky to work out precisely when tracking categories are appropriate; perhaps just in the main, Category, Institution, and Creator namespaces?)

While the enwp module hard-codes the URL format for each type of identifier, the Commons template should probably use the formatter URL (P1630) property found on the wikidata property for each identifier; see VIAF identifier (P214) for an example.

Related Objects

StatusSubtypeAssignedTask
ResolvedLydia_Pintscher
ResolvedJarekt
ResolvedNone
ResolvedLydia_Pintscher
Resolveddaniel
Resolveddaniel
Resolveddaniel
Resolveddaniel
Resolveddaniel
Resolveddaniel
Resolveddaniel
ResolvedNone
Invaliddaniel
Resolveddaniel
Resolveddaniel
Resolveddaniel
Resolveddaniel
Resolveddaniel
Resolveddaniel
Resolvedhoo
DuplicateNone
Resolvedhoo

Event Timeline

Multichill raised the priority of this task from to Medium.
Multichill updated the task description. (Show Details)
Multichill added subscribers: Aklapper, Multichill.

It's not in Lua, but there's some work to push data from arbitrary-access wikidata through the existing Authority Control template at
https://www.wikidata.org/wiki/Template:Authority_control/wrapper

Despite all the red ink when called without an argument, it does pretty much work -- see eg
https://www.wikidata.org/wiki/Template:Creator/wrapper/test
https://www.wikidata.org/wiki/Template:Institution/wrapper/test
for a couple of test-pages.

Some Wikipedias and Wikisources already use a Lua module for Authority Control template. Using it also in Commons may be interesting: https://en.wikipedia.org/wiki/Module:Authority_control

It would preferably be possible for this to just magically work on Institution and Creator pages that already supply the wikidata parameter to the respective template, whether they explicitly invoke {{authority control}} or not. Is that a thing that can be done?

It would preferably be possible for this to just magically work on Institution and Creator pages that already supply the wikidata parameter to the respective template, whether they explicitly invoke {{authority control}} or not. Is that a thing that can be done?

That would need T49930.

Ricordisamoa renamed this task from Convert Template:Authority_control to LUA and use Wikidata to Convert Template:Authority_control to Lua and use Wikidata.Apr 20 2015, 6:55 AM
Ricordisamoa updated the task description. (Show Details)
Ricordisamoa set Security to None.

Another way could be to use a module made to work in any wiki, even central, in several or all languages.
We could use, or extract, only the function p.notice(frame) of https://fr.wikisource.org/wiki/Module:Author3
Living example:
https://fr.wikisource.org/wiki/Auteur:Nelson_Mandela

This would be a good "Google-Code-In-2015" project and I can volunteer to mentor (as in https://www.mediawiki.org/wiki/Google_Code-in_2015#Mentors.27_corner) whoever might try it. I think ideally we would reuse as much of existing LUA code as possible , but we would have to add:

  1. Internationalization of a lot of text so it shows up in the language of the viewer
  2. "bare" option used by Creator and Institution templates
  3. Initially it would not rely on wikidata stored parameters but when at some point we get arbitrary access to wikidata on Commons than we should be able to switch to using wikidata values when present.

Waiting for update. Thanks.

@Yann: From who? About what? If you have specific questions, please ask them. Thanks!

Waiting for update. Thanks.

You can already start working on this. Only when arbitrary access is enabled the full functionality becomes available.