I’m having trouble figuring out when to add https://schema.org/ in the json-ld.
Issue
For structured data properties, such as @type or itemCondition, which is the correct format:
"@type": "https://schema.org/Brand"
or"@type": "Brand"
?"itemCondition": "https://schema.org/NewCondition"
or"itemCondition": "NewCondition"
?
What I’ve Tried
I’ve gone through the documentation from Google, Schema.org, and jsonld.com but haven’t found a definitive answer.
Example Sources:
Is there an official guideline for when to include the full Schema.org URL versus just the property name?
End goal
To create structured data markup for Google Search (sporting goods web shop).
2
Answers
If you have a "@context" of "https://schema.org", then you don’t need to fully qualify parameters like "@type" or enumerated values like for "itemCondition".
Here’s the complex definition for @context:
https://www.w3.org/TR/json-ld11/#the-context
Great answer from @Tony McCreath.
Hey Danny Wave, there are two separate aspects of your question.
Let’s discuss both:
Q 1. What is the Correct Format for Schema Property Types i.e. full URL or just Value wording?
Answer: For Property Types, it’s always just value, as you asked,
Brand
without website url; https://schema.org/. No need to be confused for this as it’s crystal clear.Q 2. What is the Correct Format for Schema Property Values where Schema.org website recommends full URL as Value, like the folllwing:
https://schema.org/NewCondition
https://schema.org/InStock
Answer: Google clearly recommends that you can just write
NewCondition
,InStock
also.According to Google guidelines, either you write full URL like this
https://schema.org/NewCondition
, or you writeInStock
only, both are acceptable.Check the below screenshot:
ItemAvailability Value Recommendation from Google
Read Google’s Recommendation here: https://developers.google.com/search/docs/appearance/structured-data/merchant-listing#availability