GoodRelations as part of schema.org

The GoodRelations Cookbook
Recipe GoodRelations as part of schema.org
Description Using GoodRelations from the schema.org namespace
Status mature
Level intermediate
Tags schema.org, microdata, seo, rdfa
See also Microdata, GoodRelations and schema.org


Breaking News - November 8, 2012:GoodRelations is the new, official e-commerce core for schema.org

For over a year now, we have been working with the schema.org sponsors, namely Google, Yahoo, Bing, and Yandex, on the integration of GoodRelations into the schema.org core. This will mean that you can use the full expressivity of GoodRelations directly from the schema.org namespace in Microdata syntax. Today, that addition has been officially published on the schema.org servers. This brings the full thrust of having the four biggest search engines behind it to the adoption of GoodRelations for exposing rich e-commerce data directly from shop pages and datasheets.

For more information on why this is important, see the article GoodRelations for Semantic SEO.

On this page, we will provide examples of this usage.

Note: Schema.org will be one additional syntactical form of using GoodRelations for your site. GoodRelations will remain an independent vocabulary, and usable in RDFa and other RDF syntaxes. The original namespace of GoodRelations will remain the primary location. In particular, consumers of GoodRelations data will be able to execute SPARQL queries using the original GoodRelations namespace and identifiers, because the next service release of GoodRelations will include all necessary mappings.

Motivation

We were looking for a way of making the rich GoodRelations conceptual model be usable as a direct extension of schema.org so that Webmasters would not have to choose between schema.org and GoodRelations but could instead use both the basic schema.org patterns and the advanced GoodRelations patterns from the same namespace.

Overview

The basic approach for the integration is as follows:

  • All GoodRelations classes and properties that do not yet exist in schema.org have been added to schema.org. For example, the GoodRelations class http://purl.org/goodrelations/v1#BusinessFunction becomes also a schema.org class with the identifier http://schema.org/BusinessFunction.
  • GoodRelations will include mapping axioms so that an RDF environment with minimal reasoning support (rdfs:subclassOf, rdfs:subPropertyOf, owl:equivalentClass, owl:equivalentProperty, owl:sameAs) can operate on the data purely from the GoodRelations namespace.
  • Enumerations, i.e. individuals/instances of GoodRelations will be used from the original GoodRelations namespace using the schema.org extension mechanism for external enumerations. This reduces the amount of entries that have to be added to schema.org. A list of the respective GoodRelations elements is here.
  • For a few classes and properties, the local part of the name may differ in the schema.org namespace. This was necessary in order to keep a consistent naming convention in schema.org. The names in GoodRelations remain unchanged to avoid breaking older data and older clients. A list of naming differences will be provided on this page.
  • For legal reasons, schema.org cannot contain elements for modeling licensing conditions, because site-owners may try to use them to express complex licensing terms for the use of their content by search engines, which cannot be properly handled by Web-scale crawlers. Thus, the class gr:License from GoodRelations is not available from the schema.org namespace. If you want to use gr:License, use GoodRelations in its original namespace or use the additionalType property in combination with the full URI http://purl.org/goodrelations/v1#Licenseand the main itemtype http://schema.org/BusinessFunction.
  • The upcoming GoodRelations class gr:PropertyValue and the dependent properties gr:feature, gr:propertyName, gr:propertyValue, and gr:unitText will likely not be included in the first release of the integration.
  • The gr:category is not included in the first integration step.

Examples

Offer with Delivery Charges and Business Function

The following example shows how an entity of type http://schema.org/Offer can be augmented using the granular pricing elements of GoodRelations for indicating shipping charges. It also shows the usage of business functions that define the bundle of rights you will obtain on the product.

<div itemscope itemtype="http://schema.org/Offer" 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>
<link itemprop="businessFunction"
href="http://purl.org/goodrelations/v1#Sell" />
<!-- Unit price -->
<div itemscope itemprop="priceSpecification"
itemtype="http://schema.org/UnitPriceSpecification">Price:
<meta itemprop="priceCurrency" content="EUR">Euro:
<span itemprop="price">99.99</span>
<time itemprop="validThrough"
datetime="2012-11-30T23:59:59Z"></time>
</div>
<!-- Shipment fees -->
Delivery costs to
<div itemscope itemprop="priceSpecification"
itemtype="http://schema.org/DeliveryChargeSpecification">
<meta itemprop="eligibleRegion" content="DE">Germany:
<meta itemprop="priceCurrency" content="EUR">Euro:
<span itemprop="price">10.00</span>
<link itemprop="appliesToDeliveryMethod"
href="http://purl.org/goodrelations/v1#UPS" />(via UPS)
</div>
<!-- other offer properties follow here -->
...
</div>

Observe the following details:

1. Some property names differ slightly between the GoodRelations namespace and the schema.org namespace:

GoodRelations schema.org
hasBusinessFunction businessFunction
hasCurrency priceCurrency
hasCurrencyValue price
hasPriceSpecification priceSpecification

