Group Abstract Group Abstract

Message Boards Message Boards

1
|
3K Views
|
4 Replies
|
5 Total Likes
View groups...
Share
Share this post:

The difference between A[" "] and EntityValue[A," "] in Real World Data?

Posted 3 years ago

Hello, I once thought A[" "] equals to the EntityValue[A," "] in Real World Data in MMA, but I am wrong. As in the case below:

Entity["GeographicRegion", "Europe"]["Countries"]["Flag"]

I get countries' names.

But in

EntityValue[Entity["GeographicRegion", "Europe"]["Countries"], "Flag"]

I will get countries' flags.

So what is the different between A[" "] and EntityValue[A," "] in Real World Data?

POSTED BY: Zhenyu Zeng
4 Replies
Posted 3 years ago

Thanks for your patient explanation. I know how it works after reading it.

POSTED BY: Zhenyu Zeng
Posted 3 years ago
POSTED BY: Eric Rimbey
Posted 3 years ago

Hello,

  1. Why should I use EntityClass here?
  2. why

    EntityValue[Entity["Country", "France"], "Flag"]
    

equals to

Entity["Country", "France"]["Flag"] 

but

Entity["GeographicRegion", "Europe"]["Countries"]["Flag"]

doesn't equal to

EntityValue[Entity["GeographicRegion", "Europe"]["Countries"], "Flag"]
POSTED BY: Zhenyu Zeng
Posted 3 years ago

I get countries' names

No you don't. You get an expression that has a list of country names applied to the argument "Flag". Such an expression has no rewrite rule, so it remains unevaluated.

You could try this alternate:

EntityClass["Country", "Europe"]["Flag"]
POSTED BY: Eric Rimbey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard