Module:Metabolite

From DAAP
Jump to navigation Jump to search

Documentation for this module may be created at Module:Metabolite/doc

local p = {}
 
function p.infobox(f)
    local capiunto = require 'capiunto'
    local linkedwiki = require 'linkedwiki'
    linkedwiki.setCurrentFrame(mw.getCurrentFrame())

   local subject = f.args.iri or linkedwiki.getCurrentIRI();
	
   local rdfs = 'http://www.w3.org/2000/01/rdf-schema#'
   local daapProp = 'http://daap.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 object =  linkedwiki.new(subject)
   
	return capiunto.create( {
	    -- bodyStyle = 'border: 15px solid red',
	    bodyClass = 'example',
		title =  object:checkLabelOfInternLink(subject, rdfs..'label',f.args.Title)  ,
        top = 'Metabolite',
		topStyle = 'background:#cfc;font-size:larger',		
		bottom =  object:checkExternLink('Website',rdfs..'seeAlso',f.args.Website)
	} )

	:addRow('Abbreviation', object:checkUser(daapProp..'abbreviationMetabolite',f.args.abbreviationMetabolite))
	:addRow('casRegistryNumberMetabolite', object:checkString(daapProp..'casRegistryNumberMetabolite',f.args.casRegistryNumberMetabolite))
	:addRow('casRegistryNumberMetabolite', object:checkString(daapProp..'casRegistryNumberMetabolite',f.args.casRegistryNumberMetabolite))	
	:addRow('chemicalFormula', object:checkString(daapProp..'chemicalFormula',f.args.RegistrychemicalFormula))	
	:addRow('commentary', object:checkString(daapProp..'commentary',f.args.casRegistryNumberMetabolite)	)
	:addRow('iupacMatabolite', object:checkString(daapProp..'iupacMatabolite',f.args.casRegistryNumberMetabolite))	
	:addRow('keggMetabolite', object:checkString(daapProp..'keggMetabolite',f.args.casRegistryNumberMetabolite)	)
	:addRow('casRegistryNumberMetabolite', object:checkString(daapProp..'casRegistryNumberMetabolite',f.args.casRegistryNumberMetabolite))	
	:addRow('molarMass', object:checkString(daapProp..'molarMass',f.args.casRegistryNumberMetabolite))	
	:addRow('otherName', object:checkString(daapProp..'otherName',f.args.casRegistryNumberMetabolite))	
	:addWikitext( object:getMaintenanceCategory() .. "[[Category:Metabolite]]" )
end
 
return p