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:
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
I found a solution:
The key:
<link itemprop="creator" href="https://website.com/name/#profile">
You can remove the second
Person
definition because it’s already linked to thisitemtype
via the sameitemid
: