Différences entre versions de « Module:Evenement »

De Gregorius 3.0
Sauter à la navigation Sauter à la recherche
(Page créée avec « local p = {} function p.infobox(f) local capiunto = require 'capiunto' local linkedwiki = require 'linkedwiki' local endpointUpsud = 'http://opendata1.opendat... »)
 
 
(4 versions intermédiaires par 3 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#'
 
   
 
   
  linkedwiki.setEndpoint(endpointUpsud)
+
local subject = linkedwiki.getCurrentIRI(); -- read the iri of the current page
  linkedwiki.setSubject(linkedwiki.getCurrentIRI())
+
local object =  linkedwiki.new(subject)
 
   
 
   
 
return capiunto.create( {
 
return capiunto.create( {
 
    -- bodyStyle = 'border: 15px solid red',
 
    -- bodyStyle = 'border: 15px solid red',
 
    bodyClass = 'gregoriusEvenement',
 
    bodyClass = 'gregoriusEvenement',
title =  linkedwiki.checkLink(linkedwiki.getCurrentIRI(), rdfs..'label',f.args.Title)  ,
+
title =  object:checkString( rdfs..'label',f.args.Title)  ,
         top = 'Evenement',
+
         top = 'Événement',
 
topStyle = 'background:#66FF99;font-size:larger',
 
topStyle = 'background:#66FF99;font-size:larger',
bottom = linkedwiki.checkExternLink('Website',rdfs..'seeAlso',f.args.Website)
+
bottom = object:checkExternLink('Website',rdfs..'seeAlso',f.args.Website)
 
} )
 
} )
:addRow('Evenement', linkedwiki.checkString(daapProp..'evenement',f.args.Evenement))
+
:addRow('Événement', object:checkString(daapProp..'evenement',f.args.Evenement))
:addRow('Date', linkedwiki.checkString(daapProp..'date',f.args.Date))
+
:addRow('Date', object:checkString(daapProp..'date',f.args.Date))
:addRow('Lieu', linkedwiki.checkString(daapProp..'lieu',f.args.Lieu))
+
:addRow('Lieu', object:checkString(daapProp..'lieu',f.args.Lieu))
:addRow('Acteur', linkedwiki.checkString(daapProp..'acteur',f.args.Acteur))
+
:addRow('Acteur', object:checkString(daapProp..'acteur',f.args.Acteur))
:addWikitext( linkedwiki.getMaintenanceCategory() ..  "[[Category:Interdisciplinary Unit]]"
+
:addWikitext( object:getMaintenanceCategory() ..  "[[Category:Interdisciplinary Unit]]"
 
.."[[Category:Evenement]]" )
 
.."[[Category:Evenement]]" )
 
end
 
end
 
   
 
   
 
return p
 
return p

Version actuelle datée du 29 octobre 2021 à 08:46

La documentation pour ce module peut être créée à Module:Evenement/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)
 
	return capiunto.create( {
	    -- bodyStyle = 'border: 15px solid red',
	    bodyClass = 'gregoriusEvenement',
		title =  object:checkString( rdfs..'label',f.args.Title)  ,
        top = 'Événement',
		topStyle = 'background:#66FF99;font-size:larger',		
		bottom = object:checkExternLink('Website',rdfs..'seeAlso',f.args.Website)
	} )
	:addRow('Événement', object:checkString(daapProp..'evenement',f.args.Evenement))
	:addRow('Date', object:checkString(daapProp..'date',f.args.Date))
	:addRow('Lieu', object:checkString(daapProp..'lieu',f.args.Lieu))
	:addRow('Acteur', object:checkString(daapProp..'acteur',f.args.Acteur))
	:addWikitext( object:getMaintenanceCategory() ..  "[[Category:Interdisciplinary Unit]]"
				.."[[Category:Evenement]]" )
end
 
return p