schemaorg-coda :: Example

eg-0264

From v29.4

JSON-LD

{
  "@context": "https://schema.org",
  "@type": "TouristTrip",
  "name": "Australia and New Zealand",
  "description": "This trip is modeled as two distinct Tourist Trips using the subTrip property.",
  "subTrip": [
      {
        "@type": "TouristTrip",
        "name": "Australia",
        "description": "This is a trip on its own."
      },
      {
        "@type": "TouristTrip",
        "name": "New Zealand",
        "description": "This is another trip nested inside the main one."
      }
    ]
}

RDFa

<div>
  <div vocab="https://schema.org/" typeof="TouristTrip">
    <div property="name" content="Australia and New Zealand"></div>
    <div property="description" content="This trip is modeled as two distinct Tourist Trips using the subTrip property."></div>
    <div rel="subTrip">
      <div typeof="TouristTrip">
        <div property="name" content="Australia"></div>
        <div property="description" content="This is a trip on its own."></div>
      </div>
    </div>
    <div rel="subTrip">
      <div typeof="TouristTrip">
        <div property="description" content="This is another trip nested inside the main one."></div>
        <div property="name" content="New Zealand"></div>
      </div>
    </div>
  </div>
</div>

Microdata

<div>
  <div itemtype="https://schema.org/TouristTrip" itemscope>
    <meta itemprop="name" content="Australia and New Zealand" />
    <meta itemprop="description" content="This trip is modeled as two distinct Tourist Trips using the subTrip property." />
    <div itemprop="subTrip" itemtype="https://schema.org/TouristTrip" itemscope>
      <meta itemprop="name" content="Australia" />
      <meta itemprop="description" content="This is a trip on its own." />
    </div>
    <div itemprop="subTrip" itemtype="https://schema.org/TouristTrip" itemscope>
      <meta itemprop="name" content="New Zealand" />
      <meta itemprop="description" content="This is another trip nested inside the main one." />
    </div>
  </div>
</div>

Pre-Markup

<div class="tourist-trip-wrapper">
  <h1>
    Australia and New Zealand
  </h1>
  <p>
    This trip is modeled as two distinct Tourist Trips using the subTrip property.
  </p>
  <div class="has-part-wrapper">
    <div>
      <h2>
        Australia
      </h2>
      <p>
        This is a trip on its own.
      </p>
    </div>
    <div>
      <h2>
        New Zealand
      </h2>
      <p>
        This is another trip nested inside the main one.
      </p>
    </div>
  </div>
</div>