import sys
import json
import csv
import requests 
import pprint
import re
from tqdm import tqdm_notebook
from urllib.parse import quote
from urllib.request import urlopen
from urllib.request import urlretrieve
from multiprocessing.pool import ThreadPool
from time import time as timer
import time

import pandas as pd

# Load Azure Custom Vision API endpoint URL and API key
with open('azurecredentials.json') as f:
    data = json.load(f)
    PREDICTION_KEY = data['predictionkey']
    AZURE_CV_URL   = data['azure_cv_url']
    
# Set POST request header to JSON and our secret key
headers = {'Content-Type' : 'application/json', 'Prediction-Key' : PREDICTION_KEY }

metapibaseurl  = 'https://collectionapi.metmuseum.org/public/collection/v1/objects/{}'

threshold = 0.6   # confidence threshold to exceed for Azure predictions to be returned

maxthreads = 15   # How many parallel threads - WARNING - too many and Azure returns error

# Need to handle Azure error:
# {'statusCode': 429, 'message': 'Rate limit is exceeded. Try again in 1 seconds.'}
# Quotas: https://docs.microsoft.com/en-us/azure/cognitive-services/custom-vision-service/limits-and-quotas
maxtries = 20
waitinterval = 1

max_azure_image_size = 4000000   # In bytes, largest image size Azure CV will accept

# Take image URL, feed it to Azure Custom Vision instance
# Return dataframe of results
def imageurl2predictiondf(url):
    # Handle Azure rate limit by adding retry count and wait interval
    tries = 0
    wait  = waitinterval
    payload = '{"url":"' + url.strip() + '"}'
    while tries < maxtries :
        try:
            # Send POST request to our Azure Custom Vision API
            r = requests.post(AZURE_CV_URL, headers=headers, data=payload).json()
            # Successful predictions returned
            if 'predictions' in r:
                df = pd.DataFrame(r['predictions'],columns=['tagName','probability'])
                return df
            # Error, probably rate limiting
            elif 'statusCode' in r and r['statusCode'] == 429:   # Need to sleep and retry
                # print ('Sleeping {} for {} seconds, try {}'.format(url,wait,tries))
                time.sleep(wait)     # wait a bit
                tries += 1           # record another try
                # wait += waitinterval # increase wait period by interval in case of retry
                continue
            # Unexpected error condition
            print ("imageurl2predictiondf:","error returned from Azure for",url, file=sys.stderr)
            return None
        except Exception as e:
            # print ('Excpetion',e)
            return None
    print('imageurl2predictiondf:',' retry limit after ', tries, url, file=sys.stderr)
    return None
    

# Given a Commons file name from WD (P18) return full URL
# In: September SAAM-1909.7.13 1.jpg
# Out: https://upload.wikimedia.org/wikipedia/commons/5/51/September_SAAM-1909.7.13_1.jpg
def commonsfile2url (filename):
    COMMONS_API_URL = 'https://commons.wikimedia.org/w/api.php?action=query&titles=File%3A{}&prop=imageinfo&iiprop=url&format=json'
    cqueryurl = COMMONS_API_URL.format(quote(filename))

    returnurl=''
    response=''
    with urlopen(cqueryurl) as newurl:
        response = json.loads(newurl.read().decode())
        # Need to process query►pages►66384523►title                                                                                                     
    if response["query"]: # and response["query"]["pages"][0]["title"]:                                                                              
            # Get query►pages►66384523►imageinfo►0►url                                                                                                   
            for k, v in response["query"]["pages"].items():
                returnurl = v["imageinfo"][0]["url"]
    return returnurl

# Convert a Wikidata QID to image filename via their API
# Input: Q42
# Output: 'Douglas adams portrait cropped.jpg'
def qid2commonsfile(qid):
    WD_API_URL="https://www.wikidata.org/w/api.php?action=wbgetclaims&entity={}&property={}&format=json"    
    imageproperty='P18'
    
    wdurl = WD_API_URL.format(qid.rstrip(),imageproperty)
    filename = ''

    with urlopen(wdurl) as url:
        wd_r = json.loads(url.read().decode())
        # Check if claims has anything in this area                                                                                                  
        if wd_r["claims"] and wd_r["claims"][imageproperty][0]["mainsnak"]:
        # Check that:                                                                                                                                
         # claims►P18►0►mainsnak►datatype = 'commonsMedia'                                                                                            
         # claims►P18►0►mainsnak►datavalue►value = <filename>                                                                                         
            datatype = wd_r["claims"][imageproperty][0]["mainsnak"]["datatype"]
            filename = wd_r["claims"][imageproperty][0]["mainsnak"]["datavalue"]["value"]

        if filename:
            return(filename)
        else:
            return None

        
fromstring='https://upload.wikimedia.org/wikipedia/commons/'
tostring='https://upload.wikimedia.org/wikipedia/commons/thumb/'

# Prep for matching regexp of image file types
# (jpg|JPG|png|PNG|jpeg|TIFF|tiff|tif|TIF)$
jpattern = re.compile('.*(JPG|jpg|jpeg)$')
ppattern = re.compile('.*(PNG|png)$')
tpattern = re.compile('.*(TIF|tif|TIFF|tiff)$')

