skip to Main Content

I have a small code example that describes my situation: see below. I need to associate the ImageObject and the creator inside it with a Person that is in another block.

<div itemtype="https://schema.org/Person" itemscope="" itemid="https://website.com/name/#profile">
    <meta itemprop="name" content="MyName">
</div>

<div itemtype="https://schema.org/ImageObject" itemscope="">
    <link itemprop="url" href="https://website.com/img.jpg">
    <meta itemprop="creator" itemid="https://website.com/name/#profile" itemscope="" itemtype="https://schema.org/Person">
</div>

When checking the code with a validator.schema.org, I have the following:
enter image description here
If I understand everything correctly, this is not a mistake, but it seems to me that such code is not optimal. Is there a solution? I tried to change the code by removing some attributes, but then I got errors in the w3c validator.

2

Answers


  1. Chosen as BEST ANSWER

    I found a solution:

    <div itemtype="https://schema.org/Person" itemscope="" itemid="https://website.com/name/#profile">
        <meta itemprop="name" content="MyName">
    </div>
    <div itemtype="https://schema.org/ImageObject" itemscope="">
        <link itemprop="url" href="https://website.com/img.jpg">
        <link itemprop="creator" href="https://website.com/name/#profile">
    </div>
    

    The key: <link itemprop="creator" href="https://website.com/name/#profile">


  2. You can remove the second Person definition because it’s already linked to this itemtype via the same itemid:

    <div itemtype="https://schema.org/Person" itemscope="" itemid="https://website.com/name/#profile">
        <meta itemprop="name" content="MyName">
    </div>
    <div itemtype="https://schema.org/ImageObject" itemscope="">
        <link itemprop="url" href="https://website.com/img.jpg">
        <meta itemprop="creator" itemid="https://website.com/name/#profile" itemscope="">
    </div>
    

    Schema validation screenshot

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search