মডিউল:Wikibase
এই মডিউলের জন্য মডিউল:Wikibase/নথি-এ নথিপত্র তৈরি করা হয়ে থাকতে পারে
-- Module:Wikibasefunction getId( id ) if not mw.wikibase then return "wikibase মডিউল পাওয়া যায় নি" end if id then return id end entity = mw.wikibase.getEntityObject() if not entity then return nil end return entity.idend-- Returns the link corresponding to the code provided.function sitelink(dbname) if dbname==nil or dbname=='' then return '' end local sl = mw.wikibase.getEntityObject() if sl and sl.sitelinks[dbname] then return sl.sitelinks[dbname].title end return ''end-- Returns the corresponding geographical coordinates of the itemfunction coords(typ,fallback) if fallback~=nil and fallback~='' and string.match(fallback, '^<%!%-%-.*%-%->$')==nil then return fallback end local item = mw.wikibase.getEntityObject() if item~=nil and item.claims~=nil then local coords = item.claims.P625 if coords~=nil and coords[0]~=nil and coords[1]==nil then return coords[0].mainsnak.datavalue.value[typ] end end return ''end-- Returns the most updated info from a series of statementsfunction updated(item,prop,frame) if item~=nil then local claims = item.claims if claims~=nil and claims[prop]~=nil then for index,claim in pairs(claims[prop]) do local qual = claim.qualifiers if qual==nil or qual.P582==nil then -- p582 è la data di fine, significa che non è il valore attuale local val = claim.mainsnak.datavalue.value if val['numeric-id']~=nil then local id = 'Q'..val['numeric-id'] local sl = mw.wikibase.sitelink(id) local lb = mw.wikibase.label(id) if sl~=nil and sl~='' then return frame:preprocess('[['..sl..'|'..lb..']]') end return lb end return val end end end end return ''endlocal p = {}-- Returns the ID number of the data item linked to the current page.function p.id(frame) id = getId(frame.args[1]) if id == nil then return "(কোন উপাদান পাওয়া যায় নি)" end return idend-- Returns the ID number of the data item linked to the current page in the form of a link to Wikidata.function p.idLink(frame) id = getId(frame.args[1]) if id == nil then return "(কোন উপাদান পাওয়া যায় নি)" end return "[[d:" .. id .. "|" .. string.upper(id) .. "]]"end-- Returns the label of the data item.function p.label(frame) id = getId(frame.args[1]) if id == nil then return "(কোন উপাদান পাওয়া যায় নি)" end return mw.wikibase.label( id )end -- Returns the local page of the data item provided.function p.page(frame) id = getId(frame.args[1]) if id == nil then return "(কোন উপাদান পাওয়া যায় নি)" end return mw.wikibase.sitelink( id )end-- Returns the link corresponding to the code provided.function p.sitelink(frame) return sitelink(frame.args.dbname or frame.args[1])end-- Returns the corresponding link to Wikipedia in English.function p.bnwikilink(frame) if frame.args[1]~=nil and frame.args[1]~='' then return frame.args[1] end local sl = sitelink('bnwiki') if sl~=nil and sl~='' then return sl end local t = mw.title.getCurrentTitle().text if t~=nil and t~='' then return t end return ''end-- Returns the Commons category of the data item.function p.commonslink(frame) if frame.args[1]~=nil and frame.args[1]~='' then return 'বিষয়শ্রেণী:'..frame.args[1] end local item = mw.wikibase.getEntityObject() if item~=nil and item.claims~=nil then local cat = item.claims.P373 if cat~=nil and cat[0]~=nil and cat[1]==nil and cat[0].mainsnak.datavalue.value~=nil then return 'বিষয়শ্রেণী:'..(cat[0].mainsnak.datavalue.value) end end local t = mw.title.getCurrentTitle().text if t~=nil and t~='' then return 'বিষয়শ্রেণী:'..t end return ''end-- Returns the name of the capital or main city.function p.capital(frame) if frame.args[1]~=nil and frame.args[1]~='' then return frame.args[1] end local item = mw.wikibase.getEntityObject() return updated(item,'P36',frame)endfunction p.capoluogo(frame) return p.capital(frame)endfunction p.valuta(frame) if frame.args[1]~=nil and frame.args[1]~='' then return frame.args[1] end local item = mw.wikibase.getEntityObject() return updated(item,'P38',frame)end-- GET FLAG -- P41 thumb imagefunction p.flag(frame)-- if frame.args[1]~=nil and frame.args[1]~='' then-- return frame.args[1]-- end--local title="" - not using title local arg1 = frame.args[1] local item = mw.wikibase.getEntityObject(arg1) if item == nil then return end local flag = updated(item,'P41',frame)--local title = mw.wikibase.sitelink(arg1) if flag ~= nil and flag ~= '' thenreturn flag --return "[[File:" .. flag .. "| thumb | 200px | " .. title .. "]]"endend-- Restituisce l'etichetta dell'elemento rappresentante la bandiera relativa all'elemento dell'articolofunction p.bandiera_titolo(frame) local item = mw.wikibase.getEntityObject() if item~=nil then local claims = item.claims if claims~=nil and claims.P163~=nil and claims.P163[0]~=nil and claims.P163[1]==nil then return mw.wikibase.label('Q'..claims.P163[0].mainsnak.datavalue.value['numeric-id']) end end return mw.title.getCurrentTitle().text..' - পতাকা'end-- Restituisce la latitudine corrispondente all'articolo.function p.latitude(frame) return coords('latitude',frame.args[1])end-- Restituisce la longitudine corrispondente all'articolo.function p.longitude(frame) return coords('longitude',frame.args[1])endfunction p.disambig(frame)local item = mw.wikibase.getEntityObject()if item~=nil and item.descriptions~=nil thenlocal desc = item.descriptions.bnif desc~=nil and desc.value~=nil and desc.value:lower():find('দ্ব্যর্থতা নিরসন পাতা')~=nil thenreturn trueendendreturn falseendfunction p.instanceof(arg)arg = tonumber(arg.args[1] or arg)if item and item.claims and item.claims.P31 thenlocal claims = item.claims.P31for index, claim in pairs(claims) doif claim.mainsnak and claim.mainsnak.datavalue thenlocal val = claim.mainsnak.datavalue.valueif val and val['numeric-id'] and arg == val['numeric-id'] thenreturn trueendendendendreturn falseendreturn p
🔥 Popular: প্রধান পাতাসুন্দরবনকিরগিজস্তানচাঁদতাজমহলফিলিস্তিনবঙ্গরাশিয়ারাজশাহী বিভাগপাহাড়পুর বৌদ্ধবিহারবিশেষ:সংস্করণ/লালবাগ কেল্লাব্যবহারকারী আলাপ:Sbb1413সেন্ট মার্টিন দ্বীপউজবেকিস্তানইউরোপচট্টগ্রামমায়াপুরপানাম নগরউইকিভ্রমণ:ভ্রমণপিপাসুর আড্ডাআফ্রিকাআফগানিস্তানজাপানইংল্যান্ডসাজেক উপত্যকানীলগিরিরাঢ়বঙ্গবন্ধু শেখ মুজিব সাফারি পার্করাঙ্গামাটিসিলেট বিভাগহাকালুকি হাওরকুড়িগ্রাম জেলাধর্মসাগর দীঘিহযরত শাহজালাল আন্তর্জাতিক বিমানবন্দরপশ্চিমবঙ্গদক্ষিণ কোরিয়াবগুড়া জেলাবরিশাল বিভাগযুক্তরাজ্যরংপুর বিভাগচীননাফাখুম জলপ্রপাতচন্দ্রনাথ পাহাড়গাঙ্গেয় সমভূমিইরাকশালবন বৌদ্ধ বিহারইনানী সমুদ্র সৈকতনীলাচলপূর্ব প্রদেশ (সৌদি আরব)বেঙ্গালুরুমিশরওসমানী আন্তর্জাতিক বিমানবন্দরনেপালশরীয়তপুর জেলাকাজাখস্তানজাতিসংঘচাঁদপুর জেলাশিলংজাতীয় সংসদ ভবননিঝুম দ্বীপব্যবহারকারী আলাপ:Moheenতাজিংডংপারকি সমুদ্র সৈকতচিম্বুক পাহাড়কুমিল্লা জেলাকুষ্টিয়া জেলাতেলেঙ্গানাশিশু পার্ক, ঢাকাতাইওয়ানদীঘাদক্ষিণ এশিয়াবাংলাদেশের দর্শনীয় স্থানসমূহনুহাশ পল্লীবেলারুশরিজুক ঝর্নাকান্তজীর মন্দিরকলকাতা/দক্ষিণহিমছড়িউত্তর কোরিয়া