Difference between revisions of "Module:Analyte"

From DAAP
Jump to navigation Jump to search
 
(3 intermediate revisions by 2 users not shown)
Line 4: Line 4:
 
     local capiunto = require 'capiunto'
 
     local capiunto = require 'capiunto'
 
     local linkedwiki = require 'linkedwiki'
 
     local linkedwiki = require 'linkedwiki'
 +
    linkedwiki.setCurrentFrame(mw.getCurrentFrame())
 
      
 
      
local endpointUpsud = 'http://opendata1.opendata.u-psud.fr/sparql'
+
  local subject = f.args.iri or linkedwiki.getCurrentIRI();
 
 
 
   local rdfs = 'http://www.w3.org/2000/01/rdf-schema#'
 
   local rdfs = 'http://www.w3.org/2000/01/rdf-schema#'
   local daapProp = 'http://daap.eu/wiki/Property:'
+
   local daapProp = 'http://daap.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 object =  linkedwiki.new(subject)
  linkedwiki.setSubject(linkedwiki.getCurrentIRI())
 
 
    
 
    
 
return capiunto.create( {
 
return capiunto.create( {
 
    -- bodyStyle = 'border: 15px solid red',
 
    -- bodyStyle = 'border: 15px solid red',
title =  linkedwiki.checkLink(linkedwiki.getCurrentIRI(), rdfs..'label',f.args.Title)  ,
+
title =  object:checkLabelOfInternLink(subject, rdfs..'label',f.args.Title)  ,
 
         top = 'Analyte',
 
         top = 'Analyte',
 
topStyle = 'background:#cfc;font-size:larger',
 
topStyle = 'background:#cfc;font-size:larger',
bottom = linkedwiki.checkExternLink('Website',rdfs..'seeAlso',f.args.Website)
+
bottom = object:checkExternLink('Website',rdfs..'seeAlso',f.args.Website)
 
} )
 
} )
  
 
+
:addRow('nomAnalyte', object:checkUser(daapProp..'nomAnalyte',f.args.abbreviationMetabolite))
 
+
:addRow('chemicalFormulaAnalyte', object:checkString(daapProp..'chemicalFormulaAnalyte',f.args.casRegistryNumberMetabolite))
:addRow('nomAnalyte', linkedwiki.checkUser(daapProp..'abbreviationMetabolite',f.args.abbreviationMetabolite))
+
:addRow('casAnalyte', object:checkString(daapProp..'casAnalyte',f.args.RegistrychemicalFormula))
:addRow('chemicalFormulaAnalyte', linkedwiki.checkString(daapProp..'casRegistryNumberMetabolite',f.args.casRegistryNumberMetabolite))
+
:addRow('MolarMassAnalyte', object:checkString(daapProp..'MolarMassAnalyte',f.args.casRegistryNumberMetabolite) )
:addRow('casAnalyte', linkedwiki.checkString(daapProp..'chemicalFormula',f.args.RegistrychemicalFormula))
+
:addRow('monoIsotopicMasseAnalyte', object:checkString(daapProp..'monoIsotopicMasseAnalyte',f.args.casRegistryNumberMetabolite))
:addRow('MolarMassAnalyte', linkedwiki.checkString(daapProp..'commentary',f.args.casRegistryNumberMetabolite) )
+
:addRow('abbreviationAnalyte', object:checkString(daapProp..'abbreviationAnalyte',f.args.casRegistryNumberMetabolite) )
:addRow('monoisotopicMasseAnalyte', linkedwiki.checkString(daapProp..'iupacMatabolite',f.args.casRegistryNumberMetabolite))
+
:addRow('spectralDataAnalyte', object:checkString(daapProp..'spectralDataAnalyte',f.args.casRegistryNumberMetabolite))
:addRow('abbreviationAnalyte', linkedwiki.checkString(daapProp..'keggMetabolite',f.args.casRegistryNumberMetabolite) )
+
:addRow('defautQuantMassAnalyte', object:checkString(daapProp..'defautQuantMassAnalyte',f.args.casRegistryNumberMetabolite))
:addRow('spectralDataAnalyte', linkedwiki.checkString(daapProp..'casRegistryNumberMetabolite',f.args.casRegistryNumberMetabolite))
+
:addRow('retentionIndiceAnalyte', object:checkString(daapProp..'retentionIndiceAnalyte',f.args.casRegistryNumberMetabolite))
:addRow('defautQuantMassAnalyte', linkedwiki.checkString(daapProp..'molarMass',f.args.casRegistryNumberMetabolite))
+
:addRow('isotopologueAnalyte', object:checkString(daapProp..'isotopologueAnalyte',f.args.casRegistryNumberMetabolite))
:addRow('retentionIndiceAnalyte', linkedwiki.checkString(daapProp..'otherName',f.args.casRegistryNumberMetabolite))
+
:addRow('commentaryAnalyte', object:checkString(daapProp..'commentaryAnalyte',f.args.casRegistryNumberMetabolite))
:addRow('isotopologueAnalyte', linkedwiki.checkString(daapProp..'otherName',f.args.casRegistryNumberMetabolite))
+
:addRow('nameInReferenceModuleAnalyte', object:checkString(daapProp..'nameInReferenceModuleAnalyte',f.args.casRegistryNumberMetabolite))
:addRow('commentaryAnalyte', linkedwiki.checkString(daapProp..'otherName',f.args.casRegistryNumberMetabolite))
+
:addRow('modeAnalyte', object:checkString(daapProp..'modeAnalyte',f.args.casRegistryNumberMetabolite))
:addRow('nameInReferenceModuleAnalyte', linkedwiki.checkString(daapProp..'otherName',f.args.casRegistryNumberMetabolite))
+
:addRow('retentionTimeAnalyte', object:checkString(daapProp..'retentionTimeAnalyte',f.args.casRegistryNumberMetabolite))
:addRow('modeAnalyte', linkedwiki.checkString(daapProp..'otherName',f.args.casRegistryNumberMetabolite))
+
:addWikitext( object:getMaintenanceCategory() .. "[[Category:Metabolite]]" )
:addRow('retentionTimeAnalyte', linkedwiki.checkString(daapProp..'otherName',f.args.casRegistryNumberMetabolite))
 
