Wolfram 语言

更丰富的知识库访问

现代艺术博物馆的绘画和艺术家

现代艺术博物馆(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" 查看.

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 ja ko pt-br ru