Microdata - How to tag Item properties placed inside a child element (and therefore outside it)

Is there a way to mark Item properties placed inside a child element (and therefore outside it)?

I use microdata and schema.org to tag some web pages. and I have a code like this:

<body itemscope itemtype="http://schema.org/WebPage"> <header itemscope itemtype="http://schema.org/WPHeader"> <a href="index.html"> <img id="logo" src="xxx" alt="xxx" itemprop="primaryImageOfPage"> </a> </header> <!--the rest of the page--> </body> 

I have a logo inside a WPHeader element and I want it to be primaryImageOfPage for the WebPage element. I know that I can use Itemref to include properties that are not in the item scope, but like this, you are not taking this property from the scope of child items. This is really a problem if both elements can have the same property, such as a name or description.

This is just an example of an explanation of the problem. By the time I solve it with itemref ... but there should be a better way to do this.

I know that there is no need to mark up everything, I just want to know that this is the best way to avoid this problem.

+4
source share
1 answer

Microdata is an RDF rip-off limited to deal with finding cross-cutting issues for semantic fragments. Thus, it is assumed that the advanced CURIE detection capabilities are discarded. For integrity, which shows content pages related to a good-quality domain, RDFa along with vocab covering domain-specific aspects is the final way for now . While search providers dominated the HTML5 specification to make the standard part of microdata as the Internet continues to grow more semantically, the differences between them end up like the question β€œwhat’s called?”

0
source

Source: https://habr.com/ru/post/1447982/


All Articles