@id keyword allows you to give a node a URI. This URI identifies the node.
See Node Identifiers in the JSON-LD spec.
(The equivalent in Microdata is the
itemid attribute, and the equivalent in RDFa Lite is the
Why are identifiers useful?
- You can reference a node instead of repeating it (see my example).
- Other authors can do the same (on external sites): when they use the URI you specified, it’s clear that they are talking about the same thing.
- Consumers can learn that different nodes are about the same thing.
It’s also one of the core concepts of Linked Data and the Semantic Web. If you care about this, you might want to use URIs that differentiate between the actual thing and the page about that thing (see my explanation).
This is what Apple is doing in the example. The URI
http://www.apple.com/#organization represents the actual organization, not a page (and not a part on that page) about the organization. This is a Hash URL, and it’s a popular way to make the distinction between the thing and the page about the thing. If you want to say in your JSON-LD that you like Apple, you could use
http://www.apple.com/#organization to identify Apple. If you would use
http://www.apple.com/ instead, it would be Apple’s homepage you like.