3

The GoodRelations Web site gives a short example on how to extend schema.org with GoodRelations classes and properties.

Unfortunately, the example markup is not valid when testing it with the Google Structured Data Testing Tool.

For this code snippet given as example, the properties "hasBusinessFunciton" and "haspriceSpecification" are not recognized for the "Offer" type.

 <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="http://purl.org/goodrelations/v1#hasBusinessFunction"
    href="http://purl.org/goodrelations/v1#Sell" />
    <!-- Shipment fees -->
  Delivery costs to
      <div itemscope itemprop="http://purl.org/goodrelations/v1#hasPriceSpecification"
   itemtype="http://purl.org/goodrelations/v1#DeliveryChargeSpecification">
    <meta itemprop="eligibleRegions" content="DE">Germany:
    <meta itemprop="hasCurrency" content="EUR">Euro:
    <span itemprop="hasCurrencyValue">10.00</span>
    <link itemprop="appliesToDeliveryMethod"
      href="http://purl.org/goodrelations/v1#UPS" />(via UPS)
  </div>
<!-- other offer properties follow here -->
...
</div>

Is there some working example of schema.org extended with GoodRelations properties ?

What about using http://wiki.goodrelations-vocabulary.org/Cookbook/Vehicles in schema.org

Cheers

2 Answers 2

4

The reason for this is that the examples on the GoodRelations site are not yet updated to reflect the integration of GoodRelations into schema.org (simply because I did not yet manage to do that).

In order to understand this, you need to look at the history of GoodRelations:

http://wiki.goodrelations-vocabulary.org/History

GR started as an independent Web vocabulary ("ontology") and was designed to be used in RDFa or other RDF-syntaxes (like RDF/XML, Turtle, ...).

In 2009, Yahoo started to honor GoodRelations in RDFa syntax, and in 2012 Google followed. Note that this all happened in the original GoodRelations namespace, i.e. with identifiers like

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

After the announcement of schema.org in 2011, I worked with Google, Bing, and Yahoo to integrate GoodRelations into schema.org, which was completed and released in 2012.

This meant that (almost) any element from GoodRelations would now also be part of schema.org. So GoodRelations is now the official, extended e-commerce model of schema.org.

The result is that every GoodRelations element has now TWO identifiers:

a) the original one, like http://purl.org/goodrelations/v1#OpeningHoursSpecification

b) the one in schema.org, like http://schema.org/OpeningHoursSpecification

In some cases, the local part of the names differs between the original GoodRelations namespace and the derived version of in the schema.org namespace, in order to be consistent with the existing naming conventions in schema.org, or because a similar element had existed before.

For instance, an "Offer" is

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

in the original GoodRelations version, but

http://schema.org/Offer 

in schema.org. But the two are the same conceptual element.

For a full list of naming differences, see

http://wiki.goodrelations-vocabulary.org/Cookbook/Schema.org#Naming_Differences

Now here comes the tricky part:

  1. GoodRelations is supported by Google and Yahoo in its original namespace in RDFa syntax, but only in the schema.org namespace in Microdata or JSON-LD, and the support in its original namespace may be a bit out of date.

  2. For enumerations (individuals), the original namespace remains the official one, i.e. all elements from http://www.heppnetz.de/ontologies/goodrelations/v1.html#individuals remain valid in the http://purl.org/goodrelations/v1# ... namespace, e.g. http://purl.org/goodrelations/v1#Cash.

This was chosen because we could reduce the number of new elements for schema.org by keeping the identifiers for values in the original namespace.

So when you are using GoodRelations for search engines, you should use it in the schema.org namespace. The http://purl.org/goodrelations/v1# ... namespace keeps being functional for RDF / Linked Data / SPARQL-based projects.

In the future (likely this year), there will be service update in GoodRelations which will provide

  • updated examples to reflect this properly and
  • mapping axioms so that Semantic Web applications will see the equivalences.

Hope that helps!

Best wishes

Martin Hepp http://www.heppnetz.de

2
  • For the record: This text of mine is taken from an upcoming publication of mine. Just to counter self-plagiarism claims ;-) Apr 16, 2015 at 12:51
  • As for the second part of the question: For vehicles, a derived extension proposal is currently under review by schema.org. You can already preview it here: sdo-property-value-and-cars.appspot.com/Car. More background information on the proposal is here: w3.org/wiki/WebSchemas/Vehicles. Apr 16, 2015 at 21:59
1

This example is valid Microdata, and also appropriate use of the Schema.org vocabulary.

Google’s Testing Tool is not a validator. It only checks structured data according to Google’s own rules, e.g. what they recognize, or for showing their Rich Snippets.

What’s happening in this snippet: the two properties (http://purl.org/goodrelations/v1#hasPriceSpecification and http://purl.org/goodrelations/v1#hasBusinessFunction) are specified as absolute URLs, which is one of the four valid ways how to provide properties in Microdata.

However, note that Microdata has only limited support for mixing vocabularies. RDFa is way more powerful in that regard. (Related: differences between Microdata and RDFa.)

With RDFa, the snippet could look like this (keeping the same HTML):

<div typeof="schema:Offer" resource="#offer">

  <div property="schema:name">Hepp Personal SCSI Controller Card</div>
  <div property="schema:description">The Hepp Personal SCSI is …</div>
  <link property="gr:hasBusinessFunction" href="http://purl.org/goodrelations/v1#Sell" />

  Delivery costs to
  <div property="gr:hasPriceSpecification" typeof="gr:DeliveryChargeSpecification">
    <meta property="gr:eligibleRegions" content="DE" />Germany:
    <meta property="gr:hasCurrency" content="EUR" />Euro:
    <span property="gr:hasCurrencyValue">10.00</span>
    <link property="gr:appliesToDeliveryMethod" href="http://purl.org/goodrelations/v1#UPS" />(via UPS)
  </div>

</div>

(Making use of the prefixes schema, for the Schema.org vocabulary, and gr, for the GoodRelations vocabulary, which are defined in the RDFa Core Initial Context.)

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.