When extracting the "name" of an Entity
one has CommonName
. Good. Before I discovered this, I simply applied a rule like:
en = Entity["Language", "English"];
en /. Entity[a_, b_] :> b (* out: "English"*)
Maybe I´m missing something stupid, but why does the following not work?
Cases[en, Entity[a_, b_] :> b] (* out: {} *)
Cases[{en}, Entity[a_, b_] :> b]
works $\endgroup$Entity
that is the usual behavior ofCases
, for example, for an undefined variableb
,Cases[b,b]
outputs {}. The fix->Cases[en, Entity[a_, b_] :> b, All]
$\endgroup$