Différences entre versions de « Module:Lieu »
		
		
		
		
		
		Sauter à la navigation
		Sauter à la recherche
		
				
		
		
	
| Ligne 12 : | Ligne 12 : | ||
    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)  | |
	return capiunto.create( {  | 	return capiunto.create( {  | ||
| − | 	    bodyStyle = 'width :   | + | 	    bodyStyle = 'max-width : 20px',  | 
	    bodyClass = 'gregoriusLieu',  | 	    bodyClass = 'gregoriusLieu',  | ||
| − | 		title =    | + | 		title =  object:checkLink(subject, rdfs..'label',f.args.Title)  ,  | 
         top = 'Lieu',  |          top = 'Lieu',  | ||
		topStyle = 'background:#99FFCC;font-size:larger',		  | 		topStyle = 'background:#99FFCC;font-size:larger',		  | ||
| − | 		bottom =   | + | 		bottom = object:checkExternLink('Website',rdfs..'seeAlso',f.args.Website)  | 
	} )  | 	} )  | ||
| − | 	:addImage(  | + | 	:addImage(object:checkImage(daapProp..'picture',f.args.Picture),"", "bodyStyle" )  | 
| − | 	:addRow('Nom original',   | + | 	:addRow('Nom original', object:checkString(daapProp..'nom original',f.args.NomOriginal))  | 
| − | 	:addRow('Pays',   | + | 	:addRow('Pays', object:checkString(daapProp..'pays',f.args.Pays))  | 
| − | 	:addRow('Maire',   | + | 	:addRow('Maire', object:checkString(daapProp..'maire',f.args.Maire))  | 
| − | 	:addRow('Code postal',   | + | 	:addRow('Code postal', object:checkString(daapProp..'code postal',f.args.CodePostal))  | 
| − | 	:addRow('Gentilé',   | + | 	:addRow('Gentilé', object:checkString(daapProp..'gentile',f.args.Gentile))	  | 
| − | 	:addWikitext(   | + | 	:addWikitext( object:getMaintenanceCategory() ..  "[[Category:Interdisciplinary Unit]]"  | 
				.."[[Category:Lieu]]" )  | 				.."[[Category:Lieu]]" )  | ||
end  | end  | ||
return p  | return p  | ||
Version du 22 juin 2021 à 13:55
La documentation pour ce module peut être créée à Module:Lieu/doc
local p = {}
 
function p.infobox(f)
    local capiunto = require 'capiunto'
    local linkedwiki = require 'linkedwiki'
 
	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 = '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)
	} )
	:addImage(object:checkImage(daapProp..'picture',f.args.Picture),"", "bodyStyle" )
	:addRow('Nom original', object:checkString(daapProp..'nom original',f.args.NomOriginal))
	:addRow('Pays', object:checkString(daapProp..'pays',f.args.Pays))
	:addRow('Maire', object:checkString(daapProp..'maire',f.args.Maire))
	:addRow('Code postal', object:checkString(daapProp..'code postal',f.args.CodePostal))
	:addRow('Gentilé', object:checkString(daapProp..'gentile',f.args.Gentile))	
	:addWikitext( object:getMaintenanceCategory() ..  "[[Category:Interdisciplinary Unit]]"
				.."[[Category:Lieu]]" )
end
 
return p