Last active
July 4, 2019 15:00
-
-
Save kartben/350a9b72374e44c8ab60abaaef7c1acd to your computer and use it in GitHub Desktop.
list of famous paintings + thumbnails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT ?item ?itemLabel ?thumb ?catcode WHERE { ?item p:P528 [ pq:P972 wd:Q41634361 ; ps:P528 ?catcode]. | |
?item wdt:P18 ?picture . | |
BIND(REPLACE(wikibase:decodeUri(STR(?picture)), "http://commons.wikimedia.org/wiki/Special:FilePath/", "") as ?fileName) . | |
BIND(REPLACE(?fileName, " ", "_") as ?safeFileName) | |
BIND(MD5(?safeFileName) as ?fileNameMD5) . | |
BIND(CONCAT("https://upload.wikimedia.org/wikipedia/commons/thumb/", SUBSTR(?fileNameMD5, 1, 1), "/", SUBSTR(?fileNameMD5, 1, 2), "/", ?safeFileName, "/650px-", ?safeFileName) as ?thumb) | |
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } | |
} ORDER BY xsd:integer(?catcode) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment