Module:HAND links
This module generates external links for a real person or fictional character using its HAND (Human and Digital) Talent ID (P14750) values from Wikidata.
Usage
{{#invoke:HAND links|links}}
The property may also be supplied explicitly:
{{#invoke:HAND links|links|P14750}}
Output
For every valid P14750 statement, the module produces links to:
- HAND non-profit trade association and DOI registration agency
For example, a P14750 value of 2AB3-AD5F-24CE-BCCA-CF47 produces:
* [https://doi.org/10.232/AB3-AD5F-24CE-BCCA-CF47 HAND ID] – database of real people or fictional characters in the HAND (Human and Digital) Talent ID registry
Multiple values
If an item has more than one P14750 statement, each value is handled separately. The identifiers are not combined into a comma-separated URL.
Duplicate values are ignored.
No value
The module returns no output when:
- the page is not connected to a Wikidata item;
- the item has no P14750 statements; or
- none of the statements contains a valid string or numeric value.
No additional #if parser function is required. The module
should be invoked directly:
{{#invoke:HAND links|links}}
Do not place the invocation inside the previous
construction.
Parameter
| Parameter | Description | Default |
|---|---|---|
1
|
Wikidata property containing HAND (Human and Digital) Talent ID | P14750
|
See also
local p = {}
function p.links(frame)
local entity = mw.wikibase.getEntity()
if not entity then
return ""
end
local property = frame.args[1] or "P14750"
local claims = entity.claims and entity.claims[property]
if not claims then
return ""
end
local links = {}
for _, claim in ipairs(claims) do
local mainsnak = claim.mainsnak
local value = mainsnak
and mainsnak.snaktype == "value"
and mainsnak.datavalue
and mainsnak.datavalue.value
if type(value) == "string" or type(value) == "number" then
local code = tostring(value)
local encodedCode = mw.uri.encode(code, "PATH")
local countryCode = mw.uri.encode(
mw.ustring.lower(mw.ustring.sub(code, 1, 2)),
"PATH"
)
table.insert(
links,
"* [https://doi.org/10.23/"
.. encodedCode
.. " HAND ID] – Their entry in the HAND (Human and Digital) Talent ID registry of real people and fictional characters"
)
end
end
return table.concat(links, "\n")
end
return p