: What is the use of @id in json-ld syntax? I am really confused what is @id used for in json-ld syntax. Sample from apple.com. What does @id actually represent. Any help would be great? <script
I am really confused what is @id used for in json-ld syntax. Sample from apple.com. What does @id actually represent. Any help would be great?
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@id": "http://www.apple.com/#organization",
"@type": "Organization",
"url": "http://www.apple.com/",
"logo": "https://www.apple.com/ac/structured-data/images/knowledge_graph_logo.png?201608191052",
"contactPoint": [
{
"@type": "ContactPoint",
"telephone": "+1-800-692-7753",
"contactType": "sales",
"areaServed": [ "US" ]
}
],
"sameAs": [
"http://www.wikidata.org/entity/Q312",
"https://www.youtube.com/user/Apple",
"https://www.linkedin.com/company/apple"
]
}
More posts by @Goswami781
2 Comments
Sorted by latest first Latest Oldest Best
The @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 resource attribute.)
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 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 www.apple.com/#organization to identify Apple. If you would use www.apple.com/ instead, it would be Apple’s homepage you like.
Reading the following link from Google Developers - Data types - Local Business in the Local business properties section you have:
[...] The ID should be stable and unchanging over time. Google Search treats the URL as an opaque string and it does not have to be a working link. If the business has multiple locations, make sure the @id is unique for each location.
The @id is for almost all object
I hope my answer helps you :)
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.