Add missing changes for catching non-artwork.
This commit is contained in:
parent
63392b63bf
commit
63f8d0f580
|
@ -202,3 +202,9 @@ def quote_list(l):
|
||||||
def url_list(l):
|
def url_list(l):
|
||||||
no_dups = list(dict.fromkeys(l)) # remove duplicates
|
no_dups = list(dict.fromkeys(l)) # remove duplicates
|
||||||
return ' '.join(f'(<{s}>)' for s in no_dups)
|
return ' '.join(f'(<{s}>)' for s in no_dups)
|
||||||
|
|
||||||
|
def is_artificial_physical_object(qid):
|
||||||
|
bindings = run_from_template_with_cache('query/item_type.sparql', qid=qid)
|
||||||
|
types = {row_id(row, field='item') for row in bindings}
|
||||||
|
# Q8205328 == artificial physical object
|
||||||
|
return 8205328 in types
|
||||||
|
|
4
templates/query/item_type.sparql
Normal file
4
templates/query/item_type.sparql
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
select ?item ?itemLabel {
|
||||||
|
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
|
||||||
|
wd:{{ qid }} wdt:P31/wdt:P279* ?item .
|
||||||
|
}
|
Loading…
Reference in a new issue