Showing posts with label Wikidata Queries. Show all posts
Showing posts with label Wikidata Queries. Show all posts

Jan 9, 2025

Wikidata Queries and AI LLMs: better dataviz with ChatGPT4O

Paintings owned by family and business connections to Presidents of the Swiss Art Dealers Association





The above graph, generated by a Wikidata query, can be made easier to understand with help from AI.

Steps:

1. Run Wikidata query: 

Short link to Wikidata Query: 

https://w.wiki/Cdse

2. Download  CSV from Wikidata Query 











3.  Upload into ChatGPT4o with the following prompt:

"please graph - pay attention to edges"




Here is a graph representing the relationships between Swiss Art Dealer Association Presidents, their business or family connections, and associated paintings. The edges are labeled to indicate the type of connection, and node colors differentiate between SwissArtpres (blue), connections (green), and paintings (orange). Let me know if you'd like further adjustments



chatGPT40 : "Here is the updated graph with adjusted label positions to minimize overlap. Labels are placed with a background for clarity, and the spacing between nodes has been increased to make the connections easier to read. Let me know if you need further refinements! "



Aug 21, 2024

Art Market Network Analysis with Wikidata Sparql Queries and Beyond

 

What might replicable data pipeline from #Wikidata #KG Query to Data Frame to Network Visualisation of owners of artworks passing through a specific network look like?

In the example below, we look at 27 artworks that passed through one of the members of the Perls art dealing dynasty or one of their companies.

The starting point is a Wikdata Query to retrieve the artworks known to have been owned by one of the Perls family, as well as the other known owners of the same artworks.

The information is retrieved from Wikidata, loaded into a Data Frame, then visualised with MatPlotLib.

The code is saved in a Jupyter Notebook and Shared publicly via Google Colab.

Anyone with a Google Account should be able to run the code simply by clicking on the arrows to the left of each code cell.

Try it and let me know if it works.

https://colab.research.google.com/drive/1f7V2SMzxkCmt2lbCS3l4ulotqUGghNAm#scrollTo=0sPcg-gWZOo3

Perls Family Network-Red
Links to other owners-Blue
Jupyter Notebook in Google CoLabs

Apr 30, 2020

Tracing Jewish Art Collectors and other #LostArtPeople by Place of Death

In our previous post, we introduced the idea of using Wikidata Queries to Trace Jewish art collectors and their collections.


In this post, we begin to look at how we might identify these Jewish individuals, many of whom have been not only forgotten but deliberately written out of history. 


What information or feature might help us to identify them?
What do we know about them?


  • They died after 1932 
  • They were connected to the arts in some way: as collectors, dealers, curators, historians, curators, museum directors, gallery owners, possibly as artists
  • Their names might have appeared in exhibitions or catalogs as owners or lenders or donors or experts, or in books or articles as authors, in the provenance texts of collections, for example.



The above criteria is very large and not specific to Jewish collectors in the Nazi era.  How can we further narrow the criteria? One element that distinguishes the fates of Jewish individuals from others is how and where they died, and whether or not they were interned, spoliated or became refugees. 

What kind of markers can we look for in the data?


  • Place of death
  • Year of death
  • Cause of death
  • Place of internment
  • Significant events like aryanization or arrest or deportation


All of the above correspond to "Properties" that are defined in Wikidata. Not all these properties have been updated for every Wikidata item. But they could be. 


A Wikidata Query can easily show us all the people who are known (in Wikidata) to have died or been interned in a Nazi camp or ghetto.


How to do this?

There were so many Nazi camps in so many countries (see below) that we look for a way to take each one into account without necessarily naming each one in a query.

One way is to use Wikidata's "instance of" (P31).

We can tell the query to list people who died in a place that is defined as any of the following things:


  • Nazi concentration camp (Q328468)
  • concentration camp (Q152081)
  • extermination camp (Q153813)
  • ghetto in Nazi-occupied Europe (Q2583015)


We might still miss a few of the camps (due to the crowdsourcing nature of Wikidata, not every item is coded in exactly the same way,) but this should be a good start.

There are several ways to do OR type queries in Wikidata.

We will use the very straight forward UNION. (Please do not hesitate to suggest better ways).

