Library items don't need to look for the Key:office tag

This commit is contained in:
Edward Betts 2021-07-23 14:38:13 +02:00
parent a1a3695857
commit 641490f4ea

View file

@ -232,6 +232,10 @@ def get_item_tags(item):
skip_isa.add(41176) # building (Q41176) skip_isa.add(41176) # building (Q41176)
seen = set(isa_list) | skip_isa seen = set(isa_list) | skip_isa
stop = {
"Q11799049", # public institution
"Q7075", # library
}
while isa_items: while isa_items:
isa, isa_path = isa_items.pop() isa, isa_path = isa_items.pop()
if not isa: if not isa:
@ -244,6 +248,10 @@ def get_item_tags(item):
for i in osm: for i in osm:
osm_list[i].append(isa_path[:]) osm_list[i].append(isa_path[:])
if isa.qid in stop:
# item is specific enough, no need to keep walking the item hierarchy
continue
subclass_of = {v["numeric-id"] for v in (isa.get_claim("P279") or []) if v} subclass_of = {v["numeric-id"] for v in (isa.get_claim("P279") or []) if v}
religion = {v["numeric-id"] for v in (isa.get_claim("P140") or []) if v} religion = {v["numeric-id"] for v in (isa.get_claim("P140") or []) if v}
sport = {v["numeric-id"] for v in (isa.get_claim("P641") or []) if v} sport = {v["numeric-id"] for v in (isa.get_claim("P641") or []) if v}