query: SELECT ?painter ?paintername ?otherpainter ?collection ?propertylink ?mixurl (COUNT(?painter) as ?count) (SAMPLE(?item) as ?item) WHERE {
    ?property wikibase:propertyType wikibase:ExternalId . 
    { ?property wdt:P31 wd:Q19595382 . ?property wdt:P31 wd:Q27918607 } UNION { ?property wdt:P31 wd:Q55653847 } 
    ?property wikibase:claim ?propertyclaim .
    ?property wdt:P126 ?collection .
    ?property wdt:P2378 ?collection  .
    ?collectionstatement ps:P195 ?collection .
    ?item p:P195 ?collectionstatement .
    MINUS { ?collectionstatement pq:P582 [] } 
    ?item wdt:P31 wd:Q3305213 . 
    ?item wdt:P170 ?painter . 
    ?painter wdt:P106 wd:Q1028181
    MINUS { ?painter ?propertyclaim [] }
    OPTIONAL {
      ?painter rdfs:label ?paintername .
      FILTER (lang(?paintername) = "en") .
      BIND(CONCAT("[https://tools.wmflabs.org/mix-n-match/#/search/", REPLACE(STR(?paintername), " ", "%20"), " search in Mix'n'match]") AS ?mixurl)  .
    }
    BIND(CONCAT("[[Property:P", REPLACE(STR(?property), "http://www.wikidata.org/entity/P", ""), "|P", REPLACE(STR(?PROPERTY), "HTTP://WWW.WIKIDATA.ORG/ENTITY/P", ""), "&#32;<small dir="ltr">(P", REPLACE(STR(?property), "http://www.wikidata.org/entity/P", ""), ")</small>]]") AS ?propertylink)  .
    OPTIONAL {
      ?painter wdt:P1889 ?otherpainter . 
      ?otherpainter ?propertyclaim [] .
    }
  } GROUP BY ?painter ?paintername ?otherpainter ?collection ?propertylink ?mixurl
  ORDER BY ?paintername