Modul:Taxonbar/confdoc
| Bu andoza quyidagi Luadan foydalanadi: |
| Related pages |
|---|
Modul haqida
Bu modul Modul:Taxonbar/conf ga Andoza:Taxonbar/doc da Vikimaʼlumotlar takson identifikatori xususiyatlarining oʻz hujjatlari jadvalini avtomatik yangilash imkonini beradi.
Qoʻllanilshi
{{#invoke:Taxonbar/confdoc|confdoc}}
Chiqish
{{#invoke:Taxonbar/confdoc|confdoc}}
| Parameter | Wikidata ID | Authority | Description |
|---|---|---|---|
| aba | P4526 | ||
| adw | P4024 | ||
| afd | P6039 | ||
| afromoths | P6093 | ||
| algaebase | P1348 | ||
| amphibiaweb | P5036 | ||
| antweb | P5299 | ||
| aoi | P5003 | ||
| aofp | P6159 | ||
| apa | P6137 | ||
| apdb | P2036 | ||
| apni | P5984 | ||
| apsa | P2809 | ||
| araneae | P3594 | ||
| arkive | P2833 | ||
| asw | P5354 | ||
| atrf | P6904 | ||
| ausfungi | P9076 | ||
| auslichen | P9093 | ||
| avibase | P2026 | ||
| bacdive | P2946 | ||
| bamona | P3398 | ||
| bhl | P687 | ||
| biolib | P838 | ||
| birdlife | P5257 | ||
| birdlife-australia | P6040 | ||
| bold | P3606 | ||
| bto | P4798 | ||
| bugguide | P2464 | ||
| butmoth | P3060 | ||
| calflora | P3420 | ||
| cal-ipc | P6176 | ||
| col | P10585 | ||
| center | P6003 | ||
| cms | P6033 | ||
| cnps | P4194 | ||
| cockroach species file | P6052 | ||
| conifers | P1940 | ||
| coreoidea species file | P6053 | ||
| bow | P3444 | ||
| ebird | P3444 | ||
| ecocrop | P4753 | ||
| ecos | P6030 | ||
| eflorasa | P6933 | ||
| eol | P830 | ||
| eppo | P3031 | ||
| eunis | P6177 | ||
| euring | P3459 | ||
| faunaeuropaea | P1895 | ||
| faunaeuropaeanew | P4807 | ||
| feis | P6044 | ||
| fishbase | P938 | ||
| florabase | P3101 | ||
| flow | P6096 | ||
| fna | P1727 | ||
| foao | P3100 | ||
| foao2 | P6756 | ||
| foc | P1747 | ||
| foio | P3795 | ||
| fossilworks | P842 | ||
| fungorum | P1391 | ||
| gbif | P846 | ||
| gisd | P5626 | ||
| gnab | P4715 | ||
| goniat | P5216 | ||
| grassbase | P1832 | ||
| grin | P1421 | ||
| ibc | P3099 | ||
| ifpni | P6341 | ||
| inaturalist | P3151 | ||
| ipa | P6161 | ||
| ipni | P961 | ||
| irmng | P5055 | ||
| isc | P5698 | ||
| itis | P815 | ||
| iucn | P627 | ||
| lepindex | P3064 | ||
| lob | P5862 | ||
| lpsn | P1991 | ||
| lygaeoidea species file | P11311 | ||
| mantodea species file | P6055 | ||
| michiganflora | P6103 | ||
| mobotpf | P6034 | ||
| mol | P6092 | ||
| mnhn | P6046 | ||
| mona | P4758 | ||
| msw | P959 | ||
| mycobank | P962 | ||
| nas | P6163 | ||
| natureserve | P10243 | ||
| nbn | P3240 | ||
| ncbi | P685 | ||
| neotropical | P6047 | ||
| noaa | P6049 | ||
| nswflora | P3130 | ||
| ntflora | P5953 | ||
| nzbo | P6048 | ||
| nzor | P2752 | ||
| nzpcn | P7496 | ||
| odnr | P6289 | ||
| ottol | P9157 | ||
| orthoptera species file | P6050 | ||
| paldat | P4122 | ||
| paleobiodb | P10907 | ||
| panartic | P2434 | ||
| pfaf | P4301 | ||
| pfi | P6114 | ||
| phasmida species file | P4855 | ||
| ppe | P6061 | ||
| plantlist | P1070 | ||
| plants | P1772 | ||
| plazi | P1992 | ||
| powo | P5037 | ||
| psocodea species file | P8145 | ||
| rd | P5473 | ||
| rhs | P8765 | ||
| sanbi | P6056 | ||
| scc | P6057 | ||
| sealifebase | P6018 | ||
| seinet | P6209 | ||
| species+ | P2040 | ||
| sprat | P2455 | ||
| steere | P6035 | ||
| tree of life | P5221 | ||
| tropicos | P960 | ||
| tsa | P5397 | ||
| ubio | P4728 | ||
| vascan | P1745 | ||
| vicflora | P5945 | ||
| watson | P1761 | ||
| wio | P6285 | ||
| wisflora | P6227 | ||
| woi | P3746 | ||
| wfo | P7715 | ||
| worms | P850 | ||
| wsc | P3288 | ||
| xeno-canto | P2426 | ||
| zoobank | P1746 |
Wikidata havola maʼlumotlari
{{#invoke:Taxonbar/confdoc|wikidataInfo
| Parameter | Wikidata ID | Database | Examples | datatype | formatterURL (or alternative) and examples |
|---|---|---|---|---|---|
| aba | P4526 | ABA | url
{{smalldiv|1=}} | ||
| adw | P4024 | ADW | url
{{smalldiv|1=}} | ||
| afd | P6039 | AFD | url
{{smalldiv|1=}} | ||
| afromoths | P6093 | AfroMoths | url
{{smalldiv|1=}} | ||
| algaebase | P1348 | AlgaeBase | url
{{smalldiv|1=}} | ||
| amphibiaweb | P5036 | AmphibiaWeb | url
{{smalldiv|1=}} | ||
| antweb | P5299 | AntWeb | url
{{smalldiv|1=}} | ||
| aoi | P5003 | AoI | url
{{smalldiv|1=}} | ||
| aofp | P6159 | AoFP | url
{{smalldiv|1=}} | ||
| apa | P6137 | APA | url
{{smalldiv|1=}} | ||
| apdb | P2036 | APDB | url
{{smalldiv|1=}} | ||
| apni | P5984 | APNI | url
{{smalldiv|1=}} | ||
| apsa | P2809 | APSA | url
{{smalldiv|1=}} | ||
| araneae | P3594 | Araneae | url
{{smalldiv|1=}} | ||
| arkive | P2833 | ARKive | url
{{smalldiv|1=}} | ||
| asw | P5354 | ASW | url
{{smalldiv|1=}} | ||
| atrf | P6904 | ATRF | url
{{smalldiv|1=}} | ||
| ausfungi | P9076 | AusFungi | url
{{smalldiv|1=}} | ||
| auslichen | P9093 | AusLichen | url
{{smalldiv|1=}} | ||
| avibase | P2026 | Avibase | url
{{smalldiv|1=}} | ||
| bacdive | P2946 | BacDive | url
{{smalldiv|1=}} | ||
| bamona | P3398 | BAMONA | url
{{smalldiv|1=}} | ||
| bhl | P687 | BHL | url
{{smalldiv|1=}} | ||
| biolib | P838 | BioLib | url
{{smalldiv|1=}} | ||
| birdlife | P5257 | BirdLife | url
{{smalldiv|1=}} | ||
| birdlife-australia | P6040 | BirdLife-Australia | url
{{smalldiv|1=}} | ||
| bold | P3606 | BOLD | url
{{smalldiv|1=}} | ||
| bto | P4798 | BTO | url
{{smalldiv|1=}} | ||
| bugguide | P2464 | BugGuide | url
{{smalldiv|1=}} | ||
| butmoth | P3060 | ButMoth | url
{{smalldiv|1=}} | ||
| calflora | P3420 | Calflora | url
{{smalldiv|1=}} | ||
| cal-ipc | P6176 | Cal-IPC | url
{{smalldiv|1=}} | ||
| col | P10585 | CoL | url
{{smalldiv|1=}} | ||
| center | P6003 | Center | url
{{smalldiv|1=}} | ||
| cms | P6033 | CMS | url
{{smalldiv|1=}} | ||
| cnps | P4194 | CNPS | url
{{smalldiv|1=}} | ||
| cockroach species file | P6052 | Cockroach Species File | url
{{smalldiv|1=}} | ||
| conifers | P1940 | Conifers.org | url
{{smalldiv|1=}} | ||
| coreoidea species file | P6053 | Coreoidea Species File | url
{{smalldiv|1=}} | ||
| bow | P3444 | BOW | url
{{smalldiv|1=}} | ||
| ebird | P3444 | eBird | url
{{smalldiv|1=}} | ||
| ecocrop | P4753 | Ecocrop | url
{{smalldiv|1=}} | ||
| ecos | P6030 | ECOS | url
{{smalldiv|1=}} | ||
| eflorasa | P6933 | eFloraSA | url
{{smalldiv|1=}} | ||
| eol | P830 | EoL | url
{{smalldiv|1=}} | ||
| eppo | P3031 | EPPO | url
{{smalldiv|1=}} | ||
| eunis | P6177 | EUNIS | url
{{smalldiv|1=}} | ||
| euring | P3459 | Euring | url
{{smalldiv|1=}} | ||
| faunaeuropaea | P1895 | Fauna Europaea | url
{{smalldiv|1=}} | ||
| faunaeuropaeanew | P4807 | Fauna Europaea (new) | url
{{smalldiv|1=}} | ||
| feis | P6044 | FEIS | url
{{smalldiv|1=}} | ||
| fishbase | P938 | FishBase | url
{{smalldiv|1=}} | ||
| florabase | P3101 | FloraBase | url
{{smalldiv|1=}} | ||
| flow | P6096 | FLOW | url
{{smalldiv|1=}} | ||
| fna | P1727 | FNA | url
{{smalldiv|1=}} | ||
| foao | P3100 | FoAO | url
{{smalldiv|1=}} | ||
| foao2 | P6756 | FoAO2 | url
{{smalldiv|1=}} | ||
| foc | P1747 | FoC | url
{{smalldiv|1=}} | ||
| foio | P3795 | FoIO | url
{{smalldiv|1=}} | ||
| fossilworks | P842 | Fossilworks | url
{{smalldiv|1=}} | ||
| fungorum | P1391 | Fungorum | url
{{smalldiv|1=}} | ||
| gbif | P846 | GBIF | url
{{smalldiv|1=}} | ||
| gisd | P5626 | GISD | url
{{smalldiv|1=}} | ||
| gnab | P4715 | GNAB | url
{{smalldiv|1=}} | ||
| goniat | P5216 | GONIAT | url
{{smalldiv|1=}} | ||
| grassbase | P1832 | GrassBase | url
{{smalldiv|1=}} | ||
| grin | P1421 | GRIN | url
{{smalldiv|1=}} | ||
| ibc | P3099 | IBC | url
{{smalldiv|1=}} | ||
| ifpni | P6341 | IFPNI | url
{{smalldiv|1=}} | ||
| inaturalist | P3151 | iNaturalist | url
{{smalldiv|1=}} | ||
| ipa | P6161 | IPA | url
{{smalldiv|1=}} | ||
| ipni | P961 | IPNI | url
{{smalldiv|1=}} | ||
| irmng | P5055 | IRMNG | url
{{smalldiv|1=}} | ||
| isc | P5698 | ISC | url
{{smalldiv|1=}} | ||
| itis | P815 | ITIS | url
{{smalldiv|1=}} | ||
| iucn | P627 | IUCN | url
{{smalldiv|1=}} | ||
| lepindex | P3064 | LepIndex | url
{{smalldiv|1=}} | ||
| lob | P5862 | LoB | url
{{smalldiv|1=}} | ||
| lpsn | P1991 | LPSN | url
{{smalldiv|1=}} | ||
| lygaeoidea species file | P11311 | Lygaeoidea Species File | url
{{smalldiv|1=}} | ||
| mantodea species file | P6055 | Mantodea Species File | url
{{smalldiv|1=}} | ||
| michiganflora | P6103 | MichiganFlora | url
{{smalldiv|1=}} | ||
| mobotpf | P6034 | MoBotPF | url
{{smalldiv|1=}} | ||
| mol | P6092 | MoL | url
{{smalldiv|1=}} | ||
| mnhn | P6046 | MNHN | url
{{smalldiv|1=}} | ||
| mona | P4758 | MONA | url
{{smalldiv|1=}} | ||
| msw | P959 | MSW | url
{{smalldiv|1=}} | ||
| mycobank | P962 | MycoBank | url
{{smalldiv|1=}} | ||
| nas | P6163 | NAS | url
{{smalldiv|1=}} | ||
| natureserve | P10243 | NatureServe | url
{{smalldiv|1=}} | ||
| nbn | P3240 | NBN | url
{{smalldiv|1=}} | ||
| ncbi | P685 | NCBI | url
{{smalldiv|1=}} | ||
| neotropical | P6047 | Neotropical | url
{{smalldiv|1=}} | ||
| noaa | P6049 | NOAA | url
{{smalldiv|1=}} | ||
| nswflora | P3130 | NSWFlora | url
{{smalldiv|1=}} | ||
| ntflora | P5953 | NTFlora | url
{{smalldiv|1=}} | ||
| nzbo | P6048 | NZBO | url
{{smalldiv|1=}} | ||
| nzor | P2752 | NZOR | url
{{smalldiv|1=}} | ||
| nzpcn | P7496 | NZPCN | url
{{smalldiv|1=}} | ||
| odnr | P6289 | ODNR | url
{{smalldiv|1=}} | ||
| ottol | P9157 | Open Tree of Life | url
{{smalldiv|1=}} | ||
| orthoptera species file | P6050 | Orthoptera Species File | url
{{smalldiv|1=}} | ||
| paldat | P4122 | PalDat | url
{{smalldiv|1=}} | ||
| paleobiodb | P10907 | Paleobiology Database | url
{{smalldiv|1=}} | ||
| panartic | P2434 | Panartic Flora | url
{{smalldiv|1=}} | ||
| pfaf | P4301 | PfaF | url
{{smalldiv|1=}} | ||
| pfi | P6114 | PFI | url
{{smalldiv|1=}} | ||
| phasmida species file | P4855 | Phasmida Species File | url
{{smalldiv|1=}} | ||
| ppe | P6061 | PPE | url
{{smalldiv|1=}} | ||
| plantlist | P1070 | Plant List | url
{{smalldiv|1=}} | ||
| plants | P1772 | PLANTS | url
{{smalldiv|1=}} | ||
| plazi | P1992 | Plazi | url
{{smalldiv|1=}} | ||
| powo | P5037 | POWO | url
{{smalldiv|1=}} | ||
| psocodea species file | P8145 | Psocodea Species File | url
{{smalldiv|1=}} | ||
| rd | P5473 | RD | url
{{smalldiv|1=}} | ||
| rhs | P8765 | RHS | url
{{smalldiv|1=}} | ||
| sanbi | P6056 | SANBI | url
{{smalldiv|1=}} | ||
| scc | P6057 | SCC | url
{{smalldiv|1=}} | ||
| sealifebase | P6018 | SeaLifeBase | url
{{smalldiv|1=}} | ||
| seinet | P6209 | SEINet | url
{{smalldiv|1=}} | ||
| species+ | P2040 | Species+ | url
{{smalldiv|1=}} | ||
| sprat | P2455 | SPRAT | url
{{smalldiv|1=}} | ||
| steere | P6035 | Steere | url
{{smalldiv|1=}} | ||
| tree of life | P5221 | Tree of Life | url
{{smalldiv|1=}} | ||
| tropicos | P960 | Tropicos | url
{{smalldiv|1=}} | ||
| tsa | P5397 | TSA | url
{{smalldiv|1=}} | ||
| ubio | P4728 | uBio | url
{{smalldiv|1=}} | ||
| vascan | P1745 | VASCAN | url
{{smalldiv|1=}} | ||
| vicflora | P5945 | VicFlora | url
{{smalldiv|1=}} | ||
| watson | P1761 | Watson & Dallwitz | url
{{smalldiv|1=}} | ||
| wio | P6285 | WiO | url
{{smalldiv|1=}} | ||
| wisflora | P6227 | WisFlora | url
{{smalldiv|1=}} | ||
| woi | P3746 | WoI | url
{{smalldiv|1=}} | ||
| wfo | P7715 | WFO | url
{{smalldiv|1=}} | ||
| worms | P850 | WoRMS | url
{{smalldiv|1=}} | ||
| wsc | P3288 | WSC | url
{{smalldiv|1=}} | ||
| xeno-canto | P2426 | Xeno-canto | url
{{smalldiv|1=}} | ||
| zoobank | P1746 | ZooBank | url
{{smalldiv|1=}} |
-- [zs-wikibase-guard] Ziyosfera has no Wikibase client; stub mw.wikibase so
-- modules reading Wikidata degrade to nil instead of erroring. Auto-added on import.
if not mw.wikibase then mw.wikibase = setmetatable({}, { __index = function() return function() return nil end end }) end
require('strict')
local conf = require( "Module:Taxonbar/conf" ) -- configuration module
local p = {}
function p.confdoc( frame )
local wikitable = mw.html.create('table')
wikitable:addClass('wikitable sortable')
:tag('caption')
:wikitext('Taxon identifiers by parameter name')
:done()
:tag('tr')
:tag('th')
:wikitext('Parameter')
:tag('th')
:attr('data-sort-type', 'number')
:css('white-space', 'nowrap')
:wikitext('Wikidata ID')
:tag('th')
:wikitext('Authority')
:tag('th')
:wikitext('Description')
local format = string.format
for _, db in pairs( conf.databases ) do
local prop = db[3]
if type(prop) == 'number' and prop > 0 then
local param = mw.ustring.lower(db[1])
local row = mw.html.create('tr')
row
:tag('td')
:wikitext(param)
:tag('td')
:attr('data-sort-value', prop)
:wikitext(format('[[d:Property:P%d|P%d]]', prop, prop))
-- {{#statements:P1629|from=P{{{1|}}}}}
:tag('td')
:wikitext(frame:callParserFunction{
name = '#statements:P1629',
args = { from = 'P' .. prop }
})
:tag('td')
:wikitext(mw.wikibase.getDescription('P' .. prop))
wikitable:node(row)
end
end
return wikitable
end
--[[ p.wikidataInfo( frame )
-function to show formatURL and id for taxonomic databases
]]
local COUNTER_MAX = 390
local counter = 0 --expensive parser function counter
function p.wikidataInfo( frame )
counter = frame.args['counter'] or COUNTER_MAX -- prevent too many expensive calls
local start = frame.args['start'] or "a"
local finish = frame.args['finish'] or "zzz"
local wikitable = '{| class="wikitable sortable"\n' ..
'|-\n' ..
'! Parameter !! Wikidata ID !! Database !! Examples !! datatype !! formatterURL (or alternative) and examples'
for _, db in pairs( conf.databases ) do
local param = mw.ustring.lower(db[1])
local link = db[2]
local prop = db[3]
local id = 'id'
local url = 'url'
local datatype = ""
local examples = ""
local links = ""
local formatterURL = ""
if type(prop) == 'number' and prop > 0 and param > start and param < finish then
local item = mw.wikibase.getEntity('P'..prop) --('P5354')
counter = counter - 1
if item and item ~= "" then
datatype = item.datatype
local statements = item:getBestStatements('P1630')[1]
if statements and statements.mainsnak and statements.mainsnak.datavalue and statements.mainsnak.datavalue.value then
formatterURL = statements.mainsnak.datavalue.value
url = formatterURL
else
url = "No formatter URL (P1630)."
if datatype == "url" then url = url .. " The id of the external database is the url." end
local subjectItem = item:getBestStatements('P1629')[1]
if subjectItem then
local officialWebsite = mw.wikibase.getEntity(subjectItem.mainsnak.datavalue.value.id):getBestStatements('P856')[1]
counter = counter - 1
if officialWebsite then
url = url .. '<br/>website: ' .. officialWebsite.mainsnak.datavalue.value
end
else
url = url .. ' or official website (P856) of wikidata item of this property (P1629)'
-- use third-party formatter URL. e.g for Euring number (P3459)
local statements = item:getBestStatements('P3459')[1]
if statements and statements.mainsnak and statements.mainsnak.datavalue and statements.mainsnak.datavalue.value then
local thirdPartyURL = statements.mainsnak.datavalue.value
url = url ..'<br/>use third party url: ' .. thirdPartyURL
else
url = url .. ' or third party formatter url (P3459) '
end
end
end
examples, links = p.getExamples( item, prop, formatterURL, datatype )
end
wikitable = wikitable .. '\n' .. '|-'
.. '\n|' .. param
.. '\n|' .. '[[:d:Property:P' .. prop .. '|P' .. prop .. ']]'
.. '\n|' .. link
.. '\n|' .. examples
.. '\n|' .. datatype
.. '\n|' .. url .. '\n{{smalldiv|1=' .. links .. '}}'
end
end
return wikitable .. '\n|}'
end
function p.getExamples( propItem , prop, formatterURL, datatype)
if counter < 0 then return "count exceeded" end
local examples = ""
local links = ""
local exampleStatements = propItem:getBestStatements('P1855')
local nExamples = 0
--local statement = statements[1]
for _, statement in pairs( exampleStatements ) do
if nExamples == 3 then break end -- don't show more than 3 examples
if statement.mainsnak and statement.mainsnak.datavalue and statement.mainsnak.datavalue.value then
local examplesValue = statement.mainsnak.datavalue.value
if examplesValue and examplesValue.id then
local exampleID = examplesValue.id
--examples = examples .. '\n*[[:d:' .. exampleID .. '|' .. exampleID ..']] '
local label = mw.wikibase.getLabel( exampleID )
examples = examples .. '\n*[[' .. label .. ']] ([[:d:' .. exampleID .. '|' .. exampleID ..']])'
-- get information form qualifiers
if statement.qualifiers then
local qualifiers = statement['qualifiers']
local value = qualifiers['P'..prop][1] --['datavalue']['value']
--mw.addWarning (mw.wikibase.formatValues( qualifiers ))
--mw.addWarning (mw.wikibase.renderSnaks( qualifiers ))
-- mw.addWarning (mw.wikibase.formatValue( value ))
--mw.addWarning ( mw.wikibase.renderSnak( value ))
local id = mw.wikibase.renderSnak( value )
examples = examples .. '<br/><small>id=<code>' .. id .. '</code></small>'
local link = formatterURL:gsub('$1', id)
if (datatype == "url") then link = id end
links = links .. '\n*' .. link .. ''
end
--[==[ -- this method is expensive as it calls getEntity
local item = mw.wikibase.getEntity(exampleID)
counter = counter - 1
nExamples = nExamples + 1
if item and item ~= "" then
--datatype = item.datatype
local statements = item:getBestStatements('P225')[1] -- taxon name
if statements and statements.mainsnak and statements.mainsnak.datavalue and statements.mainsnak.datavalue.value then
local taxon = statements.mainsnak.datavalue.value
examples = examples .. ' [[' .. taxon .. ']]'
end
local statements = item:getBestStatements('P'..prop)[1] -- the databas property
if statements and statements.mainsnak and statements.mainsnak.datavalue and statements.mainsnak.datavalue.value then
local id = statements.mainsnak.datavalue.value
local link = formatterURL:gsub('$1', id)
if (datatype == "url") then link = id end
examples = examples .. ' (' .. id .. ')'
links = links .. '\n*' .. link .. ''
end
end
]==]
else
examples = examples .. "No example"
end
else
examples = examples .. "No examples statements"
end
end
return examples, links
end
return p