Wolfram言語

Knowledgebaseへの幅広いアクセス

近代美術館の絵画とその製作者

ニューヨーク近代美術館(MoMA)には,所蔵品についての詳細情報が記載された公開データ集合がある(https://github.com/MuseumofModernArt/collection).ここでは,このデータから導いたカスタムの実体ストアを使ってMoMAが所蔵する絵画の大きさを調べ,その製作者たちの寿命を探ってみる.

まず,ResourceObjectからビルド済みの実体ストアをロードする.

In[1]:=
Click for copyable input
momaStore = ResourceData[ ResourceObject[ Association[ "Name" -> "Museum of Modern Art Holdings and Artists", "UUID" -> "38f47cc0-667d-4988-8ebe-6c1bef23fdc6", "ResourceType" -> "DataResource", "Version" -> "1.0.0", "Description" -> "Holdings and artists of The Museum of Modern \ Art", "ContentSize" -> Association["EntityStore" -> 0], "ContentElements" -> {"EntityStore"}]]]
Out[1]=

このセッション用にストアを登録する.

In[2]:=
Click for copyable input
PrependTo[$EntityStores, momaStore];

"MoMAHolding"実体タイプを使って実体ストアから美術品の特性リストを入手する.

In[3]:=
Click for copyable input
EntityProperties["MoMAHolding"]
Out[3]=

特定の作品について代表的な特性値をリストする.

In[4]:=
Click for copyable input
DeleteMissing[ EntityValue[Entity["MoMAHolding", "79802"], "PropertyAssociation" ]] // Take[#, 15] &
Out[4]=

MoMAにある全作品の完成日の日付のヒストグラムを作る.

In[5]:=
Click for copyable input
DateHistogram[ DeleteMissing[EntityValue["MoMAHolding", "CompletionDate"]]]
Out[5]=

コレクション中の作品タイプを集計する.

In[6]:=
Click for copyable input
TextGrid[SortBy[ Tally[EntityValue["MoMAHolding", EntityProperty["MoMAHolding", "Classification"]]], Last] // Reverse, Dividers -> All, Background -> {Automatic, {{LightBlue, None}}}, Alignment -> {{Left, Decimal}, Automatic}]

隠的に定義された実体クラスを使ってMoMAの所蔵絵画を取り出す.

In[7]:=
Click for copyable input
paintings = EntityClass[ "MoMAHolding", {EntityProperty["MoMAHolding", "Classification"] -> "Painting"}];

絵画の縦横比と面積をプロットする.デフォルトの縦横比のビニング幅では,縦横比の分布は三峰性に見える.

In[8]:=
Click for copyable input
Table[Histogram[EntityValue[paintings, prop], PlotLabel -> prop], {prop, {EntityProperty["MoMAHolding", "AspectRatio"], EntityProperty["MoMAHolding", "Area"]}}]
Out[8]=

次に,"MoMAArtist"実体タイプを使って実体ストアから芸術家と関連付けられた特性リストを入手する.

In[9]:=
Click for copyable input
EntityProperties["MoMAArtist"]
Out[9]=

"PropertyAssociation"としての画家のヴィンセント・ヴァン・ゴッホ(Vincent van Gogh)の特性を見る.

In[10]:=
Click for copyable input
EntityValue[ Entity["MoMAArtist", "Vincent van Gogh"], "PropertyAssociation"]
Out[10]=

全芸術家についてMoMAの所存作品数を可視化する:

In[11]:=
Click for copyable input
Histogram[ Length /@ EntityValue["MoMAArtist", "MoMAPieces"], {"Log", 20}]
Out[11]=

故人となった芸術家たちの平均寿命を調べてみる.まず,生年月日と死亡年月日の両方が分かっている芸術家を選択する.次に両日付の差を取り,最後に平均を計算する.

In[12]:=
Click for copyable input
deceasedArtists = Select[EntityList["MoMAArtist"], AllTrue[# /@ {"BirthDate", "DeathDate"}, DateObjectQ] &];
In[13]:=
Click for copyable input
Mean[DateDifference[#["BirthDate"], #["DeathDate"], "Year"] & /@ deceasedArtists] // N
Out[13]=

20世紀を10年ごとに分け,それぞれの年代からランダムに選択したMoMAの所蔵作品のコラージュを作る.

完全なWolfram言語入力を表示する
In[14]:=
Click for copyable input
decadePieces = KeySelect[ GroupBy[Take[RandomEntity["MoMAHolding", 2000], 500], Floor[#1["CompletionDate"]["Year"], 10] &], Between[{1900, 2000 - 1}]];
In[15]:=
Click for copyable input
makePolygon[ year_ -> artworks_] := {Texture[ ImageCollage[ URLExecute[#["ThumbnailURL"]] & /@ Select[artworks, \[Not] MissingQ[#["ThumbnailURL"]] &, UpTo[8]]]], Lighting -> {{"Directional", White, {{0, year - 2, 0}, {0, year, 0}}}}, Opacity[.75], Polygon[{{-1, year/10, -1}, {1, year/10, -1}, {1, year/10, 1}, {-1, year/10, 1}}, VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]};
In[16]:=
Click for copyable input
Graphics3D[makePolygon /@ Normal[decadePieces], Axes -> True, AxesEdge -> {None, {1, 0}, None}, Ticks -> {None, Table[{190 + i, StringJoin["19", ToString[i], "0's"]}, {i, 0, 9}], None}, ImageSize -> Large]
Out[16]=

関連する例

en es fr ko pt-br ru zh