Technopedia Center
PMB University Brochure
Faculty of Engineering and Computer Science
S1 Informatics S1 Information Systems S1 Information Technology S1 Computer Engineering S1 Electrical Engineering S1 Civil Engineering

faculty of Economics and Business
S1 Management S1 Accountancy

Faculty of Letters and Educational Sciences
S1 English literature S1 English language education S1 Mathematics education S1 Sports Education
  • Registerasi
  • Brosur UTI
  • Kip Scholarship Information
  • Performance
  1. Weltenzyklopädie
  2. Module:Propriétés — Wikipédia
Module:Propriétés — Wikipédia 👆 Click Here! Read More..
Cette page fait l’objet d’une mesure de semi-protection étendue.
Une page de Wikipédia, l'encyclopédie libre.

 Documentation[créer] [purger]
MIT

Ce module ne possède aucune documentation explicative en sous-page, pas même une description succincte.
Vous pouvez créer cette sous-page afin de documenter ce module adéquatement.

La documentation de ce module est générée par le modèle {{Documentation module}}.
Les éditeurs peuvent travailler dans le bac à sable (créer).
Voir les statistiques d'appel depuis le wikicode sur l'outil wstat et les appels depuis d'autres modules.

    • Projet Scribunto Projet Scribunto
local p = {
	instance_de= "P31",
    sous_classe_de = "P279",
    prenom = "P735",
    nomdefamille = "P734", 
    isbn10 = "P957",
    publie_dans = "P1433",
    langue = "P407" 
}
-- this module gives solutions to get the Pnumber of a property by its name


-- could be automatized, but for now just defining a muanual mapping


p.p_from_name = {
	["country"] = 17 ;
	["gender"] = 21 ;

	["instance of"] = 31 ;
	
	["field"] = 101 ; 
	["occupation"] = 106 ;
	
	["genre"] = 136 ;
	
	["named after"] = 138 ;
	
	
	["preceded by"] = 155;
	["succeeded by"] = 156;
	["collection"] = 195;	
	["subclass of"] = 279 ;

	["category's topic"] = 301;

	["list of"] = 360 ; 
	["part of"] = 361 ;

	["commons category"] = 373;
	
	["terminus"] = 559;
	["direction"] = 560;
	
	["start date"] = 580 ;
	["begin date"] = 580 ;
	
	["end date"] = 582 ;
	
	["date"] = 585 ;
	
	["of"] = 642 ;
	
	["participant"] = 710 ;
	
	["edition"] = 747 ;
	["edition of"] = 629 ;
	
	['key event'] = 793 ;
	['significant event'] = 793 ;
	
	["topic's category"] = 910;
	["subject"] = 921; -- work subject
	["inspired by"] = 941 ;	
	
	["fictional analog of"] = 1074 ;

	["statement disputed by"] = 1310 ;
	["disputed by"] = 1310 ;
	
	["of"] = 642 ;
	
	["history"] = 2184 ;
	
	["property for this type"] = 1963 ;
    ["metasubclass of"] = 2445 ;
    
	["number"] = 1114 ;
	
	["union of"] = 2737;
	["disjoint union of"] = 2738;
	
	["has part of the type"] = 2670 ;
}



local function string_to_propnumber(label)
	local res = p.p_from_name[label] ;
	if res ~= nil then
		return tostring( res) ;
	else
		res = mw.wikibase.resolvePropertyId(label)
		if res then
			return string.sub(res, 2)
		else
			return nil
		end
    end
end

p.numberFromPropertylabel = function(frame)  
	local label = frame.args[1] ;
	mw.log(label)
	return string_to_propnumber(label)
end;

-- returns a pid of the form "Pnnn..." where n is a character in "123456789"
--from either 
--* a number representing a property wikidata number
--* a string number representing a property wikidata number
--* a pid of the form "Pnnn"
--* a "property name" corresponding to a property, where the names are listed in the array p.p_from_name
-- or "nil" if the id does not match to any of the cases above
p.normalize = function(input_pid)
	local input_pid = tostring(input_pid)
	if mw.ustring.match(input_pid, "P%d+") then
		return input_pid
	elseif mw.ustring.match(input_pid, "%d+") then
		return "P" .. input_pid
	else
		return "P" .. tostring(string_to_propnumber(input_pid))
	end
end

-- function that takes a string with a set of pids and returns an array of properties
p.expandPropList = function(plist)
	local props = mw.text.split(plist,",")
	for ind, val in ipairs(props) do
		props[ind] = p.normalize(val)
	end
	return props
end

function p.datatype(property)
	if type(property) ~= "table" then
		property = mw.wikibase.getEntityObject(p.normalize(property))
	end
	return property.datatype
end

---------------------------------------------------------------
-- wikitemplate interface
---------------------------------------------------------------

p.Pid = function(frame)  
	local label = frame.args[1] ;
	return p.normalize(label)
end;

p.Pdatatype = function(frame)
	return p.datatype(frame.args[1])
end;


p.of = p.normalize("of")
p.union_of = p.normalize("union of")
p.disjoint_union_of = p.normalize("disjoint union of")

return p
Ce document provient de « https://fr.teknopedia.teknokrat.ac.id/w/index.php?title=Module:Propriétés&oldid=160406095 ».
Catégories :
  • Module sans documentation
  • Module en langage Lua
Catégorie cachée :
  • Module en semi-protection étendue

  • indonesia
  • Polski
  • الرية
  • Deutsch
  • English
  • Español
  • Français
  • Italiano
  • مصر
  • Nederlands
  • 本語
  • Português
  • Sinugboanong Binisaya
  • Svenska
  • Українска
  • Tiếng Việt
  • Winaray
  • 中文
  • Русски
Sunting pranala
Pusat Layanan

UNIVERSITAS TEKNOKRAT INDONESIA | ASEAN's Best Private University
Jl. ZA. Pagar Alam No.9 -11, Labuhan Ratu, Kec. Kedaton, Kota Bandar Lampung, Lampung 35132
Phone: (0721) 702022
Email: pmb@teknokrat.ac.id