:addWikitext( linkedwiki.getMaintenanceCategory() .. "[[Category:Metabolite]]" )
 
 
end
 
end
 
   
 
   
 
return p
 
return p

Latest revision as of 07:57, 29 October 2021

Documentation for this module may be created at Module:Analyte/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',
		title =  object:checkLabelOfInternLink(subject, rdfs..'label',f.args.Title)  ,
        top = 'Analyte',
		topStyle = 'background:#cfc;font-size:larger',		
		bottom = object:checkExternLink('Website',rdfs..'seeAlso',f.args.Website)
	} )

	:addRow('nomAnalyte', object:checkUser(daapProp..'nomAnalyte',f.args.abbreviationMetabolite))
	:addRow('chemicalFormulaAnalyte', object:checkString(daapProp..'chemicalFormulaAnalyte',f.args.casRegistryNumberMetabolite))
	:addRow('casAnalyte', object:checkString(daapProp..'casAnalyte',f.args.RegistrychemicalFormula))	
	:addRow('MolarMassAnalyte', object:checkString(daapProp..'MolarMassAnalyte',f.args.casRegistryNumberMetabolite)	)
	:addRow('monoIsotopicMasseAnalyte', object:checkString(daapProp..'monoIsotopicMasseAnalyte',f.args.casRegistryNumberMetabolite))	
	:addRow('abbreviationAnalyte', object:checkString(daapProp..'abbreviationAnalyte',f.args.casRegistryNumberMetabolite)	)
	:addRow('spectralDataAnalyte', object:checkString(daapProp..'spectralDataAnalyte',f.args.casRegistryNumberMetabolite))	
	:addRow('defautQuantMassAnalyte', object:checkString(daapProp..'defautQuantMassAnalyte',f.args.casRegistryNumberMetabolite))	
	:addRow('retentionIndiceAnalyte', object:checkString(daapProp..'retentionIndiceAnalyte',f.args.casRegistryNumberMetabolite))
	:addRow('isotopologueAnalyte', object:checkString(daapProp..'isotopologueAnalyte',f.args.casRegistryNumberMetabolite))
	:addRow('commentaryAnalyte', object:checkString(daapProp..'commentaryAnalyte',f.args.casRegistryNumberMetabolite))
	:addRow('nameInReferenceModuleAnalyte', object:checkString(daapProp..'nameInReferenceModuleAnalyte',f.args.casRegistryNumberMetabolite))
	:addRow('modeAnalyte', object:checkString(daapProp..'modeAnalyte',f.args.casRegistryNumberMetabolite))
	:addRow('retentionTimeAnalyte', object:checkString(daapProp..'retentionTimeAnalyte',f.args.casRegistryNumberMetabolite))
	:addWikitext( object:getMaintenanceCategory() .. "[[Category:Metabolite]]" )
end
 
return p