EntityClass[type,name]
表示由 name 识别的指定类型的实体类别.
EntityClass[type,{property1vspec1,property2vspec2,…}]
表示包含指定类型实体的隐式定义的实体类,其属性 propertyi 符合值选择器 vspeci.
EntityClass[cspec,psel]
表示一个实体类别,其成员由 cspec 指定,由属性选择器 psel 选择.
EntityClass
实体类型列表»EntityClass[type,name]
表示由 name 识别的指定类型的实体类别.
EntityClass[type,{property1vspec1,property2vspec2,…}]
表示包含指定类型实体的隐式定义的实体类,其属性 propertyi 符合值选择器 vspeci.
EntityClass[cspec,psel]
表示一个实体类别,其成员由 cspec 指定,由属性选择器 psel 选择.
更多信息
- 通过
,可用自然语言指定内置 EntityClass 对象. - 在 EntityClass[type,name] 中,类型可以是内置实体类型,也可以是用 EntityRegister 注册的 EntityStore 中指定的类型.
- type 的形式可以是 "type" 或 "type""child1""child2"….
- 隐式定义的实体类别可以使用 EntityList[EntityClass["type",{property1value1,property2value2,…}]] 分解为规则命名的实体.
- 隐式定义的实体类别表示所有在属性值上具有指定限制的实体.
- 定义实体类的隐式属性值对于维数值可使用 Quantity (和 Quantity 区间),数值使用 Between,日期使用 DateObject,序数选择使用 TakeLargest 和 TakeSmallest,实体使用 ContainsAll、ContainsExactly、ContainsAny、ContainsOnly、ContainsNone. 实体列表被诠释为 ContainsAll,单个 entity 被诠释为 ContainsAny[{entity}].
- 取决于和表达式关联的 EntityTypeName,EntityClass 表达式的Information 将给出不同的属性.
范例
打开所有单元 关闭所有单元基本范例 (7)
使用
WolframAlpha 界面探索特定实体:
["united nations"]EntityClass["Country", "Europe"]EntityList[%]EntityList[EntityClass["Chemical", "Alcohols"]]//ShallowEntityValue[EntityClass["Country", "GroupOf7"], "Population"]可以使用 EntityClassList 找到可用实体类型列表:
EntityClassList["MinorPlanet"]EntityValue[EntityClass["MinorPlanet", "InnerMainBeltAsteroid"], "EntityCount"]创建一个隐式定义实体类,由密度落在指定范围内的所有元素组成:
EntityClass["Element", {"Density" -> Quantity[Interval[{5, 8}], "Grams" / "Centimeters" ^ 3]}]EntityList[%]使用隐式定义的实体类,选择世界上边界线最长的10个国家,并且将它们与相应边界长度一起返回:
EntityValue[EntityClass["Country", {EntityProperty["Country", "BoundaryLength"] -> TakeLargest[10]}], EntityProperty["Country", "BoundaryLength"], "EntityAssociation"]范围 (7)
EntityClass["Aircraft", {"CruiseSpeed" -> Quantity[Interval[{550, 600}], "Miles" / "Hours"],
"Height" -> Quantity[Interval[{75, 200}], "Feet"],
"Wingspan" -> Quantity[Interval[{75, 80}], "Meters"]
}]EntityList[%]EntityClass["Polyhedron", {"FaceCount" -> TakeLargest[95], "EdgeCount" -> TakeSmallest[95], "VertexCount" -> 14}]["Entities"]EntityList[EntityClass[EntityClass["Country", "G8"], "Population" -> TakeLargest[3]]]获取一个 EntityClass 的相关信息:
Information[EntityClass["Element", "NobleGas"]]计算所有按照最大公狗身高指定的狗的品种的最小体重的均值和标准差:
EntityValue[EntityClass["DogBreed", {EntityProperty["DogBreed", "HeightMaleMinimum"] -> Quantity[Interval[{15, 18}], "Inches"]}],
EntityProperty["DogBreed", "WeightMaleMaximum"], {Mean, StandardDeviation}]ajmovies = EntityClass["Movie", {EntityProperty["Movie", "Cast"] -> Entity["Person", "AngelinaJolie::8cggf"]}];(ajmoviedata = Values[DeleteMissing[EntityValue[ajmovies, {EntityProperty["Movie", "Name"], EntityProperty["Movie", "ReleaseDate"], EntityProperty["Movie", "Image"]}, "EntityAssociation"], 1, 2]])//ShortTimelinePlot[Labeled[#2, Tooltip[#3, Column[{#1, #2}]]]&@@@ajmoviedata, PlotLayout -> "ReverseVertical"]EntityClass["MeasurementDevice", {"InstanceOf" -> ContainsAll[{Entity["MeasurementDevice", "Thermometer"]}]}]//EntityListEntityClass["PhysicalEffect", {"DiscoveryDate" -> DateObject[{1930}]}]//EntityList应用 (7)
使用一个由五个最长的消化器官组成的隐式定义的实体类,并返回上述消化器官及其图像:
organ = EntityClass["AnatomicalStructure", {EntityProperty["AnatomicalStructure", "EntityClasses"] -> EntityClass["AnatomicalStructure", "DigestiveOrgans"], EntityProperty["AnatomicalStructure", "Length",
{"StatisticalGroup" -> Entity["StatisticalGroup", "AverageOfAll"]}] -> TakeLargest[5]}];EntityValue[organ, {"Length", "Image"}, "Dataset"]使用一个隐式定义的实体类,按产绒量查找排序前 10 的羊品种,返回上述品种及其图像:
sheep = EntityClass["SheepBreed", {EntityProperty["SheepBreed", "FleeceWeight"] -> TakeLargest[10]}];EntityValue[sheep, {"FleeceWeight", "Image"}, "Dataset"]pok = EntityClass["Pokemon", {EntityProperty["Pokemon", "EntityClasses"] -> EntityClass["Pokemon", "Yellow"], EntityProperty["Pokemon", "Weight"] -> Between[{Quantity[50, "Kilograms"], Quantity[100, "Kilograms"]}]}];ImageCollage[Rule@@@EntityValue[pok, {"Weight", "Image"}], Background -> White]EntityList[EntityClass["Star", {"ApparentMagnitude" -> Between[{-1, 1}]}]]EntityList[EntityClass["Star", {"DistanceFromEarth" -> TakeSmallest[15]}]]brightest = EntityClass["Star", {"ApparentMagnitude" -> TakeSmallest[15]}];EntityList[brightest]ResourceFunction["HertzsprungRussellDiagram"][brightest]EntityList[EntityClass["Star", {"DistanceFromEarth" -> TakeSmallest[15], "ApparentMagnitude" -> TakeSmallest[15]}]]EntityList[EntityClass["Planet", {"Radius" -> TakeLargest[3]}]]EntityList[EntityClass["Star", {EntityProperty["Star", "DistanceFromEarth", {}] -> TakeSmallest[1], "EntityClasses" -> EntityClass["Star", "NightSkyStar"]}]]按距离排序 2013 年 1 月 3 日离地球最近的三颗行星:
date = DateObject[{2013, 1, 13}];datedproperty = Dated["DistanceFromEarth", date];ec = EntityClass["Planet", {datedproperty -> TakeSmallest[3]}];EntityValue[SortedEntityClass[ec, datedproperty], datedproperty, "Dataset"]查找与古德曼尼(Gudermannian)函数有关的数学函数:
EntityClass["MathematicalFunction", {"RelatedFunctions" -> ContainsAny[{Entity["MathematicalFunction", "Gudermannian"]}]}]//EntityListEntityClass["MathematicalFunction", {"NamedIdentities" -> (Length[#] > 10&)}]//EntityListRandomEntity[EntityClass["PhysicalSystem", {EntityProperty["PhysicalSystem", "DegreesOfFreedom"] -> 2}]]属性和关系 (1)
可能存在的问题 (1)
技术笔记
相关指南
-
▪
- 数据库连接 ▪
- WDF(Wolfram 数据框架) ▪
- 使用关系数据库中的信息 ▪
- 知识表示和访问 ▪
- 工程数据 ▪
- 生命科学和医学:数据与计算 ▪
- 表格数据源 ▪
- 文化数据 ▪
- 运输数据 ▪
- 人物与历史 ▪
- 地理数据和实体 ▪
- 天文计算与数据 ▪
- 物理和化学:数据和计算 ▪
- 互联网和计算机系统数据 ▪
- 时间和事件序列数据源
文本
Wolfram Research (2014),EntityClass,Wolfram 语言函数,https://reference.wolfram.com/language/ref/EntityClass.html (更新于 2019 年).
CMS
Wolfram 语言. 2014. "EntityClass." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2019. https://reference.wolfram.com/language/ref/EntityClass.html.
APA
Wolfram 语言. (2014). EntityClass. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/EntityClass.html 年
BibTeX
@misc{reference.wolfram_2026_entityclass, author="Wolfram Research", title="{EntityClass}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/EntityClass.html}", note=[Accessed: 07-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_entityclass, organization={Wolfram Research}, title={EntityClass}, year={2019}, url={https://reference.wolfram.com/language/ref/EntityClass.html}, note=[Accessed: 07-September-2026]}