CombinedEntityClass[class1,class2,prop]
特性 prop の値がペアの2つの実体で等しい場合に class1と class2の実体のペアの特性を組み合せて得た実体のクラスを表す.
CombinedEntityClass[class1,class2,prop1prop2]
class1の実体の prop1の値が class2の実体の prop2の値と等しい class1と class2からの実体のペアを組み合せる.
CombinedEntityClass[class1,class2,{pspeca,pspecb,…}]
特性指定 pspeckがすべて一致する実体のペアを組み合せる.
CombinedEntityClass[class1,class2,f]
実体関数 f を適用するとTrueが与えられる実体のペアを組み合せる.
CombinedEntityClass[class1,class2,spec,"jspec"]
特性が欠けている実体を含めることをいつ許容するかを"jspec"を使って決定する.
CombinedEntityClass
CombinedEntityClass[class1,class2,prop]
特性 prop の値がペアの2つの実体で等しい場合に class1と class2の実体のペアの特性を組み合せて得た実体のクラスを表す.
CombinedEntityClass[class1,class2,prop1prop2]
class1の実体の prop1の値が class2の実体の prop2の値と等しい class1と class2からの実体のペアを組み合せる.
CombinedEntityClass[class1,class2,{pspeca,pspecb,…}]
特性指定 pspeckがすべて一致する実体のペアを組み合せる.
CombinedEntityClass[class1,class2,f]
実体関数 f を適用するとTrueが与えられる実体のペアを組み合せる.
CombinedEntityClass[class1,class2,spec,"jspec"]
特性が欠けている実体を含めることをいつ許容するかを"jspec"を使って決定する.
詳細
- EntityProperties[CombinedEntityClass[class1,class2,…]]は,事実上,Join[EntityProperties[class1],EntityProperties[class2]]に等しい.
- CombinedEntityClass[class1,class2,f]の関数 f はEntityFunction[{e1,e2},…]の形でなければならない.ただし,e1と e2はそれぞれ class1と class2の実体を表す.
- CombinedEntityClass[class1,class2,…]からの結果における特性は,EntityProperty[typei,…]の形である.ただし,typeiは classiの実体タイプである.
- CombinedEntityClass["alias1"->class1,"alias2"->class2,…]を使ってEntityProperty["aliasi"->typei,…]の形式の特性を与えることができる.
- CombinedEntityClass[class1,class2,…]の classiは重複してはならない.同一のクラスにはCombinedEntityClass[class,"alias"->class]を使うことができる.
- CombinedEntityClass[ca,cb,spec,"jspec"]の結合指定 jspec は,cond で定義された条件が満たされたかどうかによって,クラス caからの実体 aiとクラス cbからの実体 bjのうちどの実体を保持するかを決定する.使用可能な結合指定はJoinAcrossの場合と同じである.
-
"Inner" 条件が満足される ai,bjだけを保つ(デフォルト) "Left" マッチする bjがない aiを許す "Right" マッチする ajがない biを許す "Outer" マッチしない aiと bjの両方を許す - 特性の値がないときは,代りにMissing["Unmatched"]が使われる.
- CombinedEntityClass[class1,class2,EntityFunction[{x,y},True]]は,事実上,SQL CROSS JOINを実装する.これは,両方のクラスから得られた"PropertyAssociation"に適用されたOuter[Join,…]におよそ等しい.
例題
すべて開く すべて閉じる例 (6)
CombinedEntityClass["Isotope", EntityClass["Element", "Period1"], "Element" -> "Entity"][{EntityProperty["Isotope", "Name"], EntityProperty["Element", "AtomicMass"], EntityProperty["Isotope", "AtomicMass"]}]CombinedEntityClassは両方のクラスのすべての特性を持っている:
EntityProperties[CombinedEntityClass["Country", "City", "CapitalCity" -> "Entity"]] === Union[EntityProperties["Country"], EntityProperties["City"]]CombinedEntityClass["Isotope", EntityClass["Element", "Period1"], EntityFunction[{i, e}, i["AtomicMass"] < e["AtomicMass"]]][{EntityProperty["Isotope", "Name"], EntityProperty["Element", "Name"]}]結合指定が異なると,一致しない実体については,振舞いが異なる結果になる:
CombinedEntityClass[FilteredEntityClass["Isotope", EntityFunction[i, i["Element"] == Entity["Element", "Hydrogen"] || i["Element"] == Entity["Element", "Lithium"]]], EntityClass["Element", "Period1"], "Element" -> "Entity", "Inner"][{EntityProperty["Isotope", "Name"], EntityProperty["Element", "Name"]}]CombinedEntityClass[FilteredEntityClass["Isotope", EntityFunction[i, i["Element"] == Entity["Element", "Hydrogen"] || i["Element"] == Entity["Element", "Lithium"]]], EntityClass["Element", "Period1"], "Element" -> "Entity", "Left"][{EntityProperty["Isotope", "Name"], EntityProperty["Element", "Name"]}]CombinedEntityClass[FilteredEntityClass["Isotope", EntityFunction[i, i["Element"] == Entity["Element", "Hydrogen"] || i["Element"] == Entity["Element", "Lithium"]]], EntityClass["Element", "Period1"], "Element" -> "Entity", "Right"][{EntityProperty["Isotope", "Name"], EntityProperty["Element", "Name"]}]CombinedEntityClass[FilteredEntityClass["Isotope", EntityFunction[i, i["Element"] == Entity["Element", "Hydrogen"] || i["Element"] == Entity["Element", "Lithium"]]], EntityClass["Element", "Period1"], "Element" -> "Entity", "Outer"][{EntityProperty["Isotope", "Name"], EntityProperty["Element", "Name"]}]同じタイプ同士を組み合せる場合は,エイリアスを使わなければならない:
CombinedEntityClass["Cloud", "other" -> "Cloud", "CloudType"][{EntityProperty["Cloud", "Name"], EntityProperty["other" -> "Cloud", "Name"]}]//Shallowリレーショナルデータベースがサポートする実体と一緒に使う場合は,CombinedEntityClassは,事実上,JOIN文に等しい:
EntityRegister[EntityStore[RelationalDatabase[FindFile["ExampleData/ecommerce-database.sqlite"]]]]CombinedEntityClass["customers", "payments", "customerNumber"][{"customerName", "amount"}]//Shallowスコープ (3)
新たなCombinedEntityClassを定義する:
combined = CombinedEntityClass["Isotope", "Element", "Element" -> "Entity"];filtered = FilteredEntityClass[combined, EntityFunction[e, e[EntityProperty["Element", "Group"]] == 17]];DeleteMissing[EntityValue[filtered, {EntityProperty["Isotope", "Name"], EntityProperty["Isotope", "DiagnosticApplications"]}], 1, 2]EntityStoreを登録する:
EntityRegister[EntityStore[Association["Types" -> Association[
"book" -> Association["Entities" -> Association["BU1032" ->
Association["book_author" -> EntityClass["book_author", {"title_id" -> "BU1032"}],
"title" -> "The Busy Executive's ... ity["author", "472-27-2349"]],
"25" -> Association["book" -> Entity["book", "TC4203"], "author" ->
Entity["author", "648-92-1872"]]], "Properties" -> Association["book" -> Association[],
"author" -> Association[]]]]]]]CombinedEntityClassを構築する:
combined = CombinedEntityClass[CombinedEntityClass["book_author", "book", "book" -> "Entity"], "author", "author" -> "Entity"]EntityProperties[combined]EntityList[combined]同じ名前,同じ出版日または発売日を持つ書籍や音楽作品を検索する:
EntityList@CombinedEntityClass["Book", "MusicWork", {"Name", "FirstPublished" -> "FirstReleaseDate"}]テクニカルノート
関連するガイド
テキスト
Wolfram Research (2019), CombinedEntityClass, Wolfram言語関数, https://reference.wolfram.com/language/ref/CombinedEntityClass.html.
CMS
Wolfram Language. 2019. "CombinedEntityClass." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CombinedEntityClass.html.
APA
Wolfram Language. (2019). CombinedEntityClass. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CombinedEntityClass.html
BibTeX
@misc{reference.wolfram_2026_combinedentityclass, author="Wolfram Research", title="{CombinedEntityClass}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/CombinedEntityClass.html}", note=[Accessed: 07-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_combinedentityclass, organization={Wolfram Research}, title={CombinedEntityClass}, year={2019}, url={https://reference.wolfram.com/language/ref/CombinedEntityClass.html}, note=[Accessed: 07-September-2026]}