2. The enumerations, i.e. the instances of the classes like gr:BusinessFunction and gr:DeliveryMethod are used directly from the GoodRelations namespace. Since schema.org does typically not define lists of enumerations, that seems like the favorite way of adding support for those. So instead of http://schema.org/Sell, as one may assume:

<div itemscope itemtype="http://schema.org/Offer" itemid="#offer">
...
<link itemprop="businessFunction" href="http://schema.org/Sell" />

we use http://purl.org/goodrelations/v1#Sell for such enumerations.

<div itemscope itemtype="http://schema.org/Offer" itemid="#offer">
<link itemprop="businessFunction" href="http://purl.org/goodrelations/v1#Sell" />

Rent Videos for 30 days

We use http://schema.org/Movie with the business function LeaseOut and the validity of the lease will be encoded using the eligibleDuration property:

<!-- Some copies of that title -->
<div itemprop="about" itemscope itemtype="http://schema.org/Movie" itemid="#video">
<link itemprop="type" href="http://schema.org/SomeProducts" />
<h1 itemprop="name">Pirates of the Carribean: On Stranger Tides (2011)</h1>
<span itemprop="description">Jack Sparrow and Barbossa embark on a quest to
find the elusive fountain of youth, only to discover that Blackbeard and
his daughter are after it too.</span>
<a itemprop "model" href="http://www.imdb.com/title/tt0325980/">
More information on imdb.com</a>
<!-- The offer to sell a copy of the video -->
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<link itemprop="businessFunction" href="http://purl.org/goodrelations/LeaseOut" />
Price: <div itemprop="priceSpecification" itemscope
itemtype="http://schema.org/UnitPriceSpecification">$
<span itemprop="price">3.99</span>
<meta itemprop="priceCurrency" content="USD">
<time itemprop="validThrough"
datetime="2012-12-31T23:59:59Z"></time>
</div>
Delivery: <link itemprop="availableDeliveryMethod"
href="http://purl.org/goodrelations/v1#DirectDownload" /> Download
Validity of the lease: <div itemprop="eligibleDuration" itemscope
itemtype="http://schema.org/QuantitativeValue">
<span itemprop="value">30</span>-
<meta itemprop="unitCode" content="DAY" >days
</div>
</div>

Naming Differences

Classes

  • schema:Offer = gr:Offering
  • schema:IndividualProduct = gr:Individual
  • schema:ParcelService = gr:DeliveryModeParcelService
  • schema:Place = gr:Location
  • schema:ProductModel = gr:ProductOrServiceModel
  • schema:CreditCard = gr:PaymentMethodCreditCard
  • schema:Product = gr:ProductOrService
  • schema:SomeProducts = gr:SomeItems

Object Properties

  • schema:priceSpecification = gr:hasPriceSpecification
  • schema:businessFunction = gr:hasBusinessFunction
  • schema:eligibleCustomerType = gr:eligibleCustomerTypes
  • schema:manufacturer = gr:hasManufacturer
  • schema:warrantyScope = gr:hasWarrantyScope
  • schema:inventoryLevel = gr:hasInventoryLevel
  • schema:dayOfWeek = gr:hasOpeningHoursDayOfWeek
  • schema:brand = gr:hasBrand
  • schema:itemOffered = gr:includes
  • schema:makesOffer = gr:offers
  • schema:availableDeliveryMethod = gr:availableDeliveryMethods
  • schema:openingHoursSpecification = gr:hasOpeningHoursSpecification
  • schema:eligibleQuantity = gr:hasEligibleQuantity
  • schema:warranty = gr:hasWarrantyPromise
  • schema:image = http://xmlns.com/foaf/0.1/depiction
  • schema:acceptedPaymentMethod = gr:acceptedPaymentMethods

A special case is

  • schema:durationOfWarranty

This used to be gr:durationOfWarrantyInMonths in GoodRelations but will be updated to match the new name and range from schema.org shortly.

Datatype Properties

  • schema:minPrice = gr:hasMinCurrencyValue
  • schema:unitCode = gr:hasUnitOfMeasurement
  • schema:isicV4 = gr:hasISICv4
  • schema:gtin8 = gr:hasGTIN-8
  • schema:maxPrice = gr:hasMaxCurrencyValue
  • schema:gtin14 = gr:hasGTIN-14
  • schema:maxValue = gr:hasMaxValue
  • schema:mpn = gr:hasMPN
  • schema:value = gr:hasValue
  • schema:model = gr:hasMakeAndModel
  • schema:gtin13 = gr:hasEAN_UCC-13
  • schema:globalLocationNumber = gr:hasGlobalLocationNumber
  • schema:naics = gr:hasNAICS
  • schema:priceCurrency = gr:hasCurrency
  • schema:sku = gr:hasStockKeepingUnit
  • schema:duns = gr:hasDUNS
  • schema:minValue = gr:hasMinValue
  • schema:eligibleRegion = gr:eligibleRegions

Other Differences

  • The offers property has a different meaning in schema.org, since it links from the product to respective offers, while in GoodRelations, it links from a gr:BusinessEntity to its offers.

Additional Materials

Links: