2

I'm trying to markup a page. I marked up:

WebPage 
   WPHeader
      SiteNavigationElement
   Bredcrumbs
   MainContentOfPage
     Article
        Product1
        Product2
   WPFooter

The question is: Should I aspire to declare all internal entities of WebPage as "childs" of each other, or it's not necessary?

For example:

WebPage (declared as "isPart" of WebSite)
   "hasPart" WPHeader
      "hasPart" SiteNavigationElement
   Bredcrumbs
   MainContentOfPage
     Article
        "about" Product1
        "about" Product2
   "hasPart" WPFooter

In first variant validator shows every entity as "top entity", an in the second variant validator shows only one top entity WebPage, and other entities included as WebPage properties, id's, etc.

Which variant is better?

2 Answers 2

2

You should of course use properties to relate items wherever it is possible.

If you have the two top-level items Person and Book, it’s not clear if or how they are related. The person could have read or written or bought or reviewed or … the book. But when you use a property (like author), you make the relation explicit.

In case of the syntaxes Microdata and RDFa, it doesn’t matter if you nest the items via HTML. Microdata/RDFa parsers will parse the data according to the specifications, and these only relate items if you use properties accordingly.
For example, the following two snippets generate the same Microdata output (= two top-level items), even though the item is nested in the first case:

<div itemscope itemtype="http://schema.org/Person">
  <div itemscope itemtype="http://schema.org/Book">
  </div>
</div>
<div itemscope itemtype="http://schema.org/Person">
</div>

<div itemscope itemtype="http://schema.org/Book">
</div>

It’s only appropriate not to use properties if

  • there is no suitable property defined, or
  • the items are not related somehow.
0

The relationship can be inferred by the scraper using it's position on the page. If x is within the element tagged as y, then y is already considered a child of x.

If this relationship is not obvious you can attempt to declare it. It does depend on which form of markup you're using.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.