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