import pywikibot
from pywikibot import pagegenerators as pg

site = pywikibot.Site("wikidata", "wikidata")
wikidata_site = site #compatibility stuff
repo = site.data_repository()    

def SPARQLPageCounter(query, site=None,
                                item_name='item', endpoint=None,
                                entity_url=None, result_type=set):
    #forcefully repurpose from WikidataSPARQLPageGenerator
    from pywikibot.data import sparql

    if site is None:
        site = pywikibot.Site()
    repo = site.data_repository()
    dependencies = {'endpoint': endpoint, 'entity_url': entity_url}
    if not endpoint or not entity_url:
        dependencies['repo'] = repo
    query_object = sparql.SparqlQuery(**dependencies)
    data = query_object.get_items(query,
                                  item_name=item_name,
                                  result_type=result_type)
    #items_pages = (pywikibot.ItemPage(repo, item) for item in data)
    #if isinstance(site, pywikibot.site.DataSite):
    #    return items_pages
    
    return len(data)

#pip install sparqlwrapper
#https://rdflib.github.io/sparqlwrapper/

import SPARQLWrapper
from SPARQLWrapper import SPARQLWrapper, JSON
sparql = SPARQLWrapper("https://query.wikidata.org/sparql")
sparql.setQuery("""SELECT DISTINCT ?property ?propertyLabel
WHERE
{
  ?prop pq:P794 ?asObject .
  hint:Query hint:optimizer "None" .	
  ?item ?p ?prop . 
  ?property wikibase:claim ?p .  
  ?property wikibase:statementProperty ?ps .
  ?prop ?ps ?value .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,bg"  }    
}
ORDER BY ASC(?property) 
LIMIT 1000""")
sparql.setReturnFormat(JSON)
results = sparql.query().convert()

print(len(results['results']['bindings']), 'properties found.')

migration_table = dict()

for result in results['results']['bindings']:

    property_uri = result['property']['value']
    property_label = result['propertyLabel']['value']

    base_uri, _, property_id = property_uri.rpartition('/') #repurposed from ItemPage.from_entity_uri

    property_query = """SELECT DISTINCT ?item
    WHERE
    {
      ?prop pq:P794 ?asObject .
      hint:Query hint:optimizer "None" .
      ?item ?p ?prop . 
      ?property wikibase:claim ?p .  
      ?property wikibase:statementProperty ?ps .
      ?prop ?ps ?value .
      wd:""" + property_id + """ wikibase:claim ?p .
      SERVICE wikibase:label { bd:serviceParam wikibase:language "en,yue,zh"  }    
    }
    ORDER BY ASC(?item) 
    LIMIT 10000"""

    num_of_items = SPARQLPageCounter(property_query, site=site)
    
    property_query = """SELECT DISTINCT ?item
    WHERE
    {
      ?prop pq:P794 ?item .
      hint:Query hint:optimizer "None" .
      ?mainitem ?p ?prop . 
      ?property wikibase:claim ?p .  
      ?property wikibase:statementProperty ?ps .
      ?prop ?ps ?value .
      wd:""" + property_id + """ wikibase:claim ?p .
      SERVICE wikibase:label { bd:serviceParam wikibase:language "en,yue,zh"  }    
    }
    ORDER BY ASC(?item) 
    LIMIT 1000"""

    num_of_targets = SPARQLPageCounter(property_query, site=site)
    
    print(property_id,  property_label, ':', num_of_items, 'items and', num_of_targets, 'targets')
    
    migration_table[property_id] = {'property_id': property_id, 
                                    'label': property_label, 
                                    'items': num_of_items,
                                    'targets': num_of_targets}
    
    
f = open('status_table.txt', 'w')
for k in migration_table:
    print('|-', file=f)
    print('| {{P|' + k + '}} ||', migration_table[k]['items'],
          '||', migration_table[k]['targets'], file=f)
f.close()

    
    
42 properties found.
P106 occupation : 31 items and 19 targets
P108 employer : 22 items and 19 targets
P123 publisher : 2 items and 2 targets
P127 owned by : 9 items and 9 targets
P137 operator : 36 items and 25 targets
P144 based on work : 3 items and 3 targets
P155 follows : 4 items and 5 targets
P157 killed by : 1 items and 3 targets
P166 award received : 102 items and 12 targets
P17 country : 15 items and 5 targets
P180 depicts : 55 items and 21 targets
P31 instance of : 59 items and 56 targets
P36 capital : 14 items and 7 targets
P37 official language : 45 items and 5 targets
P50 author : 7 items and 1 targets
P57 director : 1 items and 1 targets
P58 screenwriter : 1 items and 1 targets
P97 noble title : 2 items and 1 targets
P98 editor : 1 items and 1 targets
P1056 product or material produced : 6 items and 6 targets
P1092 total produced : 37 items and 12 targets
P1344 participant of : 1 items and 2 targets
P1376 capital of : 8 items and 5 targets
P1448 official name : 16 items and 23 targets
P1552 has quality : 3 items and 3 targets
P1598 consecrator : 30 items and 4 targets
P2031 work period (start) : 3 items and 4 targets
P2177 solubility : 2 items and 2 targets
P361 part of : 32 items and 16 targets
P371 presenter : 17 items and 4 targets
P463 member of : 40 items and 19 targets
P512 academic degree : 1 items and 1 targets
P527 has part : 50 items and 60 targets
P571 inception : 65 items and 82 targets
P576 dissolved, abolished or demolished : 5 items and 2 targets
P577 publication date : 28 items and 18 targets
P674 characters : 23 items and 11 targets
P710 participant : 2 items and 1 targets
P726 candidate : 4 items and 9 targets
P735 given name : 48 items and 8 targets
P921 main subject : 1 items and 1 targets
P941 inspired by : 35 items and 11 targets

Development notebooks below

#setup
query_filename = 'P794-status1.rq'

#script start
import pywikibot
from pywikibot import pagegenerators as pg

site = pywikibot.Site("wikidata", "wikidata")
wikidata_site = site #compatibility stuff
repo = site.data_repository()    

def getLabelFromObject(WDObject):
    item_dict = WDObject.get()
    item_label = False
    if 'labels' in item_dict:
        if 'en' in item_dict['labels']:
            item_label = item_dict['labels']['en']
    label = item_label
    if (label):
        return label
    else:
        return WDObject.getID()

def getLabelFromWDID(ID): #works for properties only. need separate function for items. why why why
    site = pywikibot.Site("wikidata", "wikidata")
    repo = site.data_repository()
    item = pywikibot.PropertyPage(repo, ID)
    return getLabelFromObject(item)

#pip install sparqlwrapper
#https://rdflib.github.io/sparqlwrapper/

import SPARQLWrapper
from SPARQLWrapper import SPARQLWrapper, JSON
sparql = SPARQLWrapper("https://query.wikidata.org/sparql")
sparql.setQuery("""SELECT DISTINCT ?property ?propertyLabel
WHERE
{
  ?prop pq:P794 ?asObject .
  hint:Query hint:optimizer "None" .	
  ?item ?p ?prop . 
  ?property wikibase:claim ?p .  
  ?property wikibase:statementProperty ?ps .
  ?prop ?ps ?value .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,bg"  }    
}
ORDER BY ASC(?property) 
LIMIT 1000""")
sparql.setReturnFormat(JSON)
results = sparql.query().convert()

