schema.orgjson-ldstructured-data

Is it possible to reference by @id without Schema.org inlining the object?


I am trying to set up Schema.org on a website, but I have trouble understanding how to use the @id attribute.

I want to specify a Corporation and a WebSite. Here is the code without a reference between the two objects:

<script type="application/ld+json">
    [{
        "@context": "https://schema.org",
        "@id": "https://www.example.com/#corporation",
        "@type": "Corporation",
        "name": "Company Name",
        "legalName": "Company Name",
        "description": "Company Description",
        "url": "https://www.example.com",
        "logo": "https://www.example.com/logo"
    },
    {
        "@context": "https://schema.org",
        "@type": "WebSite",
        "name": "Example",
        "url": "https://www.example.com"
    }]]
</script>

The Schema.org validator finds both the Corporation and the WebSite. Google's Rich result test tool finds the logotype, as expected. Now, I want to add a reference to the Corporation as the publisher of the WebSite.

<script type="application/ld+json">
    [{
        "@context": "https://schema.org",
        "@id": "https://www.example.com/#corporation",
        "@type": "Corporation",
        "name": "Company Name",
        "legalName": "Company Name",
        "description": "Company Description",
        "url": "https://www.example.com",
        "logo": "https://www.example.com/logo"
    },
    {
        "@context": "https://schema.org",
        "@type": "WebSite",
        "name": "Example",
        "url": "https://www.example.com",
        "publisher": {
            "@id": "https://www.example.com/#corporation"
        }
    }]]
</script>

The Schema.org validator now only shows the WebSite and has inlined the Corporation as publisher. The Google tool does not find any objects, but I was expecting it to still find the logotype.

I have spent quite some time with the Schema.org docs and searched the internet but I can't find an explanation to this behavior.

Am I doing it the wrong way? Thanks in advance.


Solution

  • At the moment logo is only shown in reports if it is in a top-level Organization entity. It is still recognised internally.

    Google's logic sometimes ignores embedded entities.

    I found a reference from Google on this. Point 2:

    enter image description here