Using schema.org branchOf with itemref
Asked Answered
A

1

5

I have a company page that has all the local branches listed on it.

  • On the page header, I have an itemType of Organization defined.
  • Each LocalBusiness (Hotel) is further down the page.

For each Hotel, I'm trying to add the branchOf property using a meta tag, but both Yandex and Google Snippets comes up blank for this attribute. Is it possible to do this way?

<div itemscope itemtype="http://schema.org/Organization" id="schema-organization">
 <meta itemprop="description" content="blah blah blah" />
 <a href="/" itemprop="url">
  <h1 itemprop="name">The Hotel Chain</h1>
 </a>

 <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
  <div itemprop="addressLocality">new york city</div>
  <meta itemprop="addressRegion" content="NY" />
 </div>
</div>
<!-- snip -->
<div itemscope itemtype="http://schema.org/Hotel">
 <meta itemprop="branchOf" itemref="schema-organization" />
 <h2 itemprop="name">Hotel Location 1</h2>
 <a href="http://maps.google.com/blahblah" itemprop="map">Get directions on Google Maps</a>

 <div itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates">
  <meta itemprop="latitude" content="40.7450605" />
  <meta itemprop="longitude" content="-73.98301879999997" />
 </div>

 <div class="wrap-address clearfix" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
  <ul class="ul-reset">
   <li><span itemprop="streetAddress">1234 Some Street</span> (between 3rd Ave &amp; Lexington Ave)</li>
   <li>
    <span itemprop="addressLocality">New York City</span>, 
    <span itemprop="addressRegion">NY</span> 
    <span itemprop="postalCode">10016</span>
   </li>
  </ul>
 </div>   

 <ul>
  <li><strong>Phone:</strong><span itemprop="telephone">555-555-5555</span></li>
  <li><strong>Fax:</strong><span itemprop="faxNumber">555-555-5555</span></li>
 </ul>
 <ul>
  <li>
   Information:&nbsp;
   <a href="mailto:[email protected]" itemprop="email">[email protected]</a>
  </li>
  <li itemprop="contactPoint" itemscope itemtype="http://schema.org/ContactPoint">
   <span itemprop="contactType">Reservations</span>:&nbsp;
   <a href="mailto:[email protected]" itemprop="email">[email protected]</a>
  </li>
  <li itemprop="contactPoint" itemscope itemtype="http://schema.org/ContactPoint">
   <span itemprop="contactType">Concierge</span>:&nbsp;
   <a href="mailto:[email protected]" itemprop="email">[email protected]</a>
  </li>
 </ul>
</div>
Amorino answered 15/1, 2014 at 19:4 Comment(0)
D
3

About itemref:

  1. it has to be specified on elements with itemscope
  2. it is used to reference other properties (= itemprop in Microdata)

So this means for you:

  • move itemref to the Hotel
  • move itemprop="branchOf" to the Organization

Minimal example:

<div itemprop="branchOf" itemscope itemtype="http://schema.org/Organization" id="schema-organization">
 <h1 itemprop="name">The Hotel Chain</h1>
</div>

<div itemscope itemtype="http://schema.org/Hotel" itemref="schema-organization">
 <h2 itemprop="name">Hotel Location 1</h2>
</div>
Diaphane answered 16/1, 2014 at 12:3 Comment(4)
The Organization itemtype does not support the branchOf itemprop; it is unique to LocalBusiness.Ctenophore
@phenry: In my example, the branchOf isn’t a property for the Organization item. It’s a property for the Hotel item, which gets added via itemref.Diaphane
do you have a link to BranchOf documentation? This looks a useful way of combining json-ld with microdata within the same elementPerreira
@Mousey: branchOf is just a normal Schema.org property. Not sure what you mean with "combining".Diaphane

© 2022 - 2024 — McMap. All rights reserved.