/webmasters/community?hl=en
This content is likely not relevant anymore. Try searching or browse recent questions.
-
Can URN be used as @id for JSON-LD scripts? 0 Recommended Answers 2 Replies 0 Upvotes
1 Recommended Answer
$0 Recommended Answers
I have 2 json-ld scripts which I would like to connect using @id. Could I use URN as id? For example something like 'urn:product: product1'

<script type="application/ld+json">
 {
  "@context": "http://schema.org/",
  "@type": "Product",
  "name": "Name for product1",
  "color": "red",
  "brand": "brand1",
  "description": "product description",
  "image": "https://www.pathimage/1.jpg",
  "sku": "SKU_PRODUCT1",
  "mpn": "MPN_PRODUCT1",
  "productID": "product1",
  "@id": "urn:product:product1"
}
</script>

<script type="application/ld+json">{
  "@context": "http://schema.org/",
  "@id": "urn:product:product1",
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "4.4",
    "reviewCount": 63,
    "bestRating": 5
  }
}</script>

Is it correct? Google Structured Tool says it is valid but I am not sure about using URN as @id.

Thanks!
Details
All Replies (2)
HI Veronika,
 
I don't think you can do that. Moreover, you don't have to do it like this. 
 
You can put them together. Refer to the product schema markup - https://developers.google.com/search/docs/data-types/product
marked this as an answer
-
Thanks a lot! 

Unfortunately I cannot put them together as I have different scripts for generating this content, one of them is third-party, so I need to connect different scripts.

And I tried to connect with urls but have issues when pagination is used, so think about more universal solution. 
In official docs it is specified IRI should be used as @id so theoretically URN should be ok?
marked this as an answer
This question is locked and replying has been disabled.
Discard post? You will lose what you have written so far.
Write a reply
10 characters required
Failed to attach file, click here to try again.
Discard post?
You will lose what you have written so far.
Personal information found

We found the following personal information in your message:

This information will be visible to anyone who visits or subscribes to notifications for this post. Are you sure you want to continue?

A problem occurred. Please try again.
Create Reply
Edit Reply
Delete post?
This will remove the reply from the Answers section.
Notifications are off
Your notifications are currently off and you won't receive subscription updates. To turn them on, go to Notifications preferences on your Profile page.
Report abuse
Google takes abuse of its services very seriously. We're committed to dealing with such abuse according to the laws in your country of residence. When you submit a report, we'll investigate it and take the appropriate action. We'll get back to you only if we require additional details or have more information to share.

Go to the Legal Help page to request content changes for legal reasons.

Reported post for abuse
Unable to send report.
Report post
What type of post are you reporting?
Google takes abuse of its services very seriously. We're committed to dealing with such abuse according to the laws in your country of residence. When you submit a report, we'll investigate it and take the appropriate action. We'll get back to you only if we require additional details or have more information to share.

Go to the Legal Help page to request content changes for legal reasons.

Reported post for abuse
Unable to send report.
This reply is no longer available.
/webmasters/threads
//accounts.google.com/ServiceLogin
You'll receive email notifications for new posts at
Unable to delete question.
Unable to update vote.
Unable to update subscription.
You have been unsubscribed
Deleted
Unable to delete reply.
Removed from Answers
Marked as Recommended Answer
Removed recommendation
Undo
Unable to update reply.
Unable to update vote.
Thank you. Your response was recorded.
Unable to undo vote.
Thank you. This reply will now display in the answers section.
Link copied
Locked
Unlocked
Unable to lock
Unable to unlock
Pinned
Unpinned
Unable to pin
Unable to unpin
Marked
Unmarked
Unable to mark
Reported as off topic
/webmasters/profile/0?hl=en