def qid2predictionlist(qid):

    # Get name of the Commons image for the Wikidata item
    commonsfilename = qid2commonsfile(qid)
    # print ("commonsfilename", commonsfilename)

    # Check the size, to make sure it is < 4 Mbytes
    w, h, size = commonsfiledimensions(quote(commonsfilename))
    # print ("dim",w,h,size)
    # Find out the full URL of the Commons file
    commonsfileurl = commonsfile2url(commonsfilename)
    # Eventual URL sent to Azure may need to be altered to point to a smaller
    #   JPG version. Initialize with the original
    payloadurl = commonsfileurl
    
    # If the file is bigger than max size (4 Mbytes)
    if size > max_azure_image_size:
        # Let's use the thumbnail version
        thumbimageurl = commonsfileurl.replace(fromstring,tostring)

        # Need to resize by rewriting the URL as thumb
        if jpattern.match(commonsfilename):
            # BIG JPG/jpg, use scaled version instead
            payloadurl = thumbimageurl + '/1536px-' + quote(commonsfilename)
        elif ppattern.match(commonsfilename):
            # PNG file, compromise, 1024px resizing to jpg
            # Most PNG files are fairly small, but some are massive
            payloadurl = thumbimageurl + '/1024px-' + quote(commonsfilename) + '.jpg'
        elif tpattern.match(commonsfilename):
            # TIFF file, scale down and add "jpg" extension to return a smaller jpg
            # Most TIFF artworks are huge (50 Mbytes or so)
            payloadurl = thumbimageurl + '/1536px-' + quote(commonsfilename) + '.jpg'
        else:
            # TK Should probably handle the rare GIF file
            print (qid,"filetype error: " + commonsfilename)
            return qid, None
        
        # Pull the resized image to /dev/null in order to prime the cache on Commons
        # This way, when the Azure side pulls the image, it doesn't need to wait
        #   for large files to be downsampled. Sometimes takes more than 10 seconds
        #   for a 60 Mbyte TIFF to be converted to small JOPG and perhaps 
        #   Azure is timing out.
        tries=0
        while tries < maxtries :
            try:
                urlretrieve(payloadurl, "/dev/null")
                break
            except Exception as e:
                tries += 1
                print (qid,'priming Commons cache exception: try ',tries,e,'for',payloadurl)
                time.sleep(waitinterval)

    # Get a prediction from the Azure side
    df = imageurl2predictiondf(payloadurl)
    if df is None:
        print ('qid2predictionlist: no dataframe returned for', qid, file=sys.stderr)
        return qid, None
    else:
        if df[df['probability']>threshold].empty:
            return qid, None
        return qid, df[df['probability']>threshold]['tagName'].tolist()
    

# Given a Commons filename return width, height and size from API
# Input: foo.jpg
# Output: (3354, 5165, 51992602)
def commonsfiledimensions(filename):
    w, h, size = 0, 0, 0
    COMMONS_API_URL='https://commons.wikimedia.org/w/api.php?action=query&titles=File:{}&prop=imageinfo&iiprop=size&iimetadataversion=latest&format=json'
    
    try:
        wdurl = COMMONS_API_URL.format(filename)
        commons_r = None
        with urlopen(wdurl) as url:
            commons_r = json.loads(url.read().decode())
        if commons_r['query'] and commons_r['query']['pages']:
            imagedict = commons_r['query']['pages']
            w = list(imagedict.values())[0]['imageinfo'][0]['width']
            h = list(imagedict.values())[0]['imageinfo'][0]['height']
            size = list(imagedict.values())[0]['imageinfo'][0]['size']
            return w, h, size
        else:
            return None, None, None
    except Exception as e:
        print ('Excpetion',e)
        return None, None, None
# qid2commonsfile('Q42')
# qid2predictionlist('Q42')
commonsfiledimensions("Commons-logo.svg")
commonsfiledimensions("Clevelandart_1962.169.jpg")
commonsfiledimensions("Douglas_adams_portrait_cropped.jpg")
commonsfiledimensions('Anonymous_-_Page_from_Tales_of_a_Parrot_(Tuti-nama),_text_page_-_1962.279.126.a_-_Cleveland_Museum_of_Art.tiff')

#qid2predictionlist('Q42')
#qid2predictionlist('Q20880210')
#qid2predictionlist('Q20880262')
#qid2predictionlist('Q60466875')
#qid2predictionlist('Q55851800')
threshold = 0.40
qid2predictionlist('Q21614710')
('Q21614710', ['Women', 'Men', 'Portraits', 'Dogs', 'Girls'])
outputfile = 'predictions.csv'

# Set SPARQL query, make sure main Wikdiata numbers are returned in "?q"
query = '''
SELECT DISTINCT ?q
WHERE 
{
  ?q wdt:P31/wdt:P279* wd:Q3305213 .
  ?q wdt:P195 wd:Q842858 .
  ?q wdt:P18 ?i .
}
'''

# Execute Wikidata query
wdqurl = 'https://query.wikidata.org/bigdata/namespace/wdq/sparql'
data = requests.get(wdqurl, params={'query': query, 'format': 'json'}).json()

# Make array of qids
qids = []
for item in data['results']['bindings']:
    qnumber = re.search(r"(Q\d+)$", item['q']['value']).group(0)
    qids.append(qnumber)
# Parallel processing using threads
start = timer()
    
results = ThreadPool(maxthreads).imap_unordered(qid2predictionlist, qids)

outfile = open(outputfile,'w',buffering=1)  # Buffering=1 writes lines to files immediately
maxitems = len(qids)

for id, prediction in tqdm_notebook(results,total=maxitems):
    outfile.write("{},{}\n".format(id, prediction))

print("Elapsed Time (parallel threads): %s" % (timer() - start,))