for result in results["results"]["bindings"]:
    print(result)
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P106'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'occupation'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P108'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'employer'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P123'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'publisher'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P126'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'maintained by'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P127'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'owned by'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P129'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'physically interacts with'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P131'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'located in the administrative territorial entity'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P137'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'operator'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P138'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'named after'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P144'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'based on'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P155'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'follows'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P156'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'followed by'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P157'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'killed by'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P162'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'producer'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P166'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'award received'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P169'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'chief executive officer'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P17'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'country'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P170'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'creator'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P175'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'performer'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P176'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'manufacturer'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P179'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'series'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P18'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'image'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P180'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'depicts'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P184'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'doctoral advisor'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P20'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'place of death'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P21'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'sex or gender'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P210'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'party chief representative'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P241'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'military branch'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P31'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'instance of'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P36'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'capital'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P37'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'official language'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P50'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'author'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P57'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'director'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P58'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'screenwriter'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P69'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'educated at'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P86'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'composer'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P97'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'noble title'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P98'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'editor'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1037'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'manager/director'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1056'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'product or material produced'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1075'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'rector'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1092'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'total produced'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1100'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'number of cylinders'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1158'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'location of landing'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1216'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'National Heritage List for England number'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1308'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'officeholder'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1324'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'source code repository'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1340'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'eye color'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1346'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'winner'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1363'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'points/goal scored by'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1365'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'replaces'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1376'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'capital of'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1411'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'nominated for'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1412'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'languages spoken, written or signed'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1431'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'executive producer'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1433'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'published in'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1441'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'present in work'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1448'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'official name'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1476'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'title'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1552'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'has quality'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1598'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'consecrator'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1619'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'date of official opening'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1787'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'art-name'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P1884'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'hair color'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P2031'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'work period (start)'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P2032'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'work period (end)'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P2043'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'length'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P2048'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'height'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P2049'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'width'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P2052'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'speed'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P2073'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'vehicle range'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P2101'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'melting point'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P2102'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'boiling point'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P2107'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'decomposition point'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P2109'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'installed capacity'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P2119'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'vapor pressure'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P2128'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'flash point'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P2177'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'solubility'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P2425'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'service ribbon image'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P279'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'subclass of'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P2802'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'fleet or registration number'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P286'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'head coach'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P2868'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'subject has role'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P289'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'vessel class'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P2987'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'Taekwondo Data ID'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P3092'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'film crew member'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P361'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'part of'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P366'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'use'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P371'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'presenter'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P3922'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'light sector'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P410'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'military rank'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P426'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'aircraft registration'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P457'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'foundational text'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P463'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'member of'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P488'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'chairperson'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P509'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'cause of death'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P512'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'academic degree'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P520'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'armament'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P527'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'has part'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P542'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'officially opened by'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P570'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'date of death'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P571'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'inception'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P576'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'dissolved, abolished or demolished'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P577'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'publication date'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P580'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'start time'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P582'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'end time'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P585'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'point in time'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P607'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'conflict'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P620'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'time of spacecraft landing'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P622'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'spacecraft docking/undocking date'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P674'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'characters'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P710'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'participant'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P726'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'candidate'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P729'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'service entry'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P730'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'service retirement'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P734'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'family name'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P735'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'given name'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P742'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'pseudonym'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P800'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'notable work'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P802'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'student'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P823'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'speaker'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P856'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'official website'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P921'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'main subject'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P937'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'work location'}}
{'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P941'}, 'propertyLabel': {'xml:lang': 'en', 'type': 'literal', 'value': 'inspired by'}}
dict(results)
{'head': {'vars': ['property', 'propertyLabel']},
 'results': {'bindings': [{'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P102'},
    'propertyLabel': {'type': 'literal',
     'value': 'member of political party',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P106'},
    'propertyLabel': {'type': 'literal',
     'value': 'occupation',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P108'},
    'propertyLabel': {'type': 'literal',
     'value': 'employer',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P110'},
    'propertyLabel': {'type': 'literal',
     'value': 'illustrator',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P112'},
    'propertyLabel': {'type': 'literal',
     'value': 'founded by',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P121'},
    'propertyLabel': {'type': 'literal',
     'value': 'item operated',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P122'},
    'propertyLabel': {'type': 'literal',
     'value': 'basic form of government',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P123'},
    'propertyLabel': {'type': 'literal',
     'value': 'publisher',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P126'},
    'propertyLabel': {'type': 'literal',
     'value': 'maintained by',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P127'},
    'propertyLabel': {'type': 'literal',
     'value': 'owned by',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P128'},
    'propertyLabel': {'type': 'literal',
     'value': 'regulates (molecular biology)',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P129'},
    'propertyLabel': {'type': 'literal',
     'value': 'physically interacts with',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P131'},
    'propertyLabel': {'type': 'literal',
     'value': 'located in the administrative territorial entity',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P135'},
    'propertyLabel': {'type': 'literal',
     'value': 'movement',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P137'},
    'propertyLabel': {'type': 'literal',
     'value': 'operator',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P138'},
    'propertyLabel': {'type': 'literal',
     'value': 'named after',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P144'},
    'propertyLabel': {'type': 'literal',
     'value': 'based on',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P150'},
    'propertyLabel': {'type': 'literal',
     'value': 'contains administrative territorial entity',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P154'},
    'propertyLabel': {'type': 'literal',
     'value': 'logo image',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P155'},
    'propertyLabel': {'type': 'literal',
     'value': 'follows',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P156'},
    'propertyLabel': {'type': 'literal',
     'value': 'followed by',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P157'},
    'propertyLabel': {'type': 'literal',
     'value': 'killed by',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P162'},
    'propertyLabel': {'type': 'literal',
     'value': 'producer',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P166'},
    'propertyLabel': {'type': 'literal',
     'value': 'award received',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P169'},
    'propertyLabel': {'type': 'literal',
     'value': 'chief executive officer',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P17'},
    'propertyLabel': {'type': 'literal',
     'value': 'country',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P170'},
    'propertyLabel': {'type': 'literal',
     'value': 'creator',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P172'},
    'propertyLabel': {'type': 'literal',
     'value': 'ethnic group',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P175'},
    'propertyLabel': {'type': 'literal',
     'value': 'performer',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P176'},
    'propertyLabel': {'type': 'literal',
     'value': 'manufacturer',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P178'},
    'propertyLabel': {'type': 'literal',
     'value': 'developer',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P179'},
    'propertyLabel': {'type': 'literal', 'value': 'series', 'xml:lang': 'en'}},
   {'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P18'},
    'propertyLabel': {'type': 'literal', 'value': 'image', 'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P180'},
    'propertyLabel': {'type': 'literal',
     'value': 'depicts',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P184'},
    'propertyLabel': {'type': 'literal',
     'value': 'doctoral advisor',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P186'},
    'propertyLabel': {'type': 'literal',
     'value': 'material used',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P19'},
    'propertyLabel': {'type': 'literal',
     'value': 'place of birth',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P20'},
    'propertyLabel': {'type': 'literal',
     'value': 'place of death',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P21'},
    'propertyLabel': {'type': 'literal',
     'value': 'sex or gender',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P210'},
    'propertyLabel': {'type': 'literal',
     'value': 'party chief representative',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P217'},
    'propertyLabel': {'type': 'literal',
     'value': 'inventory number',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P241'},
    'propertyLabel': {'type': 'literal',
     'value': 'military branch',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P27'},
    'propertyLabel': {'type': 'literal',
     'value': 'country of citizenship',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P31'},
    'propertyLabel': {'type': 'literal',
     'value': 'instance of',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P35'},
    'propertyLabel': {'type': 'literal',
     'value': 'head of state',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P36'},
    'propertyLabel': {'type': 'literal',
     'value': 'capital',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P37'},
    'propertyLabel': {'type': 'literal',
     'value': 'official language',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P38'},
    'propertyLabel': {'type': 'literal',
     'value': 'currency',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P40'},
    'propertyLabel': {'type': 'literal', 'value': 'child', 'xml:lang': 'en'}},
   {'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P50'},
    'propertyLabel': {'type': 'literal', 'value': 'author', 'xml:lang': 'en'}},
   {'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P54'},
    'propertyLabel': {'type': 'literal',
     'value': 'member of sports team',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P57'},
    'propertyLabel': {'type': 'literal',
     'value': 'director',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P58'},
    'propertyLabel': {'type': 'literal',
     'value': 'screenwriter',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P6'},
    'propertyLabel': {'type': 'literal',
     'value': 'head of government',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P61'},
    'propertyLabel': {'type': 'literal',
     'value': 'discoverer or inventor',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P69'},
    'propertyLabel': {'type': 'literal',
     'value': 'educated at',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P84'},
    'propertyLabel': {'type': 'literal',
     'value': 'architect',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P86'},
    'propertyLabel': {'type': 'literal',
     'value': 'composer',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P92'},
    'propertyLabel': {'type': 'literal',
     'value': 'main regulatory text',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P97'},
    'propertyLabel': {'type': 'literal',
     'value': 'noble title',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri', 'value': 'http://www.wikidata.org/entity/P98'},
    'propertyLabel': {'type': 'literal', 'value': 'editor', 'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1037'},
    'propertyLabel': {'type': 'literal',
     'value': 'manager/director',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1040'},
    'propertyLabel': {'type': 'literal',
     'value': 'film editor',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1056'},
    'propertyLabel': {'type': 'literal',
     'value': 'product or material produced',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1066'},
    'propertyLabel': {'type': 'literal',
     'value': 'student of',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1075'},
    'propertyLabel': {'type': 'literal', 'value': 'rector', 'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1092'},
    'propertyLabel': {'type': 'literal',
     'value': 'total produced',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1100'},
    'propertyLabel': {'type': 'literal',
     'value': 'number of cylinders',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1113'},
    'propertyLabel': {'type': 'literal',
     'value': 'number of episodes',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1114'},
    'propertyLabel': {'type': 'literal',
     'value': 'quantity',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1120'},
    'propertyLabel': {'type': 'literal',
     'value': 'number of deaths',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1132'},
    'propertyLabel': {'type': 'literal',
     'value': 'number of participants',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1158'},
    'propertyLabel': {'type': 'literal',
     'value': 'location of landing',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1191'},
    'propertyLabel': {'type': 'literal',
     'value': 'first performance',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1196'},
    'propertyLabel': {'type': 'literal',
     'value': 'manner of death',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1216'},
    'propertyLabel': {'type': 'literal',
     'value': 'National Heritage List for England number',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1249'},
    'propertyLabel': {'type': 'literal',
     'value': 'time of earliest written record',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1303'},
    'propertyLabel': {'type': 'literal',
     'value': 'instrument',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1308'},
    'propertyLabel': {'type': 'literal',
     'value': 'officeholder',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1317'},
    'propertyLabel': {'type': 'literal',
     'value': 'floruit',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1324'},
    'propertyLabel': {'type': 'literal',
     'value': 'source code repository',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1327'},
    'propertyLabel': {'type': 'literal',
     'value': 'professional or sports partner',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1339'},
    'propertyLabel': {'type': 'literal',
     'value': 'number of injured',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1340'},
    'propertyLabel': {'type': 'literal',
     'value': 'eye color',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1346'},
    'propertyLabel': {'type': 'literal', 'value': 'winner', 'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1363'},
    'propertyLabel': {'type': 'literal',
     'value': 'points/goal scored by',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1365'},
    'propertyLabel': {'type': 'literal',
     'value': 'replaces',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1366'},
    'propertyLabel': {'type': 'literal',
     'value': 'replaced by',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1376'},
    'propertyLabel': {'type': 'literal',
     'value': 'capital of',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1393'},
    'propertyLabel': {'type': 'literal', 'value': 'proxy', 'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1399'},
    'propertyLabel': {'type': 'literal',
     'value': 'convicted of',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1411'},
    'propertyLabel': {'type': 'literal',
     'value': 'nominated for',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1412'},
    'propertyLabel': {'type': 'literal',
     'value': 'languages spoken, written or signed',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1416'},
    'propertyLabel': {'type': 'literal',
     'value': 'affiliation',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1431'},
    'propertyLabel': {'type': 'literal',
     'value': 'executive producer',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1433'},
    'propertyLabel': {'type': 'literal',
     'value': 'published in',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1441'},
    'propertyLabel': {'type': 'literal',
     'value': 'present in work',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1448'},
    'propertyLabel': {'type': 'literal',
     'value': 'official name',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1455'},
    'propertyLabel': {'type': 'literal',
     'value': 'list of works',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1476'},
    'propertyLabel': {'type': 'literal', 'value': 'title', 'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1535'},
    'propertyLabel': {'type': 'literal',
     'value': 'used by',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1542'},
    'propertyLabel': {'type': 'literal',
     'value': 'has effect',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1552'},
    'propertyLabel': {'type': 'literal',
     'value': 'has quality',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1557'},
    'propertyLabel': {'type': 'literal',
     'value': 'manifestation of',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1559'},
    'propertyLabel': {'type': 'literal',
     'value': 'name in native language',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1594'},
    'propertyLabel': {'type': 'literal', 'value': 'judge', 'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1598'},
    'propertyLabel': {'type': 'literal',
     'value': 'consecrator',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1619'},
    'propertyLabel': {'type': 'literal',
     'value': 'date of official opening',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1629'},
    'propertyLabel': {'type': 'literal',
     'value': 'subject item of this property',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1659'},
    'propertyLabel': {'type': 'literal',
     'value': 'see also',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1787'},
    'propertyLabel': {'type': 'literal',
     'value': 'art-name',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1830'},
    'propertyLabel': {'type': 'literal',
     'value': 'owner of',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1840'},
    'propertyLabel': {'type': 'literal',
     'value': 'investigated by',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1875'},
    'propertyLabel': {'type': 'literal',
     'value': 'represented by',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1876'},
    'propertyLabel': {'type': 'literal', 'value': 'vessel', 'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1884'},
    'propertyLabel': {'type': 'literal',
     'value': 'hair color',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1885'},
    'propertyLabel': {'type': 'literal',
     'value': 'cathedral',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1889'},
    'propertyLabel': {'type': 'literal',
     'value': 'different from',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1896'},
    'propertyLabel': {'type': 'literal',
     'value': 'source website for the property',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1906'},
    'propertyLabel': {'type': 'literal',
     'value': 'office held by head of state',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P1923'},
    'propertyLabel': {'type': 'literal',
     'value': 'participating teams',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2031'},
    'propertyLabel': {'type': 'literal',
     'value': 'work period (start)',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2032'},
    'propertyLabel': {'type': 'literal',
     'value': 'work period (end)',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2043'},
    'propertyLabel': {'type': 'literal', 'value': 'length', 'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2044'},
    'propertyLabel': {'type': 'literal',
     'value': 'elevation above sea level',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2046'},
    'propertyLabel': {'type': 'literal', 'value': 'area', 'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2047'},
    'propertyLabel': {'type': 'literal',
     'value': 'duration',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2048'},
    'propertyLabel': {'type': 'literal', 'value': 'height', 'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2049'},
    'propertyLabel': {'type': 'literal', 'value': 'width', 'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2052'},
    'propertyLabel': {'type': 'literal', 'value': 'speed', 'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2073'},
    'propertyLabel': {'type': 'literal',
     'value': 'vehicle range',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2101'},
    'propertyLabel': {'type': 'literal',
     'value': 'melting point',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2102'},
    'propertyLabel': {'type': 'literal',
     'value': 'boiling point',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2107'},
    'propertyLabel': {'type': 'literal',
     'value': 'decomposition point',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2109'},
    'propertyLabel': {'type': 'literal',
     'value': 'installed capacity',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2119'},
    'propertyLabel': {'type': 'literal',
     'value': 'vapor pressure',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2128'},
    'propertyLabel': {'type': 'literal',
     'value': 'flash point',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2129'},
    'propertyLabel': {'type': 'literal', 'value': 'IDLH', 'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2144'},
    'propertyLabel': {'type': 'literal',
     'value': 'frequency',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2177'},
    'propertyLabel': {'type': 'literal',
     'value': 'solubility',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2223'},
    'propertyLabel': {'type': 'literal',
     'value': 'decay width',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2238'},
    'propertyLabel': {'type': 'literal',
     'value': 'official symbol',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2283'},
    'propertyLabel': {'type': 'literal', 'value': 'uses', 'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2425'},
    'propertyLabel': {'type': 'literal',
     'value': 'service ribbon image',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2522'},
    'propertyLabel': {'type': 'literal',
     'value': 'victory',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2610'},
    'propertyLabel': {'type': 'literal',
     'value': 'thickness',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2652'},
    'propertyLabel': {'type': 'literal',
     'value': 'partnership with',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2670'},
    'propertyLabel': {'type': 'literal',
     'value': 'has parts of the class',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2699'},
    'propertyLabel': {'type': 'literal', 'value': 'URL', 'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P276'},
    'propertyLabel': {'type': 'literal',
     'value': 'location',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P279'},
    'propertyLabel': {'type': 'literal',
     'value': 'subclass of',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2791'},
    'propertyLabel': {'type': 'literal',
     'value': 'power consumed',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2797'},
    'propertyLabel': {'type': 'literal',
     'value': 'sound power level',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2802'},
    'propertyLabel': {'type': 'literal',
     'value': 'fleet or registration number',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P286'},
    'propertyLabel': {'type': 'literal',
     'value': 'head coach',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2860'},
    'propertyLabel': {'type': 'literal', 'value': 'cites', 'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2868'},
    'propertyLabel': {'type': 'literal',
     'value': 'subject has role',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P287'},
    'propertyLabel': {'type': 'literal',
     'value': 'designed by',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2884'},
    'propertyLabel': {'type': 'literal',
     'value': 'mains voltage',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P289'},
    'propertyLabel': {'type': 'literal',
     'value': 'vessel class',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2929'},
    'propertyLabel': {'type': 'literal',
     'value': 'lighthouse range',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2935'},
    'propertyLabel': {'type': 'literal',
     'value': 'connector',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P2987'},
    'propertyLabel': {'type': 'literal',
     'value': 'Taekwondo Data ID',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P3092'},
    'propertyLabel': {'type': 'literal',
     'value': 'film crew member',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P3093'},
    'propertyLabel': {'type': 'literal',
     'value': 'recovered by',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P3275'},
    'propertyLabel': {'type': 'literal',
     'value': 'storyboard artist',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P3349'},
    'propertyLabel': {'type': 'literal',
     'value': 'designed to carry',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P3438'},
    'propertyLabel': {'type': 'literal',
     'value': 'vehicle normally used',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P355'},
    'propertyLabel': {'type': 'literal',
     'value': 'subsidiary',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P360'},
    'propertyLabel': {'type': 'literal',
     'value': 'is a list of',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P361'},
    'propertyLabel': {'type': 'literal',
     'value': 'part of',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P364'},
    'propertyLabel': {'type': 'literal',
     'value': 'original language of work',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P366'},
    'propertyLabel': {'type': 'literal', 'value': 'use', 'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P3701'},
    'propertyLabel': {'type': 'literal',
     'value': 'incarnation of',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P371'},
    'propertyLabel': {'type': 'literal',
     'value': 'presenter',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P3922'},
    'propertyLabel': {'type': 'literal',
     'value': 'light sector',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P3977'},
    'propertyLabel': {'type': 'literal',
     'value': 'Songkick venue ID',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P3990'},
    'propertyLabel': {'type': 'literal',
     'value': 'BG EKATTE place ID',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P407'},
    'propertyLabel': {'type': 'literal',
     'value': 'language of work or name',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P410'},
    'propertyLabel': {'type': 'literal',
     'value': 'military rank',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P424'},
    'propertyLabel': {'type': 'literal',
     'value': 'Wikimedia language code',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P425'},
    'propertyLabel': {'type': 'literal',
     'value': 'field of this occupation',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P426'},
    'propertyLabel': {'type': 'literal',
     'value': 'aircraft registration',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P4501'},
    'propertyLabel': {'type': 'literal', 'value': 'albedo', 'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P451'},
    'propertyLabel': {'type': 'literal',
     'value': 'unmarried partner',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P457'},
    'propertyLabel': {'type': 'literal',
     'value': 'foundational text',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P460'},
    'propertyLabel': {'type': 'literal',
     'value': 'said to be the same as',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P463'},
    'propertyLabel': {'type': 'literal',
     'value': 'member of',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P466'},
    'propertyLabel': {'type': 'literal',
     'value': 'occupant',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P485'},
    'propertyLabel': {'type': 'literal',
     'value': 'archives at',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P488'},
    'propertyLabel': {'type': 'literal',
     'value': 'chairperson',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P509'},
    'propertyLabel': {'type': 'literal',
     'value': 'cause of death',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P512'},
    'propertyLabel': {'type': 'literal',
     'value': 'academic degree',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P520'},
    'propertyLabel': {'type': 'literal',
     'value': 'armament',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P527'},
    'propertyLabel': {'type': 'literal',
     'value': 'has part',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P541'},
    'propertyLabel': {'type': 'literal',
     'value': 'office contested',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P542'},
    'propertyLabel': {'type': 'literal',
     'value': 'officially opened by',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P552'},
    'propertyLabel': {'type': 'literal',
     'value': 'handedness',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P570'},
    'propertyLabel': {'type': 'literal',
     'value': 'date of death',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P571'},
    'propertyLabel': {'type': 'literal',
     'value': 'inception',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P576'},
    'propertyLabel': {'type': 'literal',
     'value': 'dissolved, abolished or demolished',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P577'},
    'propertyLabel': {'type': 'literal',
     'value': 'publication date',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P580'},
    'propertyLabel': {'type': 'literal',
     'value': 'start time',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P582'},
    'propertyLabel': {'type': 'literal',
     'value': 'end time',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P585'},
    'propertyLabel': {'type': 'literal',
     'value': 'point in time',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P607'},
    'propertyLabel': {'type': 'literal',
     'value': 'conflict',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P620'},
    'propertyLabel': {'type': 'literal',
     'value': 'time of spacecraft landing',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P622'},
    'propertyLabel': {'type': 'literal',
     'value': 'spacecraft docking/undocking date',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P641'},
    'propertyLabel': {'type': 'literal', 'value': 'sport', 'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P655'},
    'propertyLabel': {'type': 'literal',
     'value': 'translator',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P658'},
    'propertyLabel': {'type': 'literal',
     'value': 'tracklist',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P664'},
    'propertyLabel': {'type': 'literal',
     'value': 'organizer',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P674'},
    'propertyLabel': {'type': 'literal',
     'value': 'characters',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P710'},
    'propertyLabel': {'type': 'literal',
     'value': 'participant',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P726'},
    'propertyLabel': {'type': 'literal',
     'value': 'candidate',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P729'},
    'propertyLabel': {'type': 'literal',
     'value': 'service entry',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P730'},
    'propertyLabel': {'type': 'literal',
     'value': 'service retirement',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P734'},
    'propertyLabel': {'type': 'literal',
     'value': 'family name',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P735'},
    'propertyLabel': {'type': 'literal',
     'value': 'given name',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P742'},
    'propertyLabel': {'type': 'literal',
     'value': 'pseudonym',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P746'},
    'propertyLabel': {'type': 'literal',
     'value': 'date of disappearance',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P767'},
    'propertyLabel': {'type': 'literal',
     'value': 'contributor(s) to the subject',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P770'},
    'propertyLabel': {'type': 'literal',
     'value': 'cause of destruction',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P790'},
    'propertyLabel': {'type': 'literal',
     'value': 'approved by',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P793'},
    'propertyLabel': {'type': 'literal',
     'value': 'significant event',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P797'},
    'propertyLabel': {'type': 'literal',
     'value': 'authority',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P800'},
    'propertyLabel': {'type': 'literal',
     'value': 'notable work',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P802'},
    'propertyLabel': {'type': 'literal',
     'value': 'student',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P823'},
    'propertyLabel': {'type': 'literal',
     'value': 'speaker',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P856'},
    'propertyLabel': {'type': 'literal',
     'value': 'official website',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P921'},
    'propertyLabel': {'type': 'literal',
     'value': 'main subject',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P937'},
    'propertyLabel': {'type': 'literal',
     'value': 'work location',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P941'},
    'propertyLabel': {'type': 'literal',
     'value': 'inspired by',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P953'},
    'propertyLabel': {'type': 'literal',
     'value': 'full work available at',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P967'},
    'propertyLabel': {'type': 'literal',
     'value': 'guest of honor',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P973'},
    'propertyLabel': {'type': 'literal',
     'value': 'described at URL',
     'xml:lang': 'en'}},
   {'property': {'type': 'uri',
     'value': 'http://www.wikidata.org/entity/P991'},
    'propertyLabel': {'type': 'literal',
     'value': 'successful candidate',
     'xml:lang': 'en'}}]}}
#for result in results['results']['bindings']:

property_uri = result['property']['value']
property_label = result['propertyLabel']['value']

base_uri, _, property_id = property_uri.rpartition('/') #repurposed from ItemPage.from_entity_uri
property_id
'P991'
property_query = """SELECT DISTINCT ?item ?asObject
WHERE
{
  ?prop pq:P794 ?asObject .
  hint:Query hint:optimizer "None" .
  ?item ?p ?prop . 
  ?property wikibase:claim ?p .  
  ?property wikibase:statementProperty ?ps .
  ?prop ?ps ?value .
  wd:""" + property_id + """ wikibase:claim ?p .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,yue,zh"  }    
}
ORDER BY ASC(?item) 
LIMIT 1000"""

property_query
'SELECT DISTINCT ?item ?asObject\nWHERE\n{\n  ?prop pq:P794 ?asObject .\n  hint:Query hint:optimizer "None" .\n  ?item ?p ?prop . \n  ?property wikibase:claim ?p .  \n  ?property wikibase:statementProperty ?ps .\n  ?prop ?ps ?value .\n  wd:P991 wikibase:claim ?p .\n  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,yue,zh"  }    \n}\nORDER BY ASC(?item) \nLIMIT 1000'
def SPARQLPageCounter(query, site=None,
                                item_name='item', endpoint=None,
                                entity_url=None, result_type=set):
    #forcefully repurpose from WikidataSPARQLPageGenerator
    from pywikibot.data import sparql

    if site is None:
        site = pywikibot.Site()
    repo = site.data_repository()
    dependencies = {'endpoint': endpoint, 'entity_url': entity_url}
    if not endpoint or not entity_url:
        dependencies['repo'] = repo
    query_object = sparql.SparqlQuery(**dependencies)
    data = query_object.get_items(query,
                                  item_name=item_name,
                                  result_type=result_type)
    #items_pages = (pywikibot.ItemPage(repo, item) for item in data)
    #if isinstance(site, pywikibot.site.DataSite):
    #    return items_pages
    
    return len(data)

length = SPARQLPageCounter(property_query, site=site)
length
1

I can also extract what was called the "asObject" above. I just need to mess with what's called "item".

property_query = """SELECT DISTINCT ?item
    WHERE
    {
      ?prop pq:P794 ?item .
      hint:Query hint:optimizer "None" .
      ?mainitem ?p ?prop . 
      ?property wikibase:claim ?p .  
      ?property wikibase:statementProperty ?ps .
      ?prop ?ps ?value .
      wd:P128 wikibase:claim ?p .
      SERVICE wikibase:label { bd:serviceParam wikibase:language "en,yue,zh"  }    
    }
    ORDER BY ASC(?item) 
    LIMIT 1000"""

length = SPARQLPageCounter(property_query, site=site)
length
2

Put it all together

import pywikibot
from pywikibot import pagegenerators as pg

site = pywikibot.Site("wikidata", "wikidata")
wikidata_site = site #compatibility stuff
repo = site.data_repository()    

def SPARQLPageCounter(query, site=None,
                                item_name='item', endpoint=None,
                                entity_url=None, result_type=set):
    #forcefully repurpose from WikidataSPARQLPageGenerator
    from pywikibot.data import sparql

    if site is None:
        site = pywikibot.Site()
    repo = site.data_repository()
    dependencies = {'endpoint': endpoint, 'entity_url': entity_url}
    if not endpoint or not entity_url:
        dependencies['repo'] = repo
    query_object = sparql.SparqlQuery(**dependencies)
    data = query_object.get_items(query,
                                  item_name=item_name,
                                  result_type=result_type)
    #items_pages = (pywikibot.ItemPage(repo, item) for item in data)
    #if isinstance(site, pywikibot.site.DataSite):
    #    return items_pages
    
    return len(data)

#pip install sparqlwrapper
#https://rdflib.github.io/sparqlwrapper/

prop = 'P1480'

import SPARQLWrapper
from SPARQLWrapper import SPARQLWrapper, JSON
sparql = SPARQLWrapper("https://query.wikidata.org/sparql")
sparql.setQuery("""SELECT DISTINCT ?property ?propertyLabel
WHERE
{
  ?prop pq:""" + prop + """ ?asObject .
  hint:Query hint:optimizer "None" .	
  ?item ?p ?prop . 
  ?property wikibase:claim ?p .  
  ?property wikibase:statementProperty ?ps .
  ?prop ?ps ?value .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,yue,zh"  }    
}
ORDER BY ASC(?property) 
LIMIT 1000""")
sparql.setReturnFormat(JSON)
results = sparql.query().convert()

print(len(results['results']['bindings']), 'properties found.')

migration_table = dict()

for result in results['results']['bindings']:

    property_uri = result['property']['value']
    property_label = result['propertyLabel']['value']

    base_uri, _, property_id = property_uri.rpartition('/') #repurposed from ItemPage.from_entity_uri

    property_query = """SELECT DISTINCT ?item
    WHERE
    {
      ?prop pq:""" + prop + """ ?asObject .
      hint:Query hint:optimizer "None" .
      ?item ?p ?prop . 
      ?property wikibase:claim ?p .  
      ?property wikibase:statementProperty ?ps .
      ?prop ?ps ?value .
      wd:""" + property_id + """ wikibase:claim ?p .
      SERVICE wikibase:label { bd:serviceParam wikibase:language "en,yue,zh"  }    
    }
    ORDER BY ASC(?item) 
    LIMIT 10000"""

    num_of_items = SPARQLPageCounter(property_query, site=site)
    
    property_query = """SELECT DISTINCT ?item
    WHERE
    {
      ?prop pq:""" + prop + """ ?item .
      hint:Query hint:optimizer "None" .
      ?mainitem ?p ?prop . 
      ?property wikibase:claim ?p .  
      ?property wikibase:statementProperty ?ps .
      ?prop ?ps ?value .
      wd:""" + property_id + """ wikibase:claim ?p .
      SERVICE wikibase:label { bd:serviceParam wikibase:language "en,yue,zh"  }    
    }
    ORDER BY ASC(?item) 
    LIMIT 1000"""

    num_of_targets = SPARQLPageCounter(property_query, site=site)
    
    print(property_id,  property_label, ':', num_of_items, 'items and', num_of_targets, 'targets')
    
    migration_table[property_id] = {'property_id': property_id, 
                                    'label': property_label, 
                                    'items': num_of_items,
                                    'targets': num_of_targets}
    
    


    
    
257 properties found.
P102 member of political party : 3 items and 2 targets
P106 occupation : 19 items and 4 targets
P108 employer : 14 items and 4 targets
P112 founded by : 4 items and 1 targets
P119 place of burial : 11 items and 4 targets
P121 item operated : 4 items and 1 targets
P123 publisher : 6 items and 2 targets
P127 owned by : 18 items and 6 targets
P129 physically interacts with : 1 items and 1 targets
P131 located in the administrative territorial entity : 5 items and 4 targets
P136 genre : 4 items and 1 targets
P138 named after : 12 items and 4 targets
P140 religion : 1 items and 1 targets
P144 based on : 1 items and 1 targets
P149 architectural style : 1 items and 1 targets
P159 headquarters location : 4 items and 4 targets
P161 cast member : 1 items and 1 targets
P166 award received : 2 items and 2 targets
P17 country : 3 items and 1 targets
P170 creator : 345 items and 6 targets
P171 parent taxon : 3 items and 1 targets
P176 manufacturer : 1 items and 1 targets
P18 image : 15 items and 2 targets
P180 depicts : 54 items and 6 targets
P186 material used : 10 items and 3 targets
P189 location of discovery : 12 items and 4 targets
P19 place of birth : 223 items and 9 targets
P195 collection : 1 items and 1 targets
P196 minor planet group : 6 items and 1 targets
P20 place of death : 133 items and 8 targets
P21 sex or gender : 6 items and 2 targets
P217 inventory number : 1 items and 2 targets
P22 father : 34 items and 8 targets
P241 military branch : 1 items and 1 targets
P25 mother : 12 items and 2 targets
P26 spouse : 13 items and 3 targets
P27 country of citizenship : 13 items and 2 targets
P31 instance of : 510 items and 8 targets
P36 capital : 2 items and 2 targets
P39 position held : 13 items and 8 targets
P40 child : 22 items and 3 targets
P50 author : 5 items and 2 targets
P57 director : 2 items and 1 targets
P6 head of government : 1 items and 1 targets
P61 discoverer or inventor : 3 items and 3 targets
P69 educated at : 7 items and 3 targets
P84 architect : 20 items and 4 targets
P86 composer : 3 items and 3 targets
P88 commissioned by : 11 items and 2 targets
P98 editor : 1 items and 1 targets
P1014 AAT ID : 315 items and 1 targets
P1027 conferred by : 1 items and 1 targets
P1034 main food source : 2 items and 1 targets
P1037 manager/director : 1 items and 1 targets
P1038 relative : 7 items and 2 targets
P1050 medical condition : 3 items and 3 targets
P1056 product or material produced : 1 items and 1 targets
P1065 archive URL : 1 items and 1 targets
P1066 student of : 33 items and 4 targets
P1071 location of final assembly : 4 items and 2 targets
P1073 writable file format : 1 items and 1 targets
P1082 population : 61 items and 2 targets
P1083 maximum capacity : 7 items and 3 targets
P1090 redshift : 45 items and 1 targets
P1092 total produced : 9 items and 1 targets
P1096 orbital eccentricity : 1 items and 1 targets
P1098 number of speakers : 30 items and 1 targets
P1114 quantity : 36 items and 1 targets
P1120 number of deaths : 8 items and 2 targets
P1128 employees : 68 items and 3 targets
P1132 number of participants : 2 items and 2 targets
P1174 visitors per year : 4 items and 1 targets
P1191 date of first performance : 1 items and 1 targets
P1193 prevalence : 1 items and 2 targets
P1196 manner of death : 4 items and 1 targets
P1249 time of earliest written record : 6 items and 2 targets
P1299 depicted by : 2 items and 1 targets
P1317 floruit : 207 items and 3 targets
P1319 earliest date : 2 items and 2 targets
P1326 latest date : 2 items and 1 targets
P1327 professional or sports partner : 5 items and 2 targets
P1336 territory claimed by : 1 items and 1 targets
P1339 number of injured : 6 items and 1 targets
P1345 number of victims made by killer : 1 items and 1 targets
P1373 daily patronage : 2 items and 1 targets
P1394 Glottolog code : 1 items and 1 targets
P1412 languages spoken, written or signed : 2 items and 1 targets
P1419 shape : 1 items and 1 targets
P1435 heritage designation : 2 items and 2 targets
P1436 collection or exhibition size : 12 items and 3 targets
P1476 title : 2 items and 2 targets
P1477 birth name : 12 items and 1 targets
P1479 has contributing factor : 3 items and 1 targets
P1531 parent(s) of this hybrid : 2 items and 1 targets
P1535 used by : 2 items and 2 targets
P1552 has quality : 6 items and 2 targets
P1557 manifestation of : 1 items and 1 targets
P1590 number of casualties : 2 items and 2 targets
P1599 Cambridge Alumni Database ID : 2 items and 1 targets
P1619 date of official opening : 4 items and 4 targets
P1621 detail map : 1 items and 1 targets
P1636 date of baptism in early childhood : 27 items and 1 targets
P1647 subproperty of : 2 items and 1 targets
P1684 inscription : 1 items and 1 targets
P1773 attributed to : 1 items and 1 targets
P1830 owner of : 2 items and 1 targets
P1853 blood type : 1 items and 1 targets
P1855 Wikidata property example : 2 items and 2 targets
P1877 after a work by : 13 items and 1 targets
P1884 hair color : 3 items and 2 targets
P1889 different from : 1 items and 1 targets
P1962 patron : 2 items and 2 targets
P1963 properties for this type : 4 items and 1 targets
P1971 number of children : 1 items and 1 targets
P2031 work period (start) : 430 items and 3 targets
P2032 work period (end) : 125 items and 4 targets
P2042 Artsy artist ID : 1 items and 1 targets
P2043 length : 78 items and 1 targets
P2044 elevation above sea level : 57 items and 1 targets
P2046 area : 90 items and 3 targets
P2047 duration : 44 items and 1 targets
P2048 height : 21 items and 1 targets
P2049 width : 10 items and 2 targets
P2053 watershed area : 4 items and 1 targets
P2054 density : 1 items and 1 targets
P2060 luminosity : 1 items and 1 targets
P2067 mass : 15 items and 1 targets
P2073 vehicle range : 2 items and 1 targets
P2079 fabrication method : 1 items and 1 targets
P2093 author name string : 1 items and 1 targets
P2101 melting point : 2 items and 1 targets
P2102 boiling point : 1 items and 1 targets
P2107 decomposition point : 4 items and 1 targets
P2120 radius : 2 items and 1 targets
P2124 member count : 25 items and 1 targets
P2130 cost : 27 items and 3 targets
P2139 total revenue : 22 items and 3 targets
P2142 box office : 3 items and 1 targets
P2146 orbital period : 4 items and 1 targets
P2196 students count : 48 items and 1 targets
P2201 electric dipole moment : 1 items and 1 targets
P2218 net worth estimate : 2 items and 1 targets
P2225 discharge : 1 items and 1 targets
P2250 life expectancy : 1 items and 1 targets
P2257 frequency of event : 1 items and 1 targets
P2283 uses : 8 items and 1 targets
P2295 net profit : 13 items and 2 targets
P2348 time period : 4 items and 1 targets
P2350 SpeedSkatingBase.eu ID : 8 items and 2 targets
P2351 number of graves : 10 items and 1 targets
P2355 UNESCO Atlas of the World's Languages in Danger ID : 2 items and 1 targets
P2370 conversion to SI unit : 4 items and 1 targets
P2386 diameter : 3 items and 1 targets
P2403 total assets : 1 items and 1 targets
P2421 Prosopographia Attica : 1 items and 1 targets
P2442 conversion to standard unit : 2 items and 1 targets
P2453 nominee : 1 items and 1 targets
P2462 member of the deme : 5 items and 1 targets
P2547 perimeter : 4 items and 1 targets
P2596 culture : 2 items and 2 targets
P2645 mean lifetime : 2 items and 1 targets
P2660 topographic prominence : 1 items and 1 targets
P2664 units sold : 1 items and 1 targets
P2667 corresponding template : 1 items and 1 targets
P2670 has parts of the class : 1 items and 1 targets
P2754 production date : 1 items and 1 targets
P276 location : 457 items and 4 targets
P2769 budget : 3 items and 1 targets
P279 subclass of : 47 items and 1 targets
P2849 produced by : 1 items and 1 targets
P2896 publication interval : 1 items and 1 targets
P291 place of publication : 6 items and 2 targets
P2913 date depicted : 1 items and 1 targets
P2945 British Book Trade Index ID : 1 items and 1 targets
P2974 habitat : 1 items and 1 targets
P3078 standard enthalpy of formation : 1 items and 1 targets
P3082 destroyed : 1 items and 1 targets
P3092 film crew member : 1 items and 1 targets
P3113 does not have part : 1 items and 1 targets
P3248 OKP ID of the good or service : 1 items and 1 targets
P3311 plan image : 1 items and 1 targets
P3362 operating income : 11 items and 1 targets
P3373 sibling : 13 items and 1 targets
P3437 people or cargo transported : 3 items and 1 targets
P360 is a list of : 1 items and 1 targets
P361 part of : 5 items and 1 targets
P366 use : 10 items and 1 targets
P3716 social classification : 2 items and 1 targets
P373 Commons category : 1 items and 1 targets
P3740 number of works : 1 items and 1 targets
P3782 Artnet artist ID : 1 items and 1 targets
P3832 Europeana Fashion Vocabulary ID : 206 items and 1 targets
P3872 patronage : 1 items and 1 targets
P3886 number of perpetrators : 1 items and 1 targets
P3916 UNESCO Thesaurus ID : 1 items and 1 targets
P3921 Wikidata SPARQL query equivalent : 1 items and 1 targets
P3999 date of official closure : 1 items and 1 targets
P4000 has fruit type : 8 items and 1 targets
P412 voice type : 1 items and 1 targets
P4129 Cinema Treasures ID : 1 items and 1 targets
P425 field of this occupation : 1 items and 1 targets
P4330 contains : 1 items and 1 targets
P4341 synodic period : 1 items and 1 targets
P437 distribution : 1 items and 1 targets
P4426 Y-DNA Haplogroup : 1 items and 1 targets
P451 partner : 2 items and 1 targets
P4511 vertical depth : 1 items and 1 targets
P460 said to be the same as : 8 items and 3 targets
P462 color : 2 items and 1 targets
P463 member of : 6 items and 1 targets
P466 occupant : 2 items and 1 targets
P488 chairperson : 1 items and 2 targets
P4909 number of players in region : 2 items and 1 targets
P495 country of origin : 9 items and 3 targets
P5061 unit symbol : 1 items and 1 targets
P509 cause of death : 11 items and 2 targets
P527 has part : 6 items and 2 targets
P528 catalog code : 2 items and 2 targets
P533 target : 1 items and 1 targets
P551 residence : 34 items and 5 targets
P558 unit symbol (DEPRECATED) : 1 items and 1 targets
P569 date of birth : 9441 items and 72 targets
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-6-ecb7fbc06470> in <module>()
     95     LIMIT 1000"""
     96 
---> 97     num_of_targets = SPARQLPageCounter(property_query, site=site)
     98 
     99     print(property_id,  property_label, ':', num_of_items, 'items and', num_of_targets, 'targets')

<ipython-input-6-ecb7fbc06470> in SPARQLPageCounter(query, site, item_name, endpoint, entity_url, result_type)
     21     data = query_object.get_items(query,
     22                                   item_name=item_name,
---> 23                                   result_type=result_type)
     24     #items_pages = (pywikibot.ItemPage(repo, item) for item in data)
     25     #if isinstance(site, pywikibot.site.DataSite):

/srv/paws/pwb/pywikibot/data/sparql.py in get_items(self, query, item_name, result_type)
    192         res = self.select(query, full_data=True)
    193         if res:
--> 194             return result_type(r[item_name].getID() for r in res)
    195         return result_type()
    196 

/srv/paws/pwb/pywikibot/data/sparql.py in <genexpr>(.0)
    192         res = self.select(query, full_data=True)
    193         if res:
--> 194             return result_type(r[item_name].getID() for r in res)
    195         return result_type()
    196 

AttributeError: 'Bnode' object has no attribute 'getID'
for k in migration_table:
    print('|-')
    print('| {{P|' + k + '}} ||', migration_table[k]['items'],
          '||', migration_table[k]['targets'])
|-
| {{P|P102}} || 6 || 4
|-
| {{P|P106}} || 28 || 14
|-
| {{P|P108}} || 136 || 91
|-
| {{P|P123}} || 3 || 3
|-
| {{P|P127}} || 4 || 2
|-
| {{P|P128}} || 6477 || 2
|-
| {{P|P129}} || 1354 || 13
|-
| {{P|P131}} || 6 || 6
|-
| {{P|P135}} || 1 || 1
|-
| {{P|P136}} || 1 || 1
|-
| {{P|P137}} || 19 || 4
|-
| {{P|P138}} || 2 || 2
|-
| {{P|P144}} || 6 || 1
|-
| {{P|P155}} || 4 || 6
|-
| {{P|P157}} || 3 || 4
|-
| {{P|P161}} || 5 || 11
|-
| {{P|P162}} || 5 || 4
|-
| {{P|P166}} || 17 || 13
|-
| {{P|P17}} || 1 || 1
|-
| {{P|P170}} || 6 || 8
|-
| {{P|P175}} || 18 || 17
|-
| {{P|P178}} || 1 || 2
|-
| {{P|P179}} || 2 || 2
|-
| {{P|P18}} || 6 || 5
|-
| {{P|P180}} || 3 || 3
|-
| {{P|P184}} || 1 || 2
|-
| {{P|P19}} || 2 || 2
|-
| {{P|P190}} || 3 || 2
|-
| {{P|P195}} || 1479 || 1
|-
| {{P|P20}} || 2 || 2
|-
| {{P|P241}} || 5 || 4
|-
| {{P|P31}} || 23 || 9
|-
| {{P|P35}} || 1 || 1
|-
| {{P|P36}} || 1 || 1
|-
| {{P|P37}} || 1 || 1
|-
| {{P|P38}} || 1 || 2
|-
| {{P|P39}} || 249 || 37
|-
| {{P|P50}} || 20 || 15
|-
| {{P|P53}} || 1 || 1
|-
| {{P|P54}} || 9 || 3
|-
| {{P|P57}} || 4 || 1
|-
| {{P|P58}} || 3 || 2
|-
| {{P|P6}} || 2 || 3
|-
| {{P|P69}} || 9 || 10
|-
| {{P|P84}} || 1 || 1
|-
| {{P|P86}} || 1 || 1
|-
| {{P|P88}} || 3 || 1
|-
| {{P|P97}} || 1 || 1
|-
| {{P|P98}} || 5 || 3
|-
| {{P|P1029}} || 253 || 23
|-
| {{P|P1037}} || 2 || 2
|-
| {{P|P1066}} || 55 || 5
|-
| {{P|P1071}} || 1 || 1
|-
| {{P|P1120}} || 1 || 3
|-
| {{P|P1132}} || 2 || 3
|-
| {{P|P1196}} || 1 || 1
|-
| {{P|P1216}} || 4 || 3
|-
| {{P|P1249}} || 1 || 1
|-
| {{P|P1299}} || 1 || 1
|-
| {{P|P1303}} || 1 || 1
|-
| {{P|P1308}} || 1 || 1
|-
| {{P|P1317}} || 1 || 1
|-
| {{P|P1327}} || 5 || 1
|-
| {{P|P1343}} || 1 || 1
|-
| {{P|P1344}} || 75 || 51
|-
| {{P|P1365}} || 7 || 4
|-
| {{P|P1366}} || 3 || 3
|-
| {{P|P1376}} || 6 || 3
|-
| {{P|P1411}} || 7 || 4
|-
| {{P|P1416}} || 36 || 17
|-
| {{P|P1433}} || 18 || 6
f = open('status_table.txt', 'w')
for k in migration_table:
    print('|-', file=f)
    print('| {{P|' + k + '}} ||', migration_table[k]['items'],
          '||', migration_table[k]['targets'], file=f)
f.close()
sparql.setQuery("""SELECT (COUNT(DISTINCT ?item) as ?itemCount) (COUNT(DISTINCT ?asObject) as ?asObjectCount)
WHERE
{
     ?prop pq:P1480 ?asObject .
     hint:Query hint:optimizer "None" .
     ?item ?p ?prop . 
     ?property wikibase:claim ?p .  
     ?property wikibase:statementProperty ?ps .
     ?prop ?ps ?value .
     wd:P569 wikibase:claim ?p .
     SERVICE wikibase:label { bd:serviceParam wikibase:language "en,yue,zh"  }    
}
ORDER BY ASC(?item) 
LIMIT 10000""")
sparql.setReturnFormat(JSON)
results = sparql.query().convert()
print(results['results']['bindings'][0]['asObjectCount']['value'])

print(results['results']['bindings'][0]['itemCount']['value'])
72
9442

Make this more concise...

import pywikibot
from pywikibot import pagegenerators as pg

site = pywikibot.Site("wikidata", "wikidata")
wikidata_site = site #compatibility stuff
repo = site.data_repository()    

def SPARQLPageCounter(query, site=None,
                                item_name='item', endpoint=None,
                                entity_url=None, result_type=set):
    #forcefully repurpose from WikidataSPARQLPageGenerator
    from pywikibot.data import sparql

    if site is None:
        site = pywikibot.Site()
    repo = site.data_repository()
    dependencies = {'endpoint': endpoint, 'entity_url': entity_url}
    if not endpoint or not entity_url:
        dependencies['repo'] = repo
    query_object = sparql.SparqlQuery(**dependencies)
    data = query_object.get_items(query,
                                  item_name=item_name,
                                  result_type=result_type)
    #items_pages = (pywikibot.ItemPage(repo, item) for item in data)
    #if isinstance(site, pywikibot.site.DataSite):
    #    return items_pages
    
    return len(data)

#pip install sparqlwrapper
#https://rdflib.github.io/sparqlwrapper/

prop = 'P31'

import SPARQLWrapper
from SPARQLWrapper import SPARQLWrapper, JSON
sparql = SPARQLWrapper("https://query.wikidata.org/sparql")
sparql.setQuery("""SELECT DISTINCT ?property ?propertyLabel
WHERE
{
  ?prop pq:""" + prop + """ ?asObject .
  hint:Query hint:optimizer "None" .	
  ?item ?p ?prop . 
  ?property wikibase:claim ?p .  
  ?property wikibase:statementProperty ?ps .
  ?prop ?ps ?value .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,yue,zh"  }    
}
ORDER BY ASC(?property) 
LIMIT 1000""")
sparql.setReturnFormat(JSON)
results = sparql.query().convert()

print(len(results['results']['bindings']), 'properties found.')

migration_table = dict()

for result in results['results']['bindings']:
    
    property_uri = result['property']['value']
    property_label = result['propertyLabel']['value']
    
    base_uri, _, property_id = property_uri.rpartition('/') #repurposed from ItemPage.from_entity_uri
    
    sparql.setQuery("""SELECT (COUNT(DISTINCT ?item) as ?itemCount) (COUNT(DISTINCT ?asObject) as ?asObjectCount)
WHERE
{
     ?prop pq:""" + prop + """ ?asObject .
     hint:Query hint:optimizer "None" .
     ?item ?p ?prop . 
     ?property wikibase:claim ?p .  
     ?property wikibase:statementProperty ?ps .
     ?prop ?ps ?value .
     wd:""" + property_id + """ wikibase:claim ?p .
     SERVICE wikibase:label { bd:serviceParam wikibase:language "en,yue,zh"  }    
}
ORDER BY ASC(?item) 
LIMIT 10000""")
    sparql.setReturnFormat(JSON)
    subresults = sparql.query().convert()
    
    num_of_targets = subresults['results']['bindings'][0]['asObjectCount']['value']
    num_of_items = subresults['results']['bindings'][0]['itemCount']['value']
    
    print(property_id,  property_label, ':', num_of_items, 'items and', num_of_targets, 'targets')
    
    migration_table[property_id] = {'property_id': property_id, 
                                    'label': property_label, 
                                    'items': num_of_items,
                                    'targets': num_of_targets}
    
    


    
    
---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
/srv/paws/lib/python3.6/site-packages/SPARQLWrapper/Wrapper.py in _query(self)
    765             else:
--> 766                 response = urlopener(request)
    767             return response, self.returnFormat

/usr/lib/python3.6/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)
    222         opener = _opener
--> 223     return opener.open(url, data, timeout)
    224 

/usr/lib/python3.6/urllib/request.py in open(self, fullurl, data, timeout)
    531             meth = getattr(processor, meth_name)
--> 532             response = meth(req, response)
    533 

/usr/lib/python3.6/urllib/request.py in http_response(self, request, response)
    641             response = self.parent.error(
--> 642                 'http', request, response, code, msg, hdrs)
    643 

/usr/lib/python3.6/urllib/request.py in error(self, proto, *args)
    569             args = (dict, 'default', 'http_error_default') + orig_args
--> 570             return self._call_chain(*args)
    571 

/usr/lib/python3.6/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args)
    503             func = getattr(handler, meth_name)
--> 504             result = func(*args)
    505             if result is not None:

/usr/lib/python3.6/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs)
    649     def http_error_default(self, req, fp, code, msg, hdrs):
--> 650         raise HTTPError(req.full_url, code, msg, hdrs, fp)
    651 

HTTPError: HTTP Error 500: Server Error

During handling of the above exception, another exception occurred:

EndPointInternalError                     Traceback (most recent call last)
<ipython-input-40-1a4a5a17624d> in <module>()
     50 LIMIT 1000""")
     51 sparql.setReturnFormat(JSON)
---> 52 results = sparql.query().convert()
     53 
     54 print(len(results['results']['bindings']), 'properties found.')

/srv/paws/lib/python3.6/site-packages/SPARQLWrapper/Wrapper.py in query(self)
    796             @rtype: L{QueryResult} instance
    797         """
--> 798         return QueryResult(self._query())
    799 
    800     def queryAndConvert(self):

/srv/paws/lib/python3.6/site-packages/SPARQLWrapper/Wrapper.py in _query(self)
    774                 raise Unauthorized(e.read())
    775             elif e.code == 500:
--> 776                 raise EndPointInternalError(e.read())
    777             else:
    778                 raise e

EndPointInternalError: EndPointInternalError: endpoint returned code 500 and response. 

Response:
b'SPARQL-QUERY: queryStr=SELECT DISTINCT ?property ?propertyLabel\nWHERE\n{\n  ?prop pq:P31 ?asObject .\n  hint:Query hint:optimizer "None" .\t\n  ?item ?p ?prop . \n  ?property wikibase:claim ?p .  \n  ?property wikibase:statementProperty ?ps .\n  ?prop ?ps ?value .\n  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,yue,zh"  }    \n}\nORDER BY ASC(?property) \nLIMIT 1000\njava.util.concurrent.TimeoutException\n\tat java.util.concurrent.FutureTask.get(FutureTask.java:205)\n\tat com.bigdata.rdf.sail.webapp.BigdataServlet.submitApiTask(BigdataServlet.java:293)\n\tat com.bigdata.rdf.sail.webapp.QueryServlet.doSparqlQuery(QueryServlet.java:654)\n\tat com.bigdata.rdf.sail.webapp.QueryServlet.doGet(QueryServlet.java:288)\n\tat com.bigdata.rdf.sail.webapp.RESTServlet.doGet(RESTServlet.java:240)\n\tat com.bigdata.rdf.sail.webapp.MultiTenancyServlet.doGet(MultiTenancyServlet.java:271)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:687)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:790)\n\tat org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:769)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1667)\n\tat org.wikidata.query.rdf.blazegraph.throttling.ThrottlingFilter.doFilter(ThrottlingFilter.java:297)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)\n\tat ch.qos.logback.classic.helpers.MDCInsertingServletFilter.doFilter(MDCInsertingServletFilter.java:49)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)\n\tat org.wikidata.query.rdf.blazegraph.filters.ClientIPFilter.doFilter(ClientIPFilter.java:43)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\n\tat org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)\n\tat org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)\n\tat org.eclipse.jetty.server.Server.handle(Server.java:497)\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)\n\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248)\n\tat org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:610)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:539)\n\tat java.lang.Thread.run(Thread.java:748)\n'