15.154
Bearbeitungen
(Leerzeichen) |
(außerhalb Fürth) |
||
| Zeile 28: | Zeile 28: | ||
-- Seiten-Selektoren für die Abfragen | -- Seiten-Selektoren für die Abfragen | ||
local | local top_prefix, top_postfix, sub_prefix, sub_postfix | ||
if attr["Aufschlüsselung"] == "Auszeichnungen" then | if attr["Aufschlüsselung"] == "Auszeichnungen" then | ||
top_prefix, top_postfix = "[[-has subobject::<q>", "</q>]]" -- Abfrage aus Sicht der Auszeichnung-subobject-Ebene | top_prefix, top_postfix = "[[-has subobject::<q>", "</q>]]" -- Abfrage aus Sicht der Auszeichnung-subobject-Ebene | ||
| Zeile 42: | Zeile 37: | ||
end | end | ||
-- Basis-Selektor | -- Basis-Selektor | ||
page_selector_basis = top_prefix .. "[[:+]][[Kategorie:Personen]]" .. top_postfix | local page_selector_basis = top_prefix .. "[[:+]][[Kategorie:Personen]]" .. top_postfix | ||
page_selector_basis = page_selector_basis .. sub_prefix .. "[[SubObjektTyp::Auszeichnung]]" .. sub_postfix | page_selector_basis = page_selector_basis .. sub_prefix .. "[[SubObjektTyp::Auszeichnung]]" .. sub_postfix | ||
if attr["Auszeichnung"] ~= nil then | if attr["Auszeichnung"] ~= nil then | ||
| Zeile 67: | Zeile 62: | ||
end | end | ||
-- Geburtsort-Selektoren | -- Geburtsort-Selektoren | ||
local page_selector_fuerth = top_prefix .. "[[Geburtsort::Fürth]]" .. top_postfix | |||
local page_selector_ausserhalb = top_prefix .. "[[Geburtsort::!Fürth]]" .. top_postfix | |||
local page_selector_ort = "" | |||
if attr["Geburtsort"] == "Fürth" then | if attr["Geburtsort"] == "Fürth" then | ||
page_selector_ort = | page_selector_ort = page_selector_fuerth | ||
end | end | ||
if attr["Geburtsort"] == "außerhalb" then | if attr["Geburtsort"] == "außerhalb" then | ||
page_selector_ort = | page_selector_ort = page_selector_ausserhalb | ||
end | end | ||
-- Geschlecht-Selektoren | -- Geschlecht-Selektoren | ||
page_selector_maennlich = top_prefix .. "[[Geschlecht::männlich]]" .. top_postfix | local page_selector_maennlich = top_prefix .. "[[Geschlecht::männlich]]" .. top_postfix | ||
page_selector_weiblich = top_prefix .. "[[Geschlecht::weiblich]]" .. top_postfix | local page_selector_weiblich = top_prefix .. "[[Geschlecht::weiblich]]" .. top_postfix | ||
page_selector_divers = top_prefix .. "[[Geschlecht::divers]]" .. top_postfix | local page_selector_divers = top_prefix .. "[[Geschlecht::divers]]" .. top_postfix | ||
local page_selector_geschlecht = "" | |||
if attr["Geschlecht"] ~= nil then | if attr["Geschlecht"] ~= nil then | ||
page_selector_geschlecht = top_prefix .. "[[Geschlecht::" .. attr["Geschlecht"] .. "]]" .. top_postfix | page_selector_geschlecht = top_prefix .. "[[Geschlecht::" .. attr["Geschlecht"] .. "]]" .. top_postfix | ||
| Zeile 101: | Zeile 99: | ||
end | end | ||
if attr["Geburtsort"] == nil then | if attr["Geburtsort"] == nil then | ||
local n_basis_fuerth_geschlecht = mw.smw.ask(page_selector_basis .. | local n_basis_fuerth_geschlecht = mw.smw.ask(page_selector_basis .. page_selector_fuerth .. page_selector_geschlecht .. "| format=count | limit=10000") | ||
local n_basis_ausserhalb_geschlecht = mw.smw.ask(page_selector_basis .. page_selector_ausserhalb .. page_selector_geschlecht .. "| format=count | limit=10000") | |||
local p_basis_fuerth_geschlecht = math.floor(n_basis_fuerth_geschlecht / n_basis_ort_geschlecht * 100 + 0.5) | local p_basis_fuerth_geschlecht = math.floor(n_basis_fuerth_geschlecht / n_basis_ort_geschlecht * 100 + 0.5) | ||
t = t .. "; davon " .. n_basis_fuerth_geschlecht .. " (" .. p_basis_fuerth_geschlecht.. "%) gebürtige Fürther '''(ggf. Rest nicht angegeben)'''" | local p_basis_ausserhalb_geschlecht = math.floor(n_basis_ausserhalb_geschlecht / n_basis_ort_geschlecht * 100 + 0.5) | ||
t = t .. "; davon " .. n_basis_fuerth_geschlecht .. " (" .. p_basis_fuerth_geschlecht.. "%) gebürtige Fürther" | |||
t = t .. "und " .. n_basis_ausserhalb_geschlecht .. " (" .. p_basis_ausserhalb_geschlecht.. "%) außerhalb Fürth geboren '''(ggf. Rest nicht angegeben)'''" | |||
end | end | ||
t = t .. "<br>'''" | t = t .. "<br>'''" | ||