2

While playing with Google Structured Data Testing Tool, I noticed that it can handle inline @context in JSON-LD alright:

{
    "@context": {
        "Product": "https://example.com/Product",
        "name": "https://example.com/name"
    },
    "@type": "Product",
    "name": "test"
}

But fails to handle external JSON-LD files referenced in @context:

{
    "@context": "https://example.com/context.jsonld",
    "@type": "Product",
    "name": "test"
}

Instead, it resolves the terms relative to the current URL.

And when I check example.com's server logs, I can see that no attempt was made to request the context file.

Is this a willful violation of JSON-LD because Google only cares about specific vocabularies such as Schema.org, or did I miss something?

Bonus question: can we expect the same behaviour from GoogleBot, i.e. not downloading external JSON-LD context files?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.