SortedEntityClass[class,prop]
特性 prop の値に従ってソートすることで class から派生した実体クラスを表す.
SortedEntityClass[class,prop"order"]
指定された順序で prop1に従ってソートする.
SortedEntityClass[class,{prop1,prop2,…}]
特性指定 propiの値を連続的に使って同位のものに順序を与える.
SortedEntityClass[class,sortspec,n]
sortspec に従ってソートしたときの,class の最初の n 個の実体を表す.
SortedEntityClass[class,sortspec,{m,n}]
sortspec に従ってソートしたときの,class の m 番目から n 番目までの実体を表す.
SortedEntityClass
SortedEntityClass[class,prop]
特性 prop の値に従ってソートすることで class から派生した実体クラスを表す.
SortedEntityClass[class,prop"order"]
指定された順序で prop1に従ってソートする.
SortedEntityClass[class,{prop1,prop2,…}]
特性指定 propiの値を連続的に使って同位のものに順序を与える.
SortedEntityClass[class,sortspec,n]
sortspec に従ってソートしたときの,class の最初の n 個の実体を表す.
SortedEntityClass[class,sortspec,{m,n}]
sortspec に従ってソートしたときの,class の m 番目から n 番目までの実体を表す.
詳細
- SortedEntityClass[class,sortspec,n]の class の実体が n 個未満の場合は,すべての実体が使われる.
- SortedEntityClass[class,{prop1,prop2,…}]の propiは,EntityProperty,EntityFunctionあるいは文字列として与えることができる.
- SortedEntityClass[class,prop,-n]は,事実上,SortedEntityClass[class,prop->"Descending",n]に等しい.
例題
すべて開く すべて閉じる例 (5)
SortedEntityClassを使って実体のクラスをソートする:
EntityList[SortedEntityClass["Country", "Population"]]//ShortEntityList[SortedEntityClass["Country", "Population" -> "Descending"]]EntityList[SortedEntityClass["Country", "Population" -> "Descending", 10]]EntityList[SortedEntityClass["Element", {"Group", "Period"}]]リレーショナルデータベースがバックエンドの実体と一緒に使う場合は,SortedEntityClassはORDER BY文に等しい:
EntityRegister[EntityStore[RelationalDatabase[FindFile["ExampleData/ecommerce-database.sqlite"]]]]SortedEntityClass["payments", "amount", 10]["amount"]スコープ (2)
SortedEntityClassの第2引数はEntityFunctionでよい:
EntityList[SortedEntityClass[EntityClass["Country", "Europe"], EntityFunction[c, c[EntityProperty["Country", "LivestockPopulation", {"FAOLivestockType" -> "Sheep"}]] / c[EntityProperty["Country", "Population"]] -> "Descending"], 3]]長さの降順で並べ替えたすべての河川のうち,10番目から15番目までの要素を取得する:
EntityList[SortedEntityClass["River", "Length" -> "Descending", {10, 15}]]特性と関係 (1)
SampledEntityClassがSortedEntityClassに適用された場合:
EntityList[SampledEntityClass[SortedEntityClass["Dinosaur", EntityProperty["Dinosaur", "Length"] -> "Descending"], 2]]SortedEntityClassを3引数で使うことで,同じクラスがより簡単に表現できる:
EntityList[SortedEntityClass["Dinosaur", EntityProperty["Dinosaur", "Length"] -> "Descending", 2]]テクニカルノート
関連するガイド
テキスト
Wolfram Research (2019), SortedEntityClass, Wolfram言語関数, https://reference.wolfram.com/language/ref/SortedEntityClass.html.
CMS
Wolfram Language. 2019. "SortedEntityClass." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SortedEntityClass.html.
APA
Wolfram Language. (2019). SortedEntityClass. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SortedEntityClass.html
BibTeX
@misc{reference.wolfram_2026_sortedentityclass, author="Wolfram Research", title="{SortedEntityClass}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/SortedEntityClass.html}", note=[Accessed: 31-October-2026]}
BibLaTeX
@online{reference.wolfram_2026_sortedentityclass, organization={Wolfram Research}, title={SortedEntityClass}, year={2019}, url={https://reference.wolfram.com/language/ref/SortedEntityClass.html}, note=[Accessed: 31-October-2026]}