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 de la Bibliothèque du Congrès identifiant BAnQ d'autorité identifiant Freebase identifiant Bibliografie dějin Českých zemí (UUID) identifiant Bibliothèque nationale de Pologne identifiant VcBA identifiant d’autorité de noms Canadiana identifiant J9U de la Bibliothèque nationale d'Israël identifiant ISNI identifiant GND (DNB) identifiant Bibliothèque nationale du Portugal identifiant Biblioteca Virtual Miguel de Cervantes d'une personne identifiant RERO identifiant RERO identifiant FAST identifiant Bibliothèque nationale de Grèce identifiant CONOR.SI identifiant VIAF identifiant Bibliothèque nationale de France identifiant Bibliothèque nationale tchèque identifiant Goodreads d'un auteur Identifiant Bibliothèque nationale de Lituanie identifiant de la Bibliothèque nationale du Chili identifiant Bibliothèque royale des Pays-Bas identifiant BIBSYS d'une personne identifiant IdRef identifiant NACSIS-CAT d'un auteur identifiant NUKAT identifiant Bibliothèque nationale d'Irlande identifiant Bibliothèque nationale d'Irlande identifiant Unz d'un auteur identifiant Bibliothèque nationale d'Australie identifiant SBN d'un auteur identifiant CANTIC identifiant Bibliothèque nationale d'Israël identifiant Bibliothèque nationale d'Espagne (datos.BNE.es) identifiant RHE d'un docteur identifiant Université pontificale de la Sainte-Croix identifiant Angelicum identifiant Angelicum identifiant Teresianum d'une autorité identifiant Index Theologicus identifiant WorldCat Entities identifiant Catholic Hierarchy d'une personne identifiant Bibliothèque apostolique vaticane ancien identifiant Bibliothèque nationale de Catalogne identifiant Open Library identifiant Académie française d'un lauréat identifiant NLA Trove identifiant CiNii Research identifiant Biblioteche della Custodia di Terra Santa a Gerusalemme identifiant Biblioteca di Santa Sabina identifiant d’autorité Bibliothèque royale de Belgique identifiant La France savante CTHS identifiant Persée d'un auteur identifiant Université de Barcelone (obsolète) identifiant web Léonore identifiant Yale LUX identifiant Franciscan Center of Christian Oriental Studies identifiant Franciscan Center of Christian Oriental Studies identifiant EBAF d'autorité identifiant The Cardinals of the Holy Roman Church identifiant CoBiS identifiant Deutsche Biographie identifiant Rijksmuseum Research Library identifiant Université de Barcelone identifiant Académie d'Athènes identifiant de nomination de personnes au prix Nobel identifiant Babelio d'un auteur identifiant Social Networks Archival Context identifiant Prabook identifiant SHARE Catalogue identifiant Académie française d'un membre identifiant Parsifal Identifiant CIRDOC d'un auteur ou d'une autrice identifiant Université pontificale grégorienne identifiant DDB d'une personne identifiant Bibliographie de l’histoire de France d’une personne identifiant GCatholic d'une personne identifiant CONOR.SR identifiant catalogue général Diamond identifiant Our Campaigns d'un candidat identifiant FranceArchives agent identifiant SEARCH on line catalogue identifiant Université pontificale de Salamanque identifiant Biblioteca Iglesia Nacional Española en Roma identifiant Institut pontifical d'archéologie chrétienne
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