Exposing Catalog Group Information

The GoodRelations Cookbook
Recipe Exposing Catalog Group Information
Description Exposing catalog group information with GoodRelations
Status mature
Level advanced
Tags category, catalog group, google, taxonomy

In many cases, you have a granular, shop-specific taxonomy of your goods and services. It makes a lot of sense to preserve this when publishing the data.

There are two basic approaches

  • category labels as raw text with gr:category or
  • creating a shop-specific formal hierarchy with subclasses of gr:ProductOrService.


In this document, we describe the former approach. This is very simple and lightweight yet sufficient so that clients can access your hierarchy for search and user interfaces.
You can also use this pattern to help Google (and other consumers of your data) to spot the best place for putting your product or offer based on the Google category name from

   http://www.google.com/support/merchants/bin/answer.py?answer=160081


Make sure to attach the proper language tag, i.e. "en" for English so that clients know the language of your category label.

Examples in RDFa

Product

<div typeof="gr:SomeItems vso:Canoe" about="#product">
<span property="g:name">ACME Foldable Canoe</span>
<div property="gr:category" content="Sporting Goods > Water Sports > Boating >
Canoeing > Canoes"></div>
</div>

Offer

<div typeof="gr:Offering" about="#offer">
<div property="gr:name">Hepp Personal SCSI Controller Card</div>
<div property="gr:description">The Hepp Personal SCSI is a 16-bit add-on card that
allows attaching up to seven SCSI devices to your computer.</div>
<div property="gr:category" content="Electronics > Computers > Computer Components >
I/O Cards" ></div>
...
</div>

Examples in Microdata

Product

<div itemscope itemtype="http://purl.org/goodrelations/v1#ProductOrServiceModel"
itemid="#product">
<span itemprop="name">ACME Foldable Canoe</span>
<meta itemprop="category" content="Sporting Goods > Water Sports > Boating >
Canoeing > Canoes">
...
</div>

Offer

<div itemscope itemtype="http://purl.org/goodrelations/v1#Offering" itemid="#offer">
<div itemprop="name">Hepp Personal SCSI Controller Card</div>
<div itemprop="description">The Hepp Personal SCSI is a 16-bit
add-on card that allows attaching up to seven SCSI devices to your computer.</div>
<meta property="category" content="Electronics > Computers > Computer Components >
I/O Cards">
...
</div>

Mixing with other vocabularies

If you want to add the gr:category in Microdata to itemtypes from other vocabularies, you must use the full URI

   http://purl.org/goodrelations/v1#category


by Martin Hepp