Différences entre versions de « Module:Definition »
Sauter à la navigation
Sauter à la recherche
(2 versions intermédiaires par 2 utilisateurs non affichées) | |||
Ligne 4 : | Ligne 4 : | ||
local capiunto = require 'capiunto' | local capiunto = require 'capiunto' | ||
local linkedwiki = require 'linkedwiki' | local linkedwiki = require 'linkedwiki' | ||
+ | linkedwiki.setCurrentFrame(mw.getCurrentFrame()) -- added by hand | ||
local endpointUpsud = 'http://opendata1.opendata.u-psud.fr/sparql' | local endpointUpsud = 'http://opendata1.opendata.u-psud.fr/sparql' | ||
local rdfs = 'http://www.w3.org/2000/01/rdf-schema#' | local rdfs = 'http://www.w3.org/2000/01/rdf-schema#' | ||
− | local daapProp = 'http://gregorius.fr/wiki/Property:' | + | local daapProp = 'http://gregorius.dsi.universite-paris-saclay.fr/wiki/Property:' |
local geo = 'http://www.w3.org/2003/01/geo/wgs84_pos#' | local geo = 'http://www.w3.org/2003/01/geo/wgs84_pos#' | ||
local vcard = 'http://www.w3.org/2006/vcard/ns#' | local vcard = 'http://www.w3.org/2006/vcard/ns#' | ||
− | + | local subject = linkedwiki.getCurrentIRI(); -- read the iri of the current page | |
− | + | local object = linkedwiki.new(subject) | |
+ | |||
+ | --object:removeSubject() -- delete all triples of this subject | ||
return capiunto.create( { | return capiunto.create( { | ||
Ligne 19 : | Ligne 22 : | ||
bodyClass = 'gregoriusDefinition', | bodyClass = 'gregoriusDefinition', | ||
title = 'Définition', | title = 'Définition', | ||
− | top = | + | top = object:checkString(daapProp..'mot',f.args.Mot) , |
topStyle = 'background:#FF9696;font-size:larger', | topStyle = 'background:#FF9696;font-size:larger', | ||
− | bottom = | + | bottom = object:checkExternLink('Website',rdfs..'seeAlso',f.args.Website) |
} ) | } ) | ||
− | :addRow('Mot', | + | :addRow('Mot', object:checkString(daapProp..'mot',f.args.Mot)) |
− | :addRow('Étymologie', | + | :addRow('Étymologie', object:checkString(daapProp..'etymologie',f.args.Etymologie)) |
− | :addWikitext( | + | :addWikitext( object:getMaintenanceCategory() .. "[[Category:Interdisciplinary Unit]]" |
.."[[Category:Définition]]" ) | .."[[Category:Définition]]" ) | ||
end | end | ||
return p | return p |
Version actuelle datée du 29 octobre 2021 à 08:44
La documentation pour ce module peut être créée à Module:Definition/doc
local p = {}
function p.infobox(f)
local capiunto = require 'capiunto'
local linkedwiki = require 'linkedwiki'
linkedwiki.setCurrentFrame(mw.getCurrentFrame()) -- added by hand
local endpointUpsud = 'http://opendata1.opendata.u-psud.fr/sparql'
local rdfs = 'http://www.w3.org/2000/01/rdf-schema#'
local daapProp = 'http://gregorius.dsi.universite-paris-saclay.fr/wiki/Property:'
local geo = 'http://www.w3.org/2003/01/geo/wgs84_pos#'
local vcard = 'http://www.w3.org/2006/vcard/ns#'
local subject = linkedwiki.getCurrentIRI(); -- read the iri of the current page
local object = linkedwiki.new(subject)
--object:removeSubject() -- delete all triples of this subject
return capiunto.create( {
-- bodyStyle = 'border: 15px solid red',
bodyClass = 'gregoriusDefinition',
title = 'Définition',
top = object:checkString(daapProp..'mot',f.args.Mot) ,
topStyle = 'background:#FF9696;font-size:larger',
bottom = object:checkExternLink('Website',rdfs..'seeAlso',f.args.Website)
} )
:addRow('Mot', object:checkString(daapProp..'mot',f.args.Mot))
:addRow('Étymologie', object:checkString(daapProp..'etymologie',f.args.Etymologie))
:addWikitext( object:getMaintenanceCategory() .. "[[Category:Interdisciplinary Unit]]"
.."[[Category:Définition]]" )
end
return p