WHERE {
{ ?placedied wdt:P31 wd:Q328468.} UNION { ?placedied wdt:P31 wd:Q152081. } UNION { ?placedied wdt:P31 wd:Q153813.} UNION { ?placediedwdt:P31 wd:Q153813.} UNION { ?placedied wdt:P31 wd:Q2583015.}


To make the Wikidata query run faster and avoid time outs, we will first check that the place of death has been entered by someone into Wikidata.


?item wdt:P20 ?placedied.

Then, instead of specifying, as we did in the previous query, that we want to list the people who died in the specific Nazi concentration camp of Auschwitz-Birkenau


  ?item wdt:P20 wd:Q7341.  

we want to request people who died in any place coded as an instance of Q328468, Q152081, Q153813 or Q2583015


{ ?placedied wdt:P31 wd:Q328468.} UNION { ?placedied wdt:P31 wd:Q152081. } UNION { ?placedied wdt:P31 wd:Q153813.} UNION { ?placedied wdt:P31 wd:Q153813.} UNION { ?placedied wdt:P31 wd:Q2583015.}

This should include all the Nazi camps and ghettos listed at the bottom of this post

_______


SELECT DISTINCT ?item ?itemLabel ?pic ?datedied ?placediedLabel ?placedied ?child ?childLabel ?ownedby ?ownedbyLabel ?depicts ?depictsLabel ?depictedby ?depictedbyLabel ?countryLabel ?ownerof ?ownerofLabel ?spouse ?employer ?employerLabel ?spouseLabel ?mother ?motherLabel ?father ?fatherLabel ?sibling ?siblingLabel ?investby ?investbyLabel ?sigperson ?sigpersonLabel ?party ?partyLabel ?partner ?partnerLabel WHERE {
{ ?item wdt:P106 wd:Q1792450.} UNION { ?item wdt:P31 wd:Q1007870. } UNION { ?item wdt:P106 wd:Q173950.} UNION { ?item wdt:P921 wd:Q328376.} UNION { ?item wdt:P106 wd:Q10732476.} UNION { ?item wdt:P106 wd:Q446966.} UNION { ?item wdt:P106 wd:Q22132694.} UNION { ?item wdt:P106 wd:Q674426.}


SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
?item wdt:P20 ?placedied.  
{ ?placedied wdt:P31 wd:Q328468.} UNION { ?placedied wdt:P31 wd:Q152081. } UNION { ?placedied wdt:P31 wd:Q153813.} UNION { ?placedied wdt:P31 wd:Q153813.} UNION { ?placedied wdt:P31 wd:Q2583015.}
OPTIONAL  { ?item wdt:P18 ?pic. }
OPTIONAL { ?item wdt:P127 ?ownedby. }
OPTIONAL { ?item wdt:P570 ?datedied. }
OPTIONAL { ?item wdt:P20 ?placedied. }
OPTIONAL { ?item wdt:P180 ?depicts. }
OPTIONAL { ?item wdt:P921 ?plunder. }
OPTIONAL { ?item wdt:P1830 ?ownerof. }
OPTIONAL { ?item wdt:P108 ?employer. }
OPTIONAL { ?item wdt:P569 ?birth. }
OPTIONAL { ?item wdt:P40 ?child. }
OPTIONAL { ?item wdt:P214 ?VIAF_ID. }
OPTIONAL { ?item wdt:P19 ?place_birth. }
OPTIONAL { ?item wdt:P244 ?Library_of_Congress_authority_ID. }
OPTIONAL { ?item wdt:P227 ?GND_ID. }
OPTIONAL { ?item wdt:P245 ?ULAN_ID. }
OPTIONAL { ?item wdt:P26 ?spouse. }
OPTIONAL { ?item wdt:P27 ?country. }
OPTIONAL { ?item wdt:P3342 ?sigperson. }
OPTIONAL { ?item wdt:P102 ?party. }
OPTIONAL { ?item wdt:P1327 ?partner. }
OPTIONAL { ?item wdt:P1840 ?investby. }
OPTIONAL { ?item wdt:P25 ?mother. }
OPTIONAL { ?item wdt:P22 ?father. }
OPTIONAL { ?item wdt:P3373 ?sibling. }
OPTIONAL { ?item wdt:P1299 ?depictedby. }
OPTIONAL { ?item wdt:P39 ?position. }

FILTER (YEAR(?datedied) >= 1933 )
}
LIMIT 20000

_______

note: careful: the filter should read datedied "greater than or equal to" 1933. Sometimes the greater than symbol gets garbled on this blog

(Notice the word OPTIONAL? We are telling Wikidata to get the information if it is available but not to worry about it if it is not. Since we want to understand who these individuals were, the context of their lives and their relations with others, we have added much optional information to the query. This is not strictly speaking necessary, but possibly useful for future network analysis)
The Wikidata Sparql Query can present the results in many different ways.

As a table. 


As a graph. 












With photos







We can zoom in close to view certain specific elements that are hard to see when looking at lots of data.





We also get an idea of where data might be missing.














Try the query yourself.  It shows only those art people who died in a Nazi camp or ghetto. What one immediately notices is how many are missing. 

How to see what is present and what is absent will be the subject of our next post.

Link to Query
https://query.wikidata.org/#%0A%0ASELECT%20DISTINCT%20%3Fitem%20%3FitemLabel%20%3Fpic%20%3Fdatedied%20%3FplacediedLabel%20%3Fplacedied%20%3Fchild%20%3FchildLabel%20%3Fownedby%20%3FownedbyLabel%20%3Fdepicts%20%3FdepictsLabel%20%3Fdepictedby%20%3FdepictedbyLabel%20%3FcountryLabel%20%3Fownerof%20%3FownerofLabel%20%3Fspouse%20%3Femployer%20%3FemployerLabel%20%3FspouseLabel%20%3Fmother%20%3FmotherLabel%20%3Ffather%20%3FfatherLabel%20%3Fsibling%20%3FsiblingLabel%20%3Finvestby%20%3FinvestbyLabel%20%3Fsigperson%20%3FsigpersonLabel%20%3Fparty%20%3FpartyLabel%20%3Fpartner%20%3FpartnerLabel%20WHERE%20%7B%0A%7B%20%3Fitem%20wdt%3AP106%20wd%3AQ1792450.%7D%20UNION%20%7B%20%3Fitem%20wdt%3AP31%20wd%3AQ1007870.%20%7D%20UNION%20%7B%20%3Fitem%20wdt%3AP106%20wd%3AQ173950.%7D%20UNION%20%7B%20%3Fitem%20wdt%3AP921%20wd%3AQ328376.%7D%20UNION%20%7B%20%3Fitem%20wdt%3AP106%20wd%3AQ10732476.%7D%20UNION%20%7B%20%3Fitem%20wdt%3AP106%20wd%3AQ446966.%7D%20UNION%20%7B%20%3Fitem%20wdt%3AP106%20wd%3AQ22132694.%7D%20UNION%20%7B%20%3Fitem%20wdt%3AP106%20wd%3AQ674426.%7D%0A%0A%0ASERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22%20%7D%0A%3Fitem%20wdt%3AP20%20%3Fplacedied.%20%20%0A%7B%20%3Fplacedied%20wdt%3AP31%20wd%3AQ328468.%7D%20UNION%20%7B%20%3Fplacedied%20wdt%3AP31%20wd%3AQ152081.%20%7D%20UNION%20%7B%20%3Fplacedied%20wdt%3AP31%20wd%3AQ153813.%7D%20UNION%20%7B%20%3Fplacedied%20wdt%3AP31%20wd%3AQ153813.%7D%20UNION%20%7B%20%3Fplacedied%20wdt%3AP31%20wd%3AQ2583015.%7D%0AOPTIONAL%20%20%7B%20%3Fitem%20wdt%3AP18%20%3Fpic.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP127%20%3Fownedby.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP570%20%3Fdatedied.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP20%20%3Fplacedied.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP180%20%3Fdepicts.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP921%20%3Fplunder.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP1830%20%3Fownerof.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP108%20%3Femployer.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP569%20%3Fbirth.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP40%20%3Fchild.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP214%20%3FVIAF_ID.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP19%20%3Fplace_birth.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP244%20%3FLibrary_of_Congress_authority_ID.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP227%20%3FGND_ID.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP245%20%3FULAN_ID.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP26%20%3Fspouse.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP27%20%3Fcountry.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP3342%20%3Fsigperson.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP102%20%3Fparty.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP1327%20%3Fpartner.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP1840%20%3Finvestby.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP25%20%3Fmother.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP22%20%3Ffather.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP3373%20%3Fsibling.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP1299%20%3Fdepictedby.%20%7D%0AOPTIONAL%20%7B%20%3Fitem%20wdt%3AP39%20%3Fposition.%20%7D%0A%23%20FILTER%20%28YEAR%28%3Fbirth%29%20%3D%201860%20%26amp%3B%26amp%3B%20YEAR%28%3Fbirth%29%20%26lt%3B%3D%201990%29%0AFILTER%20%28YEAR%28%3Fdatedied%29%20%3E%3D%201933%20%29%0A%7D%0ALIMIT%2020000




Camps and ghettos listed in the Wikidata Query


SELECT ?placedied ?placediedLabel
WHERE
{
  { ?placedied wdt:P31 wd:Q328468.} UNION { ?placedied wdt:P31 wd:Q152081. } UNION { ?placedied wdt:P31 wd:Q153813.} UNION { ?placedied wdt:P31 wd:Q153813.} UNION { ?placedied wdt:P31 wd:Q2583015.}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}



(Short link to query and result - Try it!)





May 16, 2018

Women Art Dealers with Identifiers and Spouses

List of Women Art Dealers in Wikidata May 16, 2018

Art Dealer Name WIKIDATA item VIAF_ID Library_of_Congress_authority_ID GND_ID ULAN_ID spouse spouseLabel
Helga de Alvear http://www.wikidata.org/entity/Q5704398 203283547 no2003112064
Jeanne Greenberg-Rohatyn http://www.wikidata.org/entity/Q6172093 165824978
Lucy Wertheim http://www.wikidata.org/entity/Q6698567
Martha Hopkins Struever http://www.wikidata.org/entity/Q6774430 73552138 no2003106507
Maureen Paley http://www.wikidata.org/entity/Q6792748 26330572 n96076100 142187895 500065649
Bertha Urdang http://www.wikidata.org/entity/Q6966052
Shelley M. Shier http://www.wikidata.org/entity/Q7493794
Terry Dintenfass http://www.wikidata.org/entity/Q7704300 63943854 nr2002021200 http://www.wikidata.org/entity/Q6140012 James Morgan Read
Vanessa Branson http://www.wikidata.org/entity/Q7914616
Virginia Dwan http://www.wikidata.org/entity/Q7934253 70033908
Wendy Olsoff http://www.wikidata.org/entity/Q7982741

Jan 15, 2018

Amazing Wikidata Timelines


Wikidata has timelines built into its queries. (See above for "People who died by burning")

First of all, this is incredible and amazing and insanely powerful.