Module:Lieu

De Gregorius 3.0
Sauter à la navigation Sauter à la recherche

La documentation pour ce module peut être créée à Module:Lieu/doc

--[[
-- Debug console
frame = mw.getCurrentFrame() -- Get a frame object
newFrame = frame:newChild{ -- Get one with args
	title = 'oeuvre_test' ,
 args = { 
iri = 'http://157.136.249.54/wiki/oeuvre_test' ,
--["Wikidata ID"] = 'Q335987',
["Titre"] = 'Rome' ,
["Nom original"] = 'Roma',
["Pays"] = 'Italie',
["Maire"] = 'Francesco Paolo Tronca',
["Code postal"] = '00100',
["Gentile"] = 'Romains'
    }
}
mw.log(p.infobox( newFrame ) )
]]


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 rp = '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)
  
  if not linkedwiki.isEmpty(f.args['Nom original']) then
	mw.log(object:addProperty(rp..'Nomoriginal',f.args['Nom original']))
  end 
  
  --object:setDebug(true) --uncomment for debugging

	local infobox = capiunto.create( {
	    bodyStyle = 'max-width : 20px',
	    bodyClass = 'gregoriusLieu',
		title =  object:checkLink(subject, rdfs..'label',f.args.Title)  ,
        top = 'Lieu',
		topStyle = 'background:#99FFCC;font-size:larger',		
		bottom = object:checkExternLink('Website',rdfs..'seeAlso',f.args.Website)
	} )

	infobox:addRow('Nom original',f.args['Nom original'])
	infobox:addRow('Pays',f.args['Pays'])
	infobox:addRow('Maire',f.args['Maire'])
	infobox:addRow('Code postal',f.args['Code postal'])
	infobox:addRow('Gentile', f.args['Gentile'])

	--infobox:addImage(object:checkImage(daapProp..'Image',f.args.Picture),"", "bodyStyle" )
	--infobox:addRow('Nom original', object:checkString(daapProp..'nom original',f.args.NomOriginal))
	--infobox:addRow('Pays', object:checkString(daapProp..'pays',f.args.Pays))
	--infobox:addRow('Maire', object:checkString(daapProp..'maire',f.args.Maire))
	--infobox:addRow('Code postal', object:checkString(daapProp..'code postal',f.args.CodePostal))
	--infobox:addRow('Gentile', object:checkString(daapProp..'gentile',f.args.Gentile))	
	--infobox:addWikitext( object:getMaintenanceCategory() ..  "[[Category:Interdisciplinary Unit]]"
	--			.."[[Category:Lieu]]" )
	
	return infobox

end
 
return p