现代艺术博物馆的绘画和艺术家
现代艺术博物馆(MoMA)在 https://github.com/MuseumofModernArt/collection 保有一个公共数据集,其中包含了其保存艺术品的详细信息. 在此,你可以通过该数据集定义一个实体库,来研究 MoMA 的绘画尺寸,及其艺术家的寿命.
首先,从 ResourceObject 加载预创建的实体库.
In[1]:=
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]:=
PrependTo[$EntityStores, momaStore];
通过使用 "MoMAHolding" 实体类从实体库获取艺术品的属性列表.
In[3]:=
EntityProperties["MoMAHolding"]
Out[3]=
列出一个特定艺术品的代表属性值.
In[4]:=
DeleteMissing[
EntityValue[Entity["MoMAHolding", "79802"],
"PropertyAssociation" ]] // Take[#, 15] &
Out[4]=
创建 MoMA 中所有艺术品完成日期的直方图.
In[5]:=
DateHistogram[
DeleteMissing[EntityValue["MoMAHolding", "CompletionDate"]]]
Out[5]=
收藏艺术品类型的总数.
In[6]:=
TextGrid[SortBy[
Tally[EntityValue["MoMAHolding",
EntityProperty["MoMAHolding", "Classification"]]], Last] //
Reverse, Dividers -> All,
Background -> {Automatic, {{LightBlue, None}}},
Alignment -> {{Left, Decimal}, Automatic}]
使用隐性定义的实体类提取 MoMA 绘画.
In[7]:=
paintings =
EntityClass[
"MoMAHolding", {EntityProperty["MoMAHolding", "Classification"] ->
"Painting"}];
绘制绘画纵横比和面积的直方图. 箱宽取默认值时,纵横比表现出三峰分布.
In[8]:=
Table[Histogram[EntityValue[paintings, prop],
PlotLabel ->
prop], {prop, {EntityProperty["MoMAHolding", "AspectRatio"],
EntityProperty["MoMAHolding", "Area"]}}]
Out[8]=
现在使用 "MoMAArtist" 实体类获取与艺术家相关的属性列表.
In[9]:=
EntityProperties["MoMAArtist"]
Out[9]=
将艺术家文森特·梵高的属性作为 "PropertyAssociation" 查看.
In[10]:=
EntityValue[
Entity["MoMAArtist", "Vincent van Gogh"], "PropertyAssociation"]
Out[10]=
可视化含有 MoMa 的所有艺术家的作品分布.
In[11]:=
Histogram[
Length /@ EntityValue["MoMAArtist", "MoMAPieces"], {"Log", 20}]
Out[11]=
为探索已经过世的艺术家的平均寿命,首先选取有出生和死亡确认日期的艺术家,然后选定之间相差的日期,最后进行平均计算.
In[12]:=
deceasedArtists =
Select[EntityList["MoMAArtist"],
AllTrue[# /@ {"BirthDate", "DeathDate"}, DateObjectQ] &];
In[13]:=
Mean[DateDifference[#["BirthDate"], #["DeathDate"], "Year"] & /@
deceasedArtists] // N
Out[13]=
从20世纪每10年中,随机选择一些 MoMA 艺术品创建拼图.
显示完整的 Wolfram 语言输入
Out[16]=