Warning: This tool or project is no longer maintained and kept available only for archival purposes. Since GoodRelations and schema.org have evolved significantly in the past years, the current status available on this page is unlikely to function as expected. We take no responsibility for any damage caused by the use of this outdated work, to the extent legally possible.

Due to a lack of resources, we are unable to provide support for this project outside of consulting projects or sponsored research. Please contact us if you can contribute resources to update and enhance these resources.

GoodRelations - The Web Vocabulary for E-Commerce

This is the archive of the goodrelations dicussion list

GoodRelations is a standardized vocabulary for product, price, and company data that can (1) be embedded into existing static and dynamic Web pages and that (2) can be processed by other computers. This increases the visibility of your products and services in the latest generation of search engines, recommender systems, and other novel applications.

[goodrelations] RDFa pattern to display opening hours in a human-friendly way

Martin Hepp martin.hepp at ebusiness-unibw.org
Thu Jan 20 15:02:41 CET 2011

Hi all:

When you publish opening hours information with GoodRelations, you  
often want to display them in the form hh:mm to human readers in their  
browsers, e.g.

   Mondays: 08:00 - 14:00

but you have to use them in the form hh:mm:ss for RDFa, since seconds  
are a mandatory part of the datatype xsd:time .

This means that by default, you have to use the "content" attribute in  
order to produce a page that

- is valid and
- looks nice.


      <div property="gr:opens" content="08:00:00"  

For dynamic Web pages, this is also the recommended way of doing this.

If, however, you have static Web content or content edited by "lay  
people" in a WYSIWG editor, you usually want to make sure that  
updating the visible content will also update the RDFa data, in order  
to avoid that they may diverge, e.g.

      <div property="gr:opens" content="08:00:00"  

where the data says 8:00 a.m. and the Web page says 9:00 a.m.

One elegant way of solving this problem is to mark the seconds as  
invisible using an additional <span> element:

      <div property="gr:opens" datatype="xsd:time">08:00<span  

and to hide that part in the CSS:

<title>Untitled Document</title>
<style type="text/css">.hidden { display:none; }

Then, any change of the opening hour data in the visible form hh:mm  
will automatically update the RDFa data as well.

There are two risks associated with this:

- In a WYSIWYG editor, it is easy to delete the invisible span  
element. People editing the page should be advised to use overwrite  
mode, if possible.
- In the past, Google discouraged site owners to use invisible  
content. To our knowledge, the main effect of using hidden content  
right know is that Google will ignore the hidden part for indexing.  
However, it is not entirely impossible that Google will punish the  
massive use of hidden elements with a lower ranking.

 From a pure SEO perspective, using the "content" attribute is safer,  
but a data maintenance perspective may often recommend the pattern  
shown above if your page is a static one or CMS-based.

Best wishes

Martin Hepp

More information about the goodrelations mailing list