outfile.close()
Q18575807 priming Commons cache exception: try  1 HTTP Error 429: Too Many Requests for https://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/Jonas_Alstr%C3%B6mer%2C_1685-1761%2C_industriman_-_Nationalmuseum_-_15708.tif/1536px-Jonas%20Alstr%C3%B6mer%2C%201685-1761%2C%20industriman%20-%20Nationalmuseum%20-%2015708.tif.jpg
Q18575804 priming Commons cache exception: try  1 HTTP Error 429: Too Many Requests for https://upload.wikimedia.org/wikipedia/commons/thumb/c/c7/Augustin_Ehrensv%C3%A4rd%2C_1710-1772%2C_milit%C3%A4r%2C_greve_%28Per_Krafft_d.%C3%A4.%29_-_Nationalmuseum_-_15703.tif/1536px-Augustin%20Ehrensv%C3%A4rd%2C%201710-1772%2C%20milit%C3%A4r%2C%20greve%20%28Per%20Krafft%20d.%C3%A4.%29%20-%20Nationalmuseum%20-%2015703.tif.jpg
Q18575801 priming Commons cache exception: try  1 HTTP Error 429: Too Many Requests for https://upload.wikimedia.org/wikipedia/commons/thumb/2/21/Hedvig_Charlotta_Nordenflycht%2C_1718-1763_-_Nationalmuseum_-_15700.tif/1536px-Hedvig%20Charlotta%20Nordenflycht%2C%201718-1763%20-%20Nationalmuseum%20-%2015700.tif.jpg
Q18575810 priming Commons cache exception: try  1 HTTP Error 429: Too Many Requests for https://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/Gustaf_Kierman%2C_1702-1766%2C_grosshandlare_-_Nationalmuseum_-_15709.tif/1536px-Gustaf%20Kierman%2C%201702-1766%2C%20grosshandlare%20-%20Nationalmuseum%20-%2015709.tif.jpg
Q18575811 priming Commons cache exception: try  1 HTTP Error 429: Too Many Requests for https://upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Emanuel_Swedenborg%2C_1688-1772%2C_%C3%A4mbetsman_%28Per_Krafft_d.%C3%A4.%29_-_Nationalmuseum_-_15710.tif/1536px-Emanuel%20Swedenborg%2C%201688-1772%2C%20%C3%A4mbetsman%20%28Per%20Krafft%20d.%C3%A4.%29%20-%20Nationalmuseum%20-%2015710.tif.jpg
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/1/17/Carl_Reinhold_von_Fersen_%281716-86%29_1787%2C_greve%2C_riksr%C3%A5d%2C_%C3%B6verhovj%C3%A4gm%C3%A4st_%28Anton_Ulrik_Berndes%29_-_Nationalmuseum_-_24120.tif
qid2predictionlist: no dataframe returned for Q18542581
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/7/75/Queen_Karin_M%C3%A5nsdotter_of_Sweden_%28Eric_Utterhielm%29_-_Nationalmuseum_-_26157.tif
qid2predictionlist: no dataframe returned for Q18546048
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/8/81/Jean_Baptist_Colbert_-_Nationalmuseum_-_18179.tif
qid2predictionlist: no dataframe returned for Q18580847
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/e/e7/T%C3%A5get_%C3%B6ver_B%C3%A4lt_%28fragment%29_%28Johann_Philip_Lemke%29_-_Nationalmuseum_-_39229.tif
qid2predictionlist: no dataframe returned for Q18581586
Q18578451 priming Commons cache exception: try  1 HTTP Error 429: Too Many Requests for https://upload.wikimedia.org/wikipedia/commons/thumb/8/82/Anna_Leszczynska%2C_1699-1717%2C_prinsessa_av_Polen_%28Johan_Starbus%29_-_Nationalmuseum_-_15962.tif/1536px-Anna%20Leszczynska%2C%201699-1717%2C%20prinsessa%20av%20Polen%20%28Johan%20Starbus%29%20-%20Nationalmuseum%20-%2015962.tif.jpg
Q18578450 priming Commons cache exception: try  1 HTTP Error 429: Too Many Requests for https://upload.wikimedia.org/wikipedia/commons/thumb/1/15/Natalia_Alexievna_Vilhelmina%2C_1755-1776%2C_prinsessa_av_Hessen-Darmstadt%2C_storfurstinna_-_Nationalmuseum_-_15961.tif/1536px-Natalia%20Alexievna%20Vilhelmina%2C%201755-1776%2C%20prinsessa%20av%20Hessen-Darmstadt%2C%20storfurstinna%20-%20Nationalmuseum%20-%2015961.tif.jpg
Q18578454 priming Commons cache exception: try  1 HTTP Error 429: Too Many Requests for https://upload.wikimedia.org/wikipedia/commons/thumb/b/b5/Fredrik%2C_1635-1654%2C_prins_av_Holstein-Gottorp_%28Juriaen_Ovens%29_-_Nationalmuseum_-_15964.tif/1536px-Fredrik%2C%201635-1654%2C%20prins%20av%20Holstein-Gottorp%20%28Juriaen%20Ovens%29%20-%20Nationalmuseum%20-%2015964.tif.jpg
Q18578459 priming Commons cache exception: try  1 HTTP Error 429: Too Many Requests for https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Fredrik%2C_1635-1654%2C_hertig_av_Holstein-Gottorp_%28David_Kl%C3%B6cker_Ehrenstrahl%29_-_Nationalmuseum_-_15969.tif/1536px-Fredrik%2C%201635-1654%2C%20hertig%20av%20Holstein-Gottorp%20%28David%20Kl%C3%B6cker%20Ehrenstrahl%29%20-%20Nationalmuseum%20-%2015969.tif.jpg
Q18578457 priming Commons cache exception: try  1 HTTP Error 429: Too Many Requests for https://upload.wikimedia.org/wikipedia/commons/thumb/9/98/Maria_Elisabet%2C_1634-1665%2C_prinsessa_av_Holstein-Gottorp_%28Juriaen_Ovens%29_-_Nationalmuseum_-_15965.tif/1536px-Maria%20Elisabet%2C%201634-1665%2C%20prinsessa%20av%20Holstein-Gottorp%20%28Juriaen%20Ovens%29%20-%20Nationalmuseum%20-%2015965.tif.jpg
Q18578496 priming Commons cache exception: try  1 HTTP Error 429: Too Many Requests for https://upload.wikimedia.org/wikipedia/commons/thumb/d/d9/Anna_Dorotea%2C_1640-1713%2C_prinsessa_av_Holstein-Gottorp%2C_abbedissa_i_Quedlingburg_%28Abraham_Wuchters%29_-_Nationalmuseum_-_16016.tif/1536px-Anna%20Dorotea%2C%201640-1713%2C%20prinsessa%20av%20Holstein-Gottorp%2C%20abbedissa%20i%20Quedlingburg%20%28Abraham%20Wuchters%29%20-%20Nationalmuseum%20-%2016016.tif.jpg
Q18578497 priming Commons cache exception: try  1 HTTP Error 429: Too Many Requests for https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Johan_Georg%2C_1638-1655%2C_prins_av_Holstein-Gottorp_%28Juriaen_Ovens%29_-_Nationalmuseum_-_16017.tif/1536px-Johan%20Georg%2C%201638-1655%2C%20prins%20av%20Holstein-Gottorp%20%28Juriaen%20Ovens%29%20-%20Nationalmuseum%20-%2016017.tif.jpg
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/9/92/Teodor_van_Loon%2C_1585-d%C3%B6d_f%C3%B6re_1660_-_Nationalmuseum_-_31890.tif
qid2predictionlist: no dataframe returned for Q18582162
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/0/0f/Karl_XIII%2C_1748-1818%2C_kung_av_Sverige_och_Norge_%28Per_Krafft_d.y.%29_-_Nationalmuseum_-_39237.tif
qid2predictionlist: no dataframe returned for Q18588716
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/2/23/Interi%C3%B6r_fr%C3%A5n_Gripsholms_Slott_%28Karl_August_Johansson%29_-_Nationalmuseum_-_40352.tif
qid2predictionlist: no dataframe returned for Q18589476
Q18578538 priming Commons cache exception: try  1 HTTP Error 429: Too Many Requests for https://upload.wikimedia.org/wikipedia/commons/thumb/f/fb/Karl_XII_som_barn%2C_1682-1718%2C_kung_av_Sverige_%28David_Kl%C3%B6cker_Ehrenstrahl%29_-_Nationalmuseum_-_16051.tif/1536px-Karl%20XII%20som%20barn%2C%201682-1718%2C%20kung%20av%20Sverige%20%28David%20Kl%C3%B6cker%20Ehrenstrahl%29%20-%20Nationalmuseum%20-%2016051.tif.jpg
Q18578536 priming Commons cache exception: try  1 HTTP Error 429: Too Many Requests for https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/Fredrik_I%2C_1676-1751%2C_konung_av_Sverige_lantgreve_av_Hessen-Kassel_%28Lorens_Pasch_d.%C3%A4.%29_-_Nationalmuseum_-_14806.tif/1536px-Fredrik%20I%2C%201676-1751%2C%20konung%20av%20Sverige%20lantgreve%20av%20Hessen-Kassel%20%28Lorens%20Pasch%20d.%C3%A4.%29%20-%20Nationalmuseum%20-%2014806.tif.jpg
Q18578950 priming Commons cache exception: try  1 HTTP Error 429: Too Many Requests for https://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/Gustav_III%2C_1746-92%2C_kung_av_Sverige_-_Nationalmuseum_-_40301.tif/1536px-Gustav%20III%2C%201746-92%2C%20kung%20av%20Sverige%20-%20Nationalmuseum%20-%2040301.tif.jpg
Q18578951 priming Commons cache exception: try  1 HTTP Error 429: Too Many Requests for https://upload.wikimedia.org/wikipedia/commons/thumb/8/8e/Louis_Marie_de_Camps%2C_1765-1844_%28Fredric_Westin%29_-_Nationalmuseum_-_40302.tif/1536px-Louis%20Marie%20de%20Camps%2C%201765-1844%20%28Fredric%20Westin%29%20-%20Nationalmuseum%20-%2040302.tif.jpg
Q18578962 priming Commons cache exception: try  1 HTTP Error 429: Too Many Requests for https://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Johan_Gabriel_Oxenstierna_af_Korsholm_och_Wasa%2C_1750-1818_%28Johan_Gustaf_Sandberg%29_-_Nationalmuseum_-_40312.tif/1536px-Johan%20Gabriel%20Oxenstierna%20af%20Korsholm%20och%20Wasa%2C%201750-1818%20%28Johan%20Gustaf%20Sandberg%29%20-%20Nationalmuseum%20-%2040312.tif.jpg
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Johan_Gabriel_Oxenstierna_af_Korsholm_och_Wasa%2C_1750-1818_%28Johan_Gustaf_Sandberg%29_-_Nationalmuseum_-_40312.tif/1536px-Johan%20Gabriel%20Oxenstierna%20af%20Korsholm%20och%20Wasa%2C%201750-1818%20%28Johan%20Gustaf%20Sandberg%29%20-%20Nationalmuseum%20-%2040312.tif.jpg
qid2predictionlist: no dataframe returned for Q18578962
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/thumb/f/f9/Magnus_Lehnberg%2C_1758-1808_%28Johan_Gustaf_Sandberg%29_-_Nationalmuseum_-_40322.tif/1536px-Magnus%20Lehnberg%2C%201758-1808%20%28Johan%20Gustaf%20Sandberg%29%20-%20Nationalmuseum%20-%2040322.tif.jpg
qid2predictionlist: no dataframe returned for Q18578975
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/4/44/The_Mystic_Marriage_of_St_Catherine_%28Denys_Calvaert%29_-_Nationalmuseum_-_17192.tif
qid2predictionlist: no dataframe returned for Q18574508
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/b/b2/Landscape_with_Old_Buildings_%28Alessio_de_Marchis%29_-_Nationalmuseum_-_17197.tif
qid2predictionlist: no dataframe returned for Q18574551
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/7/73/Georg_I%2C_1660-1727%2C_konung_av_England_%28David_von_C%C3%B6ln%29_-_Nationalmuseum_-_14742.tif
qid2predictionlist: no dataframe returned for Q18597673
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/c/cd/Anders_Fryxell%2C_1795-1881_%28Amalia_Lindegren%29_-_Nationalmuseum_-_19301.tif
qid2predictionlist: no dataframe returned for Q18580666
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/9/97/Nejlikest%C3%A5nd_i_kruka_%28David_von_C%C3%B6ln%29_-_Nationalmuseum_-_15142.tif
qid2predictionlist: no dataframe returned for Q18585952
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/6/6b/Johann_von_Giffen_-_Nationalmuseum_-_15442.tif
qid2predictionlist: no dataframe returned for Q18586348
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/b/bd/File-Carl_Larsson_-Timmerr%C3%A4nnan._Vinterbild_-_Ett_hem_-_1899.tif
qid2predictionlist: no dataframe returned for Q18587078
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/7/7f/Carl_Larsson_-_Stugan_-_Ett_hem_-_1899.tif
qid2predictionlist: no dataframe returned for Q18587084
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/b/ba/Carl_Larsson_-_Ett_hem_10_-_1899.tif
qid2predictionlist: no dataframe returned for Q18587103
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/2/27/Carl_Larsson_-_Ett_bra_badst%C3%A4lle_-_Ett_hem_-_1899.tif
qid2predictionlist: no dataframe returned for Q18587153
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/6/65/Carl_Larsson_-_Britas_Tupplur_-_Ett_hem_-_1899.tif
qid2predictionlist: no dataframe returned for Q18587137
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/5/5f/Carl_Larsson_-_Verandan_-_Ett_hem_-_1899.tiff
qid2predictionlist: no dataframe returned for Q18587322
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/c/ca/Carl_Larsson_-_Grinden_-_Ett_hem_-_1899.tif
qid2predictionlist: no dataframe returned for Q18587303
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/3/31/Carl_Larsson_-_Atelj%C3%A9n%2C_ena_h%C3%A4lften_-_Ett_hem_-_1899.tif
qid2predictionlist: no dataframe returned for Q18587357
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/7/7e/Carl_Larsson_-_Kr%C3%A4ftf%C3%A5ngst_-_Ett_hem_-_1899.tif
qid2predictionlist: no dataframe returned for Q18587363
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/9/90/Carl_Larsson_-_Bron_-_Ett_hem_-_1899.tif
qid2predictionlist: no dataframe returned for Q18587259
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/9/9d/Carl_Larsson_-_Gamla_Anna_-_Ett_hem_-_1899.tif
qid2predictionlist: no dataframe returned for Q18587385
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/6/6b/Carl_Larsson_-_Mellan_jul_och_ny%C3%A5r_-_Ett_hem_-_1899.tif
qid2predictionlist: no dataframe returned for Q18587393
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/6/6a/Carl_Larsson_-_Sundborns_gamla_kyrka_-_Ett_hem_-_1899.tif
qid2predictionlist: no dataframe returned for Q18587217
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/c/c5/Carl_Larsson_-_Matsalen_-_Ett_hem_-_1899.tiff
qid2predictionlist: no dataframe returned for Q18587379
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/8/81/Horse_and_Rider_%28Nils_Forsberg%29_-_Nationalmuseum_-_19664.tif
qid2predictionlist: no dataframe returned for Q18599407
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/6/6e/Lake_St._Cucuphat_%28Julia_Beck%29_-_Nationalmuseum_-_19672.tif
qid2predictionlist: no dataframe returned for Q18599409
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/6/61/Johan_Claes_Lagersv%C3%A4rd_%281756-1836%29_i_Florens_%28Louis_Gauffier%29_-_Nationalmuseum_-_96667.tif
qid2predictionlist: no dataframe returned for Q18601134
Q18601219 priming Commons cache exception: try  1 HTTP Error 429: Too Many Requests for https://upload.wikimedia.org/wikipedia/commons/thumb/c/cd/Allegory_with_self-portrait_and_profile_portrait_of_Ulrika_Eleonora_the_Elder_-_Nationalmuseum_-_132604.tif/1536px-Allegory%20with%20self-portrait%20and%20profile%20portrait%20of%20Ulrika%20Eleonora%20the%20Elder%20-%20Nationalmuseum%20-%20132604.tif.jpg
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/0/02/Carl_Larsson_-_G%C3%A5rden_och_Brygghuset_-_Ett_hem_-_1899.tif
qid2predictionlist: no dataframe returned for Q18587424
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/e/e1/Carl_Larsson_-_Atelj%C3%A9n%2C_andra_h%C3%A4lften_-_Ett_hem_-_1899.tif
qid2predictionlist: no dataframe returned for Q18587420
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/a/a8/Carl_Larsson_-_Friluftsatelj%C3%A9_-_Ett_hem_-_1899.tif
qid2predictionlist: no dataframe returned for Q18587429
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/2/2c/Selfportrait._Trompe_l%27oeil_%28Gottfrid_Virgin%29_-_Nationalmuseum_-_21738.tif
qid2predictionlist: no dataframe returned for Q18599723
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/a/ac/A_Fortified_Harbour_%28Peter_van_den_Velde%29_-_Nationalmuseum_-_17673.tif
qid2predictionlist: no dataframe returned for Q18601400
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/b/b7/Fredrik_Ulrik_Insenstierna%2C_1723-1768_%28Gustaf_Lundberg%29_-_Nationalmuseum_-_40056.tif
qid2predictionlist: no dataframe returned for Q18588290
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/3/3b/Gustav%2C_1683-1685%2C_prins_av_Sverige_%28Anna_Maria_Ehrenstrahl%29_-_Nationalmuseum_-_38876.tif
qid2predictionlist: no dataframe returned for Q18588533
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/2/2f/Fredrik_Ulrik_Wrangel_af_Sauss%2C_1853-1929_%28August_Franz%C3%A9n%29_-_Nationalmuseum_-_20075.tiff
qid2predictionlist: no dataframe returned for Q18588613
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/5/54/Landscape_with_Figures_and_Cattle_%28Jan_van_Kessel%29_-_Nationalmuseum_-_17741.tif
qid2predictionlist: no dataframe returned for Q18602103
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/3/39/Kristian_V_%281646-1699%29%2C_kung_av_Danmark_och_Norge%2C_gift_med_Charlotta_Amalia_av_Hessen-Kassel_-_Nationalmuseum_-_29073.tif
qid2predictionlist: no dataframe returned for Q43221107
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/9/95/The_Adoration_of_the_Magi_-_Nationalmuseum_-_17149.tif
qid2predictionlist: no dataframe returned for Q43221128
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/2/22/Gustaf_II_Adolf%2C_1594-1632%2C_kung_av_Sverige_-_Nationalmuseum_-_24003.tif
qid2predictionlist: no dataframe returned for Q43221171
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/8/82/Karl_XIII_%28Anton_Ulrik_Berndes%29_-_Nationalmuseum_-_24094.tif
qid2predictionlist: no dataframe returned for Q43221211
imageurl2predictiondf: imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/e/ee/Frederik_IV%2C_1671-1730%2C_kung_av_Danmark_och_Norge_-_Nationalmuseum_-_29074.tif
qid2predictionlist: no dataframe returned for Q43221216
error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/c/c1/Johan_Oxenstierna%2C_1611-1657_-_Nationalmuseum_-_15649.tif
qid2predictionlist: no dataframe returned for Q43221200
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/b/b3/Sofia_%281557-1631%29%2C_prinsessa_av_Mecklenburg%2C_drottning_av_Danmark_och_Norge_-_Nationalmuseum_-_29084.tif
qid2predictionlist: no dataframe returned for Q43221207
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/c/cd/Kristian_II_%281481-1559%29%2C_kung_av_Danmark%2C_Sverige_och_Norge%2C_gift_med_Elisabet_av_Kastilien_-_Nationalmuseum_-_29067.tif
qid2predictionlist: no dataframe returned for Q43221330
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/5/50/Maria_Amalia%2C1653-1711%2C_prinsessa_av_Kurland_lantgrevinna_av_Hessen-Kassel_-_Nationalmuseum_-_15543.tif
qid2predictionlist: no dataframe returned for Q43221383
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/9/97/Kristina_%281461-1521%29%2C_prinsessa_av_Sachsen%2C_drottning_av_Danmark%2C_Norge_och_Sverige_-_Nationalmuseum_-_38829.tif
qid2predictionlist: no dataframe returned for Q43221407
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/3/39/Ok%C3%A4nd_officer_%28Olof_Arenius%29_-_Nationalmuseum_-_25082.tif
qid2predictionlist: no dataframe returned for Q43221414
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/2/20/Anna_Maria%2C_1601-1666%2C_infantinna_av_Spanien%2C_gift_med_kung_Ludvig_XIII_av_Frankrike_-_Nationalmuseum_-_39300.tif
qid2predictionlist: no dataframe returned for Q43221417
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/b/b3/Kristoffer%2C_1515-1568%2C_hertig_av_W%C3%BCrtemberg_%28David_Frumerie%29_-_Nationalmuseum_-_15242.tif
qid2predictionlist: no dataframe returned for Q43219473
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/6/60/Fredrik_I%2C_1471-1533%2C_kung_av_Danmark_och_Norge_-_Nationalmuseum_-_16010.tif
qid2predictionlist: no dataframe returned for Q43219629
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/b/b9/Adolf_Fredrik%2C_1710-1771%2C_kung_av_Sverige%2C_hertig_av_Holstein-Gottorp_%28Johan_Georg_Henrichsen%29_-_Nationalmuseum_-_16135.tif
qid2predictionlist: no dataframe returned for Q43221479
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/e/e4/Georg_Wilhelm%2C_1722-82%2C_lantgreve_av_Hessen-Darmstadt_%28Friedrich_Jakob_Hill%29_-_Nationalmuseum_-_28448.tif
qid2predictionlist: no dataframe returned for Q43221553
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/0/03/Joseph_de_Bergaigne%2C_1587-1647%2C_%C3%A4rkebiskop_-_Nationalmuseum_-_15396.tif
qid2predictionlist: no dataframe returned for Q43219731
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/4/4e/Papegoja_%28David_Kock%29_-_Nationalmuseum_-_15297.tif
qid2predictionlist: no dataframe returned for Q43219777
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/e/ed/Fredrik_I_1676-1751%2C_kung_av_Sverige%2C_lantgreve_av_Hessen-Kassel_%28Herman_Hendrik_Quiter_d.y.%29_-_Nationalmuseum_-_16020.tif
qid2predictionlist: no dataframe returned for Q43219745
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/d/da/Friherre_Christian_Jakob_Gustav_Reuterholm_%281798-1810%29_%28Jonas_Emanuel_Roos_af_Hjelms%C3%A4ter%29_-_Nationalmuseum_-_39969.tif
qid2predictionlist: no dataframe returned for Q43221627
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/1/12/Ulrik_VI%2C_1487-1550%2C_hertig_av_W%C3%BCrtemberg_%28David_Frumerie%29_-_Nationalmuseum_-_15247.tif
qid2predictionlist: no dataframe returned for Q43219988
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/9/9d/Dorotea_%281511-1571%29%2C_prinsessa_av_Sachsen-Lauenburg%2C_drottning_av_Danmark_och_Norge_-_Nationalmuseum_-_29083.tif
qid2predictionlist: no dataframe returned for Q43221855
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/0/00/Drottning_Kristina_%281626-1689%29_%28Alexander_Cooper%29_-_Nationalmuseum_-_39994.tif
qid2predictionlist: no dataframe returned for Q43221949
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/e/ed/Ok%C3%A4nd_kvinna_%28Anton_Ulrik_Berndes%29_-_Nationalmuseum_-_24292.tif
qid2predictionlist: no dataframe returned for Q43220211
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/c/ce/Senecas_d%C3%B6d_%28Giovanni_Lanfranco%29_-_Nationalmuseum_-_14760.tif
qid2predictionlist: no dataframe returned for Q43220239
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/thumb/c/c7/Portrait_of_a_Girl_-_Nationalmuseum_-_17195.tif/1536px-Portrait%20of%20a%20Girl%20-%20Nationalmuseum%20-%2017195.tif.jpg
qid2predictionlist: no dataframe returned for Q43220077
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/d/dd/Rosentr%C3%A4d_i_en_kruka_%28David_von_C%C3%B6ln%29_-_Nationalmuseum_-_15305.tif
qid2predictionlist: no dataframe returned for Q43220365
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/9/9d/Adolf_Johan_d.y.%2C_1666-1701%2C_pfalzgreve_av_Zweibr%C3%BCcken%2C_prins_av_Stegeborg_-_Nationalmuseum_-_15770.tif
qid2predictionlist: no dataframe returned for Q43220418
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/4/47/Reinhard_Scheffer%2C_1590-1656_-_Nationalmuseum_-_15392.tif
qid2predictionlist: no dataframe returned for Q43220436
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/2/22/Henrik_Horn_af_Marienborg%2C_1618-1693_%28David_Kl%C3%B6cker_Ehrenstrahl%29_-_Nationalmuseum_-_15368.tif
qid2predictionlist: no dataframe returned for Q43223808
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/5/50/Karl_XII_och_hans_systrar_-_Nationalmuseum_-_16059.tif
qid2predictionlist: no dataframe returned for Q43223815
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/5/55/Filip_I%2C_1504-1567%2C_lantgreve_av_Hessen-Kassel_%28David_Frumerie%29_-_Nationalmuseum_-_15252.tif
qid2predictionlist: no dataframe returned for Q43256860
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/c/c6/Gustav_Adolf_Reuterholm%2C_1756-1813_%28Anton_Ulrik_Berndes%29_-_Nationalmuseum_-_38898.tif
qid2predictionlist: no dataframe returned for Q43256879
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/1/10/Brita_Johanna_av_Sill%C3%A9n%2C_1730-1807%2C_f%C3%B6dd_Lagerstam%2C_gift_med_kanslir%C3%A5det_Georg_Vilhelm_Sill%C3%A9n_-_Nationalmuseum_-_25220.tif
qid2predictionlist: no dataframe returned for Q43224507
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/b/be/Anna_Jablonowska%2C_gift_med_greve_Rafael_Leszczynsky_%28Johan_Starbus%29_-_Nationalmuseum_-_15152.tif
qid2predictionlist: no dataframe returned for Q43256882
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/4/45/Napoleon_I_Bonaparte%2C_1769-1821%2C_kejsare_av_Frankrike_-_Nationalmuseum_-_28697.tif
qid2predictionlist: no dataframe returned for Q43256944
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/8/8a/Vita_liljor_i_en_kruka_%28David_von_C%C3%B6ln%29_-_Nationalmuseum_-_15303.tif
qid2predictionlist: no dataframe returned for Q43256856
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/8/8e/Kristian_Albrekt%2C_hertig_%28Abraham_Wuchters%29_-_Nationalmuseum_-_38210.tif
qid2predictionlist: no dataframe returned for Q43257095
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/1/12/Ok%C3%A4nd_dam_%28Anton_Ulrik_Berndes%29_-_Nationalmuseum_-_24291.tif
qid2predictionlist: no dataframe returned for Q43256974
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/d/d9/Jean_Baptiste_Rousseau%2C_1671-1741_-_Nationalmuseum_-_16252.tif
qid2predictionlist: no dataframe returned for Q43257109
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/1/1d/Papegoja_%28David_Kock%29_-_Nationalmuseum_-_15304.tif
qid2predictionlist: no dataframe returned for Q43220638
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/b/bb/Didrik_Wrangel_af_Adinal%2C_1637-1706_%28David_Kl%C3%B6cker_Ehrenstrahl%29_-_Nationalmuseum_-_15356.tif
qid2predictionlist: no dataframe returned for Q43220647
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/5/5b/Jakob_Gyllenborg%2C_1648-1701_%28David_Kl%C3%B6cker_Ehrenstrahl%29_-_Nationalmuseum_-_15353.tif
qid2predictionlist: no dataframe returned for Q43220643
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/4/44/Carl_XIV_Johan%2C_1763-1844%2C_kung_av_Sverige_%28Jonas_Emanuel_Roos_af_Hjelms%C3%A4ter%29_-_Nationalmuseum_-_28676.tif
qid2predictionlist: no dataframe returned for Q43220686
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/6/6c/Wolfgang%2C_1526-1569%2C_pfalzgreve_av_Zweibr%C3%BCcken_-_Nationalmuseum_-_15248.tif
qid2predictionlist: no dataframe returned for Q43220681
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/5/5d/Charlotta_Amalia_%281650-1714%29%2C_prinsessa_av_Hessen-Kassel%2C_drottning_av_Danmark_och_Norge_-_Nationalmuseum_-_29087.tif
qid2predictionlist: no dataframe returned for Q43220687
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/1/15/Christian_VII_%281749-1808%29%2C_kung_av_Danmark%2C_gift_med_Karolina_Matilda_av_England_-_Nationalmuseum_-_29077.tif
qid2predictionlist: no dataframe returned for Q43224821
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/e/e6/Gustav_III%2C_1746-1792%2C_kung_av_Sverige_%28T._Xavery%29_-_Nationalmuseum_-_38880.tif
qid2predictionlist: no dataframe returned for Q43225045
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/5/54/Karl_X_Gustav%2C_1622-1660%2C_kung_av_Sverige%2C_pfalzgreve_av_Zweibr%C3%BCcken_-_Nationalmuseum_-_15977.tif
qid2predictionlist: no dataframe returned for Q43222935
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/7/72/Karolina_Kristina%2C_1699-1743%2C_prinsessa_av_Sachsen-Eisenach_-_Nationalmuseum_-_14686.tif
qid2predictionlist: no dataframe returned for Q43223058
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/c/c2/Karoline_Mathilde_%281751-1775%29%2C_prinsessa_av_England%2C_drottning_av_Danmark_och_Norge_-_Nationalmuseum_-_29093.tif
qid2predictionlist: no dataframe returned for Q43223135
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/b/b6/Claude_B%C3%A9nigne_Paul_Gouge_%281804-1877%29_%28Barbe_Edm%C3%A9e_Chardon%29_-_Nationalmuseum_-_133103.tif
qid2predictionlist: no dataframe returned for Q43257213
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/d/db/Johan_%28Jan%29_Henning_Gyllenborg%2C_1756-1830_%28Gustaf_Lundberg%29_-_Nationalmuseum_-_39533.tif
qid2predictionlist: no dataframe returned for Q43257326
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/4/4d/Gustav_Oxenstierna_af_Korsholm_och_Wasa%2C_1626-1694_%28David_Kl%C3%B6cker_Ehrenstrahl%29_-_Nationalmuseum_-_15373.tif
qid2predictionlist: no dataframe returned for Q43257364
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/d/df/Sofia_Charlotta%2C_1668-1705_%28David_von_Krafft%29_-_Nationalmuseum_-_15573.tif
qid2predictionlist: no dataframe returned for Q43220872
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/7/75/Johan_G%C3%B6ransson_Rosenhane%2C_1571-1624_-_Nationalmuseum_-_16003.tif
qid2predictionlist: no dataframe returned for Q43223216
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/a/ae/King_Kristian_I_of_Denmark%2C_Norway_and_Sweden_-_Nationalmuseum_-_29065.tif
qid2predictionlist: no dataframe returned for Q43223394
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/9/97/Hedvig_Ulrica_Taube_%281714-44%29_som_Diana%2C_riksgrevinna_von_Hessenstein_%28Gustaf_Torshell%29_-_Nationalmuseum_-_24754.tif
qid2predictionlist: no dataframe returned for Q43223431
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/d/db/Louise%2C_1667-1721_%281667-1721%29%2C_prinsessa_av_Mecklenburg-G%C3%BCstrow%2C_drottning_av_Danmark_och_Norge_-_Nationalmuseum_-_29088.tif
qid2predictionlist: no dataframe returned for Q43223439
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/f/f9/Fredrik_I%2C_prins_av_Hessen-Kassel_-_Nationalmuseum_-_14683.tif
qid2predictionlist: no dataframe returned for Q43223468
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/0/0b/Juliane-Marie_%281729-1796%29%2C_prinsessa_av_Braunschweig-Wolfenb%C3%BCttel%2C_drottning_av_Danmark_och_Norge_-_Nationalmuseum_-_29092.tif
qid2predictionlist: no dataframe returned for Q43220963
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/d/d7/Fredrik_Ludvig%2C_prins_av_Braunschweig-L%C3%BCneburg_%28Franzisco_Paletta%29_-_Nationalmuseum_-_14670.tif
qid2predictionlist: no dataframe returned for Q43220966
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/e/e5/Sofia_Amalia_%281628-1685%29%2C_prinsessa_av_Braunschweig-L%C3%BCneburg-Hannover%2C_drottning_av_Danmark_-_Nationalmuseum_-_29086.tif
qid2predictionlist: no dataframe returned for Q43225937
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/c/cb/Christoffer_Gyllenstierna_af_Ericsberg%2C_1639-1705_%28David_Kl%C3%B6cker_Ehrenstrahl%29_-_Nationalmuseum_-_15370.tif
qid2predictionlist: no dataframe returned for Q43226271
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/e/e6/Hans_%281455-1513%29%2C_kung_av_Danmark%2C_Norge_och_Sverige%2C_gift_med_Kristina_av_Sachsen_-_Nationalmuseum_-_29066.tif
qid2predictionlist: no dataframe returned for Q43223712
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/f/fe/Allegori%2C_Svea_%28Georg_Engelhard_Schr%C3%B6der%29_-_Nationalmuseum_-_16078.tif
qid2predictionlist: no dataframe returned for Q43226810
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/3/3c/Fredrik_prins_av_Sverige_allegori_%C3%B6ver_hans_d%C3%B6d_%28David_Kl%C3%B6cker_Ehrenstrahl%29_-_Nationalmuseum_-_15233.tif
qid2predictionlist: no dataframe returned for Q43227450
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/e/ef/Vibeke_Kruse_%28d%C3%B6d_1648%29%2C_m%C3%A4tress_till_Kristian_IV_av_Danmark_och_Norge_Andreas_Thornborg_-_Nationalmuseum_-_29095.tif
qid2predictionlist: no dataframe returned for Q43227901
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/1/1a/Maria_Elisabet%2C_prinsessa_av_Holstein-Gottorp_%28David_Kl%C3%B6cker_Ehrenstrahl%29_-_Nationalmuseum_-_14680.tif
qid2predictionlist: no dataframe returned for Q43227862
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/3/34/Johan_III_%281537-1592%29_I_f%C3%A4ngelset_med_sin_gem%C3%A5l_Katarina_Jagellonica%2C_prinsessa_av_Polen_-_Nationalmuseum_-_39519.tif
qid2predictionlist: no dataframe returned for Q43257756
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/9/94/Bengt_Horn_af_%C3%85minne%2C_1623-1678_%28David_Kock%29_-_Nationalmuseum_-_15360.tif
qid2predictionlist: no dataframe returned for Q43257922
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/2/2d/Anna_%281487-1514%29%2C_prinsessa_av_Brandenburg%2C_gift_med_Fredrik_I_av_Danmark%2C_Norge_och_Sverige_-_Nationalmuseum_-_29081.tif
qid2predictionlist: no dataframe returned for Q43257939
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/9/90/Papegoja_%28David_Kock%29_-_Nationalmuseum_-_15295.tif
qid2predictionlist: no dataframe returned for Q43228505
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/a/ad/Johannes_Schefferus%2C_1621-1679_%28Erik_Jetske%29_-_Nationalmuseum_-_15629.tif
qid2predictionlist: no dataframe returned for Q43229263
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/8/80/Gustav_II_Adolf%2C_1594-1632%2C_kung_av_Sverige_-_Nationalmuseum_-_25215.tif
qid2predictionlist: no dataframe returned for Q43229536
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/8/8b/Jakob_Johan_Hastfehr%2C_1647-1695_%28David_Kl%C3%B6cker_Ehrenstrahl%29_-_Nationalmuseum_-_15372.tif
qid2predictionlist: no dataframe returned for Q43230169
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/a/a7/Fredrik_Horn_af_%C3%85minne_%281725-96%29%2C_generalmajor%2C_greve_%28Niclas_Lafrensen_d.y.%29_-_Nationalmuseum_-_24676.tif
qid2predictionlist: no dataframe returned for Q43230511
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/9/94/Karl_I%2C_1713-1780_-_Nationalmuseum_-_28449.tif
qid2predictionlist: no dataframe returned for Q43247039
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/e/e0/Ok%C3%A4nd_gosse_%28Johanna_Emerentia_von_Bilang%29_-_Nationalmuseum_-_24301.tif
qid2predictionlist: no dataframe returned for Q43247344
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/7/73/Frederik_V%2C_1723-1766%2C_kung_av_Danmark_och_Norge_-_Nationalmuseum_-_29076.tif
qid2predictionlist: no dataframe returned for Q43247554
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/9/99/Kirsten_Munk_%281598-1658%29%2C_morganatiskt_gift_med_Kristian_IV_av_Danmark_och_Norge_-_Nationalmuseum_-_29094.tif
qid2predictionlist: no dataframe returned for Q43247678
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/c/ce/Gustav_%28III%29_som_barn_1746-1792_-_Nationalmuseum_-_28623.tif
qid2predictionlist: no dataframe returned for Q43249009
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/7/76/Kristian_VI_%281699-1746%29%2C_kung_av_Danmark_och_Norge_-_Nationalmuseum_-_29075.tif
qid2predictionlist: no dataframe returned for Q43256330
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/e/ea/Ulrika_Eleonora_d.y.%2C_1688-1741%2C_drottning_av_Sverige_%28David_von_Krafft%29_-_Nationalmuseum_-_16021.tif
qid2predictionlist: no dataframe returned for Q43256372
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/1/17/Georg%2C_1471-1539%2C_hertig_av_Sachsen_%28David_Frumerie%29_-_Nationalmuseum_-_15262.tif
qid2predictionlist: no dataframe returned for Q43256389
imageurl2predictiondf: error returned from Azure for https://upload.wikimedia.org/wikipedia/commons/6/64/Sofia_Magdalena_%281700-1770%29%2C_prinsessa_av_Brandenburg-Kulmbach%2C_drottning_av_Danmark_och_Norge_-_Nationalmuseum_-_29090.tif
qid2predictionlist: no dataframe returned for Q43256471
Elapsed Time (parallel threads): 880.0484008789062