Différences entre versions de « Module:Notice Autorité »
(Page créée avec « --[[ -- Debug console frame = mw.getCurrentFrame() -- Get a frame object newFrame = frame:newChild{ -- Get one with args title = 'Alfred Baudrillart' , args = { iri =… ») |
|||
Ligne 29 : | Ligne 29 : | ||
− | select ?prop ?propLabel ?ID ?formater ?logo | + | select DISTINCT ?prop ?propLabel ?ID ?formater # ?logo |
where { | where { | ||
Ligne 36 : | Ligne 36 : | ||
?prop wikibase:directClaim ?propClaim . | ?prop wikibase:directClaim ?propClaim . | ||
?prop wdt:P1630 ?formater . | ?prop wdt:P1630 ?formater . | ||
− | ?prop wdt:P2378 ?entity . | + | # ?prop wdt:P2378 ?entity . |
− | ?entity wdt:P154 ?logo . | + | # ?entity wdt:P154 ?logo . |
wd:Q666551 ?propClaim ?ID . | wd:Q666551 ?propClaim ?ID . | ||
Ligne 43 : | Ligne 43 : | ||
SERVICE wikibase:label { | SERVICE wikibase:label { | ||
− | bd:serviceParam wikibase:language "en | + | bd:serviceParam wikibase:language "fr,en" . |
} | } | ||
Ligne 51 : | Ligne 51 : | ||
-- linkedwiki.print_r(result) | -- linkedwiki.print_r(result) | ||
− | local text = "" | + | local text = "<span class='plainlinks module-oeuvres-vignettes'>" |
local i = 0 | local i = 0 | ||
local row = nill | local row = nill | ||
+ | local link = nil | ||
+ | local logo = nil | ||
row = result['result']['rows'][i] | row = result['result']['rows'][i] | ||
while( row ~= nil ) | while( row ~= nil ) | ||
do | do | ||
--linkedwiki.print_r(row) | --linkedwiki.print_r(row) | ||
+ | link = string.gsub(row["formater"], "$1",row["ID"]) | ||
− | + | -- if string.sub( row["logo"], -3 ) == 'svg' then | |
+ | -- logo = "[[".. string.gsub(row["logo"], "http://commons.wikimedia.org/wiki/Special:FilePath/","File:").."|70px|link=".. link .. "]]" | ||
+ | -- else | ||
+ | -- logo = "[" .. link .. " " .. logo .. "]" | ||
+ | -- end | ||
+ | |||
+ | text = text .. " [".. link .. " ".. row["propLabel"] .. "] " | ||
i = i + 1 | i = i + 1 | ||
row = result['result']['rows'][i] | row = result['result']['rows'][i] | ||
end | end | ||
+ | |||
+ | local text = text .. "</span>" | ||
return text | return text |
Version du 21 novembre 2021 à 14:52
Utilisation
Ce module a pour fonction de pouvoir afficher les notices d'un auteur via Wikidata
Exemple d'utilisation
{{#invoke:Oeuvres de l'auteur|section | Wikidata ID = Q666551 }}
Résultat pour Alfred Baudrillart
identifiant Freebase identifiant BAnQ d'autorité identifiant de la Bibliothèque du Congrès identifiant Bibliografie dějin Českých zemí (UUID) identifiant Catholic Hierarchy d'une personne identifiant Bibliothèque nationale de France identifiant IdRef identifiant NACSIS-CAT d'un auteur identifiant Bibliothèque nationale d'Australie identifiant SBN d'un auteur identifiant Université de Barcelone (obsolète) identifiant Open Library identifiant Bibliothèque nationale d'Israël identifiant CONOR.SI identifiant VIAF identifiant ISNI identifiant GND (DNB) identifiant Bibliothèque nationale tchèque identifiant Bibliothèque royale des Pays-Bas identifiant NLA Trove identifiant BIBSYS d'une personne identifiant Bibliothèque apostolique vaticane ancien identifiant Bibliothèque nationale de Catalogne identifiant NUKAT identifiant Rijksmuseum Research Library identifiant Bibliothèque nationale de Pologne identifiant Académie française d'un membre identifiant CiNii Research identifiant The Cardinals of the Holy Roman Church identifiant CoBiS identifiant VcBA identifiant World Biographical Information System identifiant FAST identifiant CANTIC identifiant Unz d'un auteur identifiant Lietuvos nacionalinė Martyno Mažvydo biblioteka identifiant d’autorité de noms Canadiana identifiant de la Bibliothèque nationale du Chili identifiant Bibliothèque nationale d'Irlande identifiant Bibliothèque nationale d'Irlande identifiant Bibliothèque nationale de Grèce identifiant RERO identifiant RERO identifiant J9U de la Bibliothèque nationale d'Israël identifiant Biblioteca Virtual Miguel de Cervantes d'une personne identifiant Université pontificale de la Sainte-Croix identifiant Angelicum identifiant Angelicum identifiant RHE d'un docteur identifiant Persée d'un auteur identifiant La France savante CTHS identifiant Bibliothèque nationale du Portugal identifiant Bibliothèque nationale d'Espagne (datos.BNE.es) identifiant WorldCat Entities identifiant Teresianum d'une autorité identifiant web Léonore identifiant catalogue général Diamond identifiant CONOR.SR identifiant Bibliographie de l’histoire de France d’une personne identifiant de nomination de personnes au prix Nobel identifiant Babelio d'un auteur identifiant Social Networks Archival Context identifiant Prabook identifiant SHARE Catalogue identifiant Université pontificale de Salamanque identifiant Biblioteca Iglesia Nacional Española en Roma identifiant FranceArchives agent identifiant SEARCH on line catalogue identifiant Institut pontifical d'archéologie chrétienne identifiant d’autorité Bibliothèque royale de Belgique identifiant Biblioteca di Santa Sabina identifiant Académie française d'un lauréat identifiant Université de Barcelone identifiant Index Theologicus identifiant Franciscan Center of Christian Oriental Studies identifiant Franciscan Center of Christian Oriental Studies identifiant EBAF d'autorité identifiant Biblioteche della Custodia di Terra Santa a Gerusalemme identifiant Académie d'Athènes identifiant Parsifal identifiant Our Campaigns d'un candidat identifiant Université pontificale grégorienne Identifiant CIRDOC d'un auteur ou d'une autrice identifiant DDB d'une personne
Paramétres
Wikidata ID
: Id de Wikidata
--[[
-- Debug console
frame = mw.getCurrentFrame() -- Get a frame object
newFrame = frame:newChild{ -- Get one with args
title = 'Alfred Baudrillart' ,
args = {
iri = 'https://gregorius.dsi.universite-paris-saclay.fr/wiki/Alfred_Baudrillart' ,
["Wikidata ID"] = 'Q666551'
}
}
mw.log(p.section( newFrame ) )
]]
local p = {}
local linkedwiki = require 'linkedwiki'
function p.section(f)
local object = linkedwiki.new()
object:setConfig("http://www.wikidata.org")
mw.log(object:getConfig())
local result = object:query( [[
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
select DISTINCT ?prop ?propLabel ?ID ?formater # ?logo
where {
?prop wdt:P31/wdt:P279* wd:Q18614948 .
?prop wikibase:directClaim ?propClaim .
?prop wdt:P1630 ?formater .
# ?prop wdt:P2378 ?entity .
# ?entity wdt:P154 ?logo .
wd:Q666551 ?propClaim ?ID .
SERVICE wikibase:label {
bd:serviceParam wikibase:language "fr,en" .
}
}
LIMIT 100
]] )
-- linkedwiki.print_r(result)
local text = "<span class='plainlinks module-oeuvres-vignettes'>"
local i = 0
local row = nill
local link = nil
local logo = nil
row = result['result']['rows'][i]
while( row ~= nil )
do
--linkedwiki.print_r(row)
link = string.gsub(row["formater"], "$1",row["ID"])
-- if string.sub( row["logo"], -3 ) == 'svg' then
-- logo = "[[".. string.gsub(row["logo"], "http://commons.wikimedia.org/wiki/Special:FilePath/","File:").."|70px|link=".. link .. "]]"
-- else
-- logo = "[" .. link .. " " .. logo .. "]"
-- end
text = text .. " [".. link .. " ".. row["propLabel"] .. "] "
i = i + 1
row = result['result']['rows'][i]
end
local text = text .. "</span>"
return text
end
return p