|
|
@ -220,8 +220,24 @@ def artwork(): |
|
|
|
# print(artworkintro) |
|
|
|
|
|
|
|
# Image(s) |
|
|
|
# query for later |
|
|
|
# sparql.setQuery(''' |
|
|
|
# SELECT ?image ?depictsLabel ?licenseLabel |
|
|
|
# WHERE |
|
|
|
# { |
|
|
|
# VALUES ?work {wd:'''+artwork_id+'''} |
|
|
|
# ?work wdt:P30 ?image. |
|
|
|
# OPTIONAL { ?work p:P30 ?statement2. |
|
|
|
# ?statement2 ps:P30 ?image; |
|
|
|
# pq:P54 ?depicts; |
|
|
|
# pq:P56 ?license.} |
|
|
|
# SERVICE wikibase:label { bd:serviceParam wikibase:language "en".} |
|
|
|
# } |
|
|
|
# ''') |
|
|
|
# temp fix query |
|
|
|
|
|
|
|
sparql.setQuery(''' |
|
|
|
SELECT ?image ?depictsLabel ?licenseLabel |
|
|
|
SELECT ?image ?depictsLabel ?licenseLabel |
|
|
|
WHERE |
|
|
|
{ |
|
|
|
VALUES ?work {wd:'''+artwork_id+'''} |
|
|
@ -230,9 +246,10 @@ def artwork(): |
|
|
|
?statement2 ps:P30 ?image; |
|
|
|
pq:P54 ?depicts; |
|
|
|
pq:P56 ?license.} |
|
|
|
FILTER(?depicts != wd:Q1897) |
|
|
|
SERVICE wikibase:label { bd:serviceParam wikibase:language "en".} |
|
|
|
} |
|
|
|
''') |
|
|
|
}''') |
|
|
|
|
|
|
|
sparql.setReturnFormat(JSON) |
|
|
|
artworkimages = sparql.query().convert() |
|
|
|
print(artworkimages) |
|
|
|