Paintings in Wikidata

Interesting queries

import urllib.parse
from IPython.display import IFrame
baseurl='https://query.wikidata.org/embed.html#'

def wdq(query='',width=800,height=500):
  return IFrame(baseurl+urllib.parse.quote(query), width=width, height=height)

Most linked to paintings

wdq("""
# Paintings with the most sitelinks in Wikidata
SELECT DISTINCT ?item ?itemLabel ?linkcount ?inception ?creator ?img 
WHERE 
{
  ?item wdt:P31 wd:Q3305213 .
  ?item wdt:P571 ?inception .
  ?item wikibase:sitelinks ?linkcount .
  OPTIONAL { ?item wdt:P170 ?creator } .
  OPTIONAL { ?item wdt:P18 ?img } .
  FILTER(?linkcount > 24)
  #  FILTER(?inception > "1000-05-23T10:20:13+05:30"^^xsd:dateTime)

  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY DESC(?linkcount)
""")

Most represented artists in CMA dataset

Which artists are most represented in CMA's holdings in Wikidata? Photographer Carl Robert Pope, Japanese artist Aoki Shukuya and Russian jeweler Peter Carl Fabergé.

wdq(width=1000,height=800,query="""
#defaultView:BubbleChart
# Show histogram of creators for all artworks that match GLAM entity
SELECT ?q ?qLabel (COUNT(?q) as ?count) WHERE {
    # Replace with the GLAM institution
    BIND (wd:Q657415 AS ?institution)
    ?item p:P217 [ps:P217 ?id; pq:P195 ?institution] .
    ?item wdt:P170 ?q . # Creators
    FILTER NOT EXISTS { ?item wdt:P170 wd:Q4233718 } # Filter out anonymous
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} 
GROUP BY ?q ?qLabel
ORDER BY DESC (?count)
LIMIT 30
""")