Rdfa4google

From Wiki of the E-Business and Web Science Research Group

Jump to: navigation, search

Contents

Introduction

2010-02-25: If you use the Magento shop software, there is now a free extension to use GoodRelations for SEO automatically.

2009-12-16: Breaking news: It seems that Google is now showing GoodRelations price information in the search results!

2009-12-10: We removed the recipes using XML entity definitions for shortening the mark-up, because that is unlikely to work on a Web scale.

2009-10-30: You can see how your page would look like in Google+GoodRelations using the iGoogr application at http://igoogr.appspot.com/

2009-07-30: Changed all <div> elements in the RDFa parts to <span> in order to avoid extra blank lines in the rendering of such pages.


On this page, we describe proper patterns that can be used by companies for embedding

  • contact details,
  • opening hours,
  • individual products, and
  • pricing information

in their Web pages using the RDFa syntax and the GoodRelations vocabulary.

While Google has recently announced to consider RDFa meta-data for improved search results, details expressed using the GoodRelations vocabulary is currently not included in the output.

However, there are numerous innovative applications and services that will display GoodRelations meta-data if available.

The current main purpose of this page is

  • to allow Google staff to check that the proposed recipes for such data are compliant with all current Google content policies, and
  • to train Web designers and SEO experts in creating GoodRelations meta-data.


Overview

There are two ways of using RDFa with existing content:

a) Reusing existing text and values at their original position

Example:


...
<body>
<span property="vcard:tel" datatype="xsd:string">+49-89-6004-0</span>
</body>
...

b) Embedding additional meta-data in the same document, but detached from the human-readable content

Example:


...
<body>
<!-- Human-readable content -->
Phone: <span>+49-89-6004-0</span>
 
<!-- Rich meta-data -->
<span property="vcard:tel" datatype="xsd:string" content="+49-89-6004-0"></span>
...
</body>
 

The advantage of a) is that updating the human-readable content means automatically updating the associated meta-data. The downside is that mixing the data level and the presentation level can create complicated mark-up. Also, it is impossible to create generic tools that provide the mark-up for easy copy-and-paste.

The advantage of b) is that it is easy to create generic tools that provide the mark-up for easy copy-and-paste, which will help assist users in creating respective mark-up.

Describing a business and its opening hours

Example 1: Reusing existing text and values at their original position

http://www.heppnetz.de/rdfa4google/company.html
 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/>
    <title>Martin Hepp's Demo Page for Google+GoodRelations+RDFa: A Company or Shop</title>
  </head>
  <body xmlns:gr="http://purl.org/goodrelations/v1#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:vcard="http://www.w3.org/2006/vcard/ns#"
    xmlns:foaf="http://xmlns.com/foaf/0.1/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
    <p>This page is part of a demo of how a small business can feed its contact etc. descriptions into the Web of Linked Data, while staying compatible with Google.</p>
    <p>Provided by the E-Business & Web Science Research Group (Prof. Hepp) at Universitaet der Bundeswehr Muenchen,
      <a href="http://www.unibw.de/ebusiness/">www.unibw.de/ebusiness/</a>.
    </p>
<!-- Business Entity -->
    <div typeof="gr:BusinessEntity" about="#business">
<!-- Important Link from the data element to the Web page -->
      <span rel="rdfs:seeAlso" resource=""></span>
<!-- Company logo or picture -->
      <span rel="foaf:depiction">
        <img src="http://www.heppnetz.de/rdfa4google/logo.png" alt="Company Logo"/>
      </span>
      <br />
<!-- Company Name -->
      <span property="rdfs:label vcard:fn gr:legalName">Hepp Space Ventures Inc.</span>
      <br />Hepp Space Ventures Inc. is a non-existent corporation made up for the purpose of this example.
<!-- Address details of the company and the shop -->
      <br />Address of our main office:
      <div rel="vcard:adr">
        <div typeof="vcard:Address" about="#address">
          <span property="vcard:street-address">1234 Hepp Road</span>,
          <span property="vcard:postal-code" datatype="xsd:string">85577</span>
          <span property="vcard:locality">Neubiberg</span>,
          <span property="vcard:region">Bavaria</span>,
          <span property="vcard:country-name">Germany</span>.
        </div>
      </div>
      Phone: <span property="vcard:tel" datatype="xsd:string">+49-89-6004-0</span>
<!-- OPTIONAL (but useful): Geo position of the office -->
      <div rel="vcard:geo">
        <span property="vcard:latitude" datatype="xsd:float" content="48.0802626"></span>
        <span property="vcard:longitude" datatype="xsd:float" content="11.6407428"></span>
      </div>
<!-- Link to the main Web page -->
      Web: <a rel="vcard:url rdfs:seeAlso" href="http://www.heppnetz.de/">www.heppnetz.de</a>
      <br />
<!-- The following line achieves Web + Semantic Web compatibility -->
      <div rel="gr:offers" resource="http://www.heppnetz.de/rdfa4google/product.html#myoffer"></div>
      <div rel="gr:hasPOS">
        <div typeof="gr:LocationOfSalesOrServiceProvisioning" about="#myshop">
<!-- Address details of the company and the shop are the same, so simply link back to the address from above -->
          <div rel="vcard:adr" resource="#address"></div>
<!-- OPTIONAL (but useful): Geo position of the shop - in this example the same as for the office -->
          <div rel="vcard:geo">
            <span property="vcard:latitude" datatype="xsd:float" content="48.0802626"></span>
            <span property="vcard:longitude" datatype="xsd:float" content="11.6407428"></span>
          </div>
<!-- Opening hours specification -->
          <br />
          <span property="rdfs:comment">Opening Hours: Mon-Fri 10-6, Sat 10-4.30</span>
<!-- Structured opening hours specification using GoodRelations -->
          <div rel="gr:hasOpeningHoursSpecification">
            <div typeof="gr:OpeningHoursSpecification" about="#workdays">
              <span property="gr:opens" datatype="xsd:time" content="10:00:00"></span>
              <span property="gr:closes" datatype="xsd:time" content="18:00:00"></span>
              <div rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Monday"></div>
              <div rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Tuesday"></div>
              <div rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Wednesday"></div>
              <div rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Thursday"></div>
              <div rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Friday"></div>
            </div>
          </div>
          <br />
          <div rel="gr:hasOpeningHoursSpecification">
            <div typeof="gr:OpeningHoursSpecification" about="#saturdays">
              <span property="gr:opens" datatype="xsd:time" content="10:00:00"></span>
              <span property="gr:closes" datatype="xsd:time" content="16:30:00"></span>
              <div rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Saturday"></div>
            </div>
            <br />
          </div>
        </div>
      </div>
      <a href="http://www.heppnetz.de/rdfa4google/product.html">Link to Personal SCSI offer</a>
    </div>
 
  </body>
</html>
 
 

Example 2: Embedding additional meta-data in the same document, but detached from the human-readable content

http://www.heppnetz.de/rdfa4google/company-tool.html

 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/>
    <title>Martin Hepp's Demo Page for Google+GoodRelations+RDFa: A Company or Shop - Machine-based</title>
  </head>
  <body>
    <p>This page is part of a demo of how a small business can feed its contact etc. descriptions into the Web of Linked Data,
       while staying compatible with Google.</p>
    <p>Provided by the E-Business & Web Science Research Group (Prof. Hepp) at Universitaet der Bundeswehr Muenchen,
      <a href="http://www.unibw.de/ebusiness/">www.unibw.de/ebusiness/</a>.
    </p>
    <div>
<!-- Company logo or picture -->
      <img src="http://www.heppnetz.de/rdfa4google/logo.png" alt="Company Logo"/>
      <br />
<!-- Company Name -->
      <span>Hepp Space Ventures Inc.</span><br />
      Hepp Space Ventures Inc. is a non-existent corporation made up for the purpose of this example.
<!-- Address details of the company and the shop -->
      <br />Address of our main office:<br />
      <span>1234 Hepp Road</span>,
      <span>85577</span><span> Neubiberg</span>,
      <span>Bavaria</span>,
      <span>Germany</span>.<br />
      Phone: <span>+49-89-6004-0</span>
<!-- Link to the main Web page -->
      <br />
      Web: <a href="http://www.heppnetz.de/">www.heppnetz.de</a><br />
<!-- Opening Hour Specification -->
      <br />Opening Hours: <span>Mon-Fri 10-6, Sat 10-4.30</span><br />
      <a href="http://www.heppnetz.de/rdfa4google/product.html">Link to Personal SCSI offer</a>
     </div>
<!--
  *********************************************************************
     All meta-data in a separate block - easier to create by a tool
  *********************************************************************
-->
    <div xmlns:gr="http://purl.org/goodrelations/v1#"
      xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
      xmlns:vcard="http://www.w3.org/2006/vcard/ns#"
      xmlns:foaf="http://xmlns.com/foaf/0.1/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
<!-- Business Entity -->
      <span typeof="gr:BusinessEntity" about="#business">
<!-- Important Link from the data element to the Web page -->
        <span rel="rdfs:seeAlso" resource=""></span>
<!-- Company logo or picture -->
        <span rel="foaf:depiction" resource="http://www.heppnetz.de/rdfa4google/logo.png"></span>
<!-- Company Name -->
        <span property="rdfs:label vcard:fn gr:legalName" content="Hepp Space Ventures Inc."></span>
<!-- Address details of the company and the shop -->
        <span rel="vcard:adr">
          <span typeof="vcard:Address" about="#address">
            <span property="vcard:street-address" content="1234 Hepp Road"></span>
            <span property="vcard:postal-code" datatype="xsd:string" content="85577"></span>
            <span property="vcard:locality" content="Neubiberg"></span>
            <span property="vcard:region" content="Bavaria"></span>
            <span property="vcard:country-name" content="Germany"></span>
          </span>
        </span>
        <span property="vcard:tel" datatype="xsd:string" content="+49-89-6004-0"></span>
<!-- OPTIONAL (but useful): Geo position of the office -->
        <span rel="vcard:geo">
          <span property="vcard:latitude" datatype="xsd:float" content="48.0802626"></span>
          <span property="vcard:longitude" datatype="xsd:float" content="11.6407428"></span>
        </span>
<!-- Link to the main Web page -->
        <span rel="vcard:url rdfs:seeAlso" resource="http://www.heppnetz.de/"></span>
<!-- The following line achieves Web + Semantic Web compatibility -->
        <span rel="gr:offers" resource="http://www.heppnetz.de/rdfa4google/product.html#myoffer"></span>
        <span rel="gr:hasPOS">
          <span typeof="gr:LocationOfSalesOrServiceProvisioning" about="#myshop">
<!-- Address details of the company and the shop are the same, so simply link back to the address from above -->
            <span rel="vcard:adr" resource="#address"></span>
<!-- OPTIONAL (but useful): Geo position of the shop - in this example the same as for the office -->
            <span rel="vcard:geo">
              <span property="vcard:latitude" datatype="xsd:float" content="48.0802626"></span>
              <span property="vcard:longitude" datatype="xsd:float" content="11.6407428"></span>
            </span>
<!-- Opening hours specification -->
            <span property="rdfs:comment" content="Opening Hours: Mon-Fri 10-6, Sat 10-4.30"/>
<!-- Structured opening hours specification using GoodRelations -->
            <span rel="gr:hasOpeningHoursSpecification">
              <span typeof="gr:OpeningHoursSpecification" about="#workdays">
                <span property="gr:opens" datatype="xsd:time" content="10:00:00"></span>
                <span property="gr:closes" datatype="xsd:time" content="18:00:00"></span>
                <span rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Monday"></span>
                <span rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Tuesday"></span>
                <span rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Wednesday"></span>
                <span rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Thursday"></span>
                <span rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Friday"></span>
              </span>
            </span>
            <span rel="gr:hasOpeningHoursSpecification">
              <span typeof="gr:OpeningHoursSpecification" about="#saturdays">
                <span property="gr:opens" datatype="xsd:time" content="10:00:00"></span>
                <span property="gr:closes" datatype="xsd:time" content="16:30:00"></span>
                <span rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Saturday"></span>
              </span>
            </span>
          </span>
        </span>
      </span>
    </div>
  </body>
</html>
 
 

Describing a product and its pricing

In the following we show how product details and prices can be embedded as additional meta-data in the same document, but detached from the human-readable conten.

For describing products, this approach is often a lot simpler, because the order and structure of the presentation is often quite different from the underlying data.

The file is available on the Web at

http://www.heppnetz.de/rdfa4google/product.html

 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/>
    <title>Martin Hepp's Demo Page for Google+GoodRelations+RDFa: A Product Detail Page</title>
  </head>
  <body>
    <p>This page is part of a demo of how a small business can feed its product and offer descriptions into the Web of Linked Data,
    while staying compatible with Google.</p>
    <p>Provided by the E-Business & Web Science Research Group (Prof. Hepp) at Universitaet der Bundeswehr Muenchen,
      <a href="http://www.unibw.de/ebusiness/">www.unibw.de/ebusiness/</a>.
    </p>
<!-- Human-readable content -->
    <div>
      Price: <span>34.99 </span><span>USD</span><br />
      Product Name:<span> Personal SCSI 16-bit SCSI Controller</span>
      <br />Description:
      <span>This low-cost, high-performance SCSI controller allows you to connect up to
        seven professional mass-storage devices to your computer.</span><br />
        EAN/UPC code: <span>0000010363780</span><br />
        Article number: <span>10363780</span><br />
<!-- Product image -->
      <img src="http://www.heppnetz.de/rdfa4google/pscsi.jpg" alt="Product Image"/>
<!-- OPTIONAL: Reviews of the product, not the seller! -->
      <br />Product Reviews:
      <br />Average:
      <span>4.5</span>, lowest:
      <span>0</span>, highest:
      <span>5</span> (total number of reviews:
      <span>45</span>)<br />
      <a href="http://www.heppnetz.de/rdfa4google/company.html">Link to the main company page</a><br />
      <a href="http://www.heppnetz.de/rdfa4google/company-tool.html">Link to the main company page (tool-variant)</a><br />
    </div>
 
<!--
*********************************************************************
 All RDFa meta-data in a separate block - easier to create by a tool
*********************************************************************
-->
    <div
      xmlns:gr="http://purl.org/goodrelations/v1#"
      xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
      xmlns:vcard="http://www.w3.org/2006/vcard/ns#"
      xmlns:foaf="http://xmlns.com/foaf/0.1/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
      xmlns:review="http://purl.org/stuff/rev#">
      <span typeof="gr:Offering" about="#myoffer">
<!-- The following line achieves Web + Semantic Web compatibility -->
        <span rev="gr:offers" resource="http://www.heppnetz.de/rdfa4google/company.html#business"></span>
        <span rev="gr:offers" resource="http://www.heppnetz.de/rdfa4google/company-tool.html#business"></span>
<!-- Important link from the data element to this Web page -->
        <span rel="rdfs:seeAlso" resource=""></span>
<!-- Validity of the Offer -->
        <span property="gr:validFrom" datatype="xsd:dateTime" content="2009-07-20T00:00:00Z"></span>
        <span property="gr:validThrough" datatype="xsd:dateTime" content="2010-07-20T00:00:00Z"></span>
<!-- Business Function: SELL -->
        <span rel="gr:hasBusinessFunction" resource="http://purl.org/goodrelations/v1#Sell"></span>
<!-- Price specification -->
        <span rel="gr:hasPriceSpecification">
          <span typeof="gr:UnitPriceSpecification" about="#UnitPriceSpecification"></span>
          <span property="gr:hasCurrencyValue" datatype="xsd:float" content="34.99"></span>
          <span property="gr:hasCurrency" datatype="xsd:string" content="USD"></span>
        </span>
<!-- The following line achieves Web + Semantic Web compatibility -->
        <span rel="gr:availableAtOrFrom" resource="http://www.heppnetz.de/rdfa4google/company.html#myshop"></span>
        <span rel="gr:availableAtOrFrom" resource="http://www.heppnetz.de/rdfa4google/company-tool.html#myshop"></span>
        <span rel="gr:includesObject">
          <span typeof="gr:TypeAndQuantityNode" about="#TypeAndQuantityNode">
            <span property="gr:amountOfThisGood" datatype="xsd:float" content="1.0"></span>
            <span property="gr:hasUnitOfMeasurement" datatype="xsd:string" content="C62"></span>
            <span rel="gr:typeOfGood">
              <span typeof="product:Product gr:ProductOrServicesSomeInstancesPlaceholder" about="#product">
<!-- Important Link from the data element to this Web page -->
                <span rel="rdfs:seeAlso" resource=""></span>
                <span property="rdfs:label" content="Personal SCSI 16-bit SCSI Controller"></span>
                <span property="rdfs:comment" content="This low-cost, high-performance SCSI controller allows you to connect up to seven professional mass-storage devices to your computer."></span>
                <span property="gr:hasEAN_UCC-13" datatype="xsd:string" content="0000010363780"></span>
                <span property="gr:hasStockKeepingUnit" datatype="xsd:string" content="10363780"></span>
<!-- Product image -->
                <span rel="foaf:depiction" resource="http://www.heppnetz.de/rdfa4google/pscsi.jpg"></span>
<!-- OPTIONAL: Reviews of the product, not the seller! -->
              <span rel="review:hasReview">
                <span typeof="review:Review">
                  <span property="review:rating" datatype="xsd:float" content="4.5"></span>
                  <span property="review:minRating" datatype="xsd:integer" content="0"></span>
                  <span property="review:maxRating" datatype="xsd:integer" content="5"></span>
                  <span property="review:totalRatings" datatype="xsd:integer" content="45"></span>
                </span>
              </span>
            </span>
          </span>
        </span>
      </span>
    </span>
  </div>
</body>
</html>
 

Getting less verbose mark-up

As per request by Google, we tried to simplify and shorten the recommended mark-up. This sections gives some examples on how that can be achieved.

Opening Hours in Tabular Form

http://www.heppnetz.de/rdfa4google/openinghours.html

a) XHTML+RDFa
 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/>
    <title>Martin Hepp's Demo Page for Google+GoodRelations+RDFa: Opening Hours</title>
  </head>
  <body xmlns:gr="http://purl.org/goodrelations/v1#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:vcard="http://www.w3.org/2006/vcard/ns#"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
    <p>This page is part of a demo of how a small business can feed its contact etc. descriptions into the Web of Linked Data, while staying compatible with Google.</p>
    <p>Provided by the E-Business & Web Science Research Group (Prof. Hepp) at Universitaet der Bundeswehr Muenchen,
      <a href="http://www.unibw.de/ebusiness/">www.unibw.de/ebusiness/</a>.
    </p>
<!-- Business Entity -->
    <div typeof="gr:BusinessEntity" about="#business">
<!-- Important Link from the data element to the Web page -->
      <span rel="rdfs:seeAlso" resource=""></span>
      <span property="rdfs:label vcard:fn gr:legalName">Hepp Space Ventures Inc.</span>
      <br />Hepp Space Ventures Inc. is a non-existent corporation made up for the purpose of this example.
      Phone: <span property="vcard:tel" datatype="xsd:string">+49-89-6004-0</span>
<!-- OPTIONAL (but useful): Geo position of the office -->
      <div rel="vcard:geo">
        <span property="vcard:latitude" datatype="xsd:float" content="48.0802626"></span>
        <span property="vcard:longitude" datatype="xsd:float" content="11.6407428"></span>
      </div>
<!-- Link to the main Web page -->
      Web: <a rel="vcard:url rdfs:seeAlso" href="http://www.heppnetz.de/">www.heppnetz.de</a>
      <br />
      <div rel="gr:hasPOS">
        <div typeof="gr:LocationOfSalesOrServiceProvisioning" about="#myshop">Fort Myers Beach Shop
          <br /><br />
<!-- Opening hours specification -->
          <div rel="gr:hasOpeningHoursSpecification"><b>Opening Hours:</b>
            <table border="1">
            <tr typeof="gr:OpeningHoursSpecification" about="#mon">
            <td rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Monday">Mondays</td>
            <td property="gr:opens" datatype="xsd:time" content="08:00:00">08:00</td>
            <td property="gr:closes" datatype="xsd:time" content="18:00:00">18:00</td>
            </tr>
            <tr typeof="gr:OpeningHoursSpecification" about="#tue">
            <td rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Tuesday">Tuesdays</td>
            <td property="gr:opens" datatype="xsd:time" content="08:00:00">08:00</td>
            <td property="gr:closes" datatype="xsd:time" content="18:00:00">18:00</td>
            </tr>
            <tr typeof="gr:OpeningHoursSpecification" about="#wed">
            <td rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Wednesday">Wednesdays</td>
            <td property="gr:opens" datatype="xsd:time" content="08:00:00">08:00</td>
            <td property="gr:closes" datatype="xsd:time" content="14:00:00">14:00</td>
            </tr>
            <tr typeof="gr:OpeningHoursSpecification" about="#thu">
            <td rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Thursdays">Thursdays</td>
            <td property="gr:opens" datatype="xsd:time" content="08:00:00">08:00</td>
            <td property="gr:closes" datatype="xsd:time" content="18:00:00">18:00</td>
            </tr>
            <tr typeof="gr:OpeningHoursSpecification" about="#fri">
            <td rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Friday">Fridays</td>
            <td property="gr:opens" datatype="xsd:time" content="08:00:00">08:00</td>
            <td property="gr:closes" datatype="xsd:time" content="20:00:00">20:00</td>
            </tr>
            <tr typeof="gr:OpeningHoursSpecification" about="#sat">
            <td rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Saturday">Saturdays</td>
            <td property="gr:opens" datatype="xsd:time" content="09:00:00">09:00</td>
            <td property="gr:closes" datatype="xsd:time" content="15:00:00">15:00</td>
            </tr>
            </table>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>
 

b) N3

@prefix gr: <http://purl.org/goodrelations/v1#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix vcard: <http://www.w3.org/2006/vcard/ns#> .
@prefix xhv: <http://www.w3.org/1999/xhtml/vocab#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .


<http://www.heppnetz.de/rdfa4google/openinghours.html#business> a gr:BusinessEntity ;
     rdfs:label "Hepp Space Ventures Inc."@en ;
     gr:hasPOS <http://www.heppnetz.de/rdfa4google/openinghours.html#myshop> ;
     gr:legalName "Hepp Space Ventures Inc."@en ;
     rdfs:seeAlso <http://www.heppnetz.de/>, <http://www.heppnetz.de/rdfa4google/openinghours.html> ;
     vcard:fn "Hepp Space Ventures Inc."@en ;
     vcard:geo
         [ vcard:latitude "48.0802626"^^xsd:float ;
             vcard:longitude "11.6407428"^^xsd:float
         ] ;
     vcard:tel "+49-89-6004-0"^^xsd:string ;
     vcard:url <http://www.heppnetz.de/> .

<http://www.heppnetz.de/rdfa4google/openinghours.html#fri> a gr:OpeningHoursSpecification ;
     gr:closes "20:00:00"^^xsd:time ;
     gr:hasOpeningHoursDayOfWeek gr:Friday ;
     gr:opens "08:00:00"^^xsd:time .

<http://www.heppnetz.de/rdfa4google/openinghours.html#mon> a gr:OpeningHoursSpecification ;
     gr:closes "18:00:00"^^xsd:time ;
     gr:hasOpeningHoursDayOfWeek gr:Monday ;
     gr:opens "08:00:00"^^xsd:time .

<http://www.heppnetz.de/rdfa4google/openinghours.html#myshop> a gr:LocationOfSalesOrServiceProvisioning ;
     gr:hasOpeningHoursSpecification
         <http://www.heppnetz.de/rdfa4google/openinghours.html#fri>,
         <http://www.heppnetz.de/rdfa4google/openinghours.html#mon>,
         <http://www.heppnetz.de/rdfa4google/openinghours.html#sat>,
         <http://www.heppnetz.de/rdfa4google/openinghours.html#thu>,
         <http://www.heppnetz.de/rdfa4google/openinghours.html#tue>,
         <http://www.heppnetz.de/rdfa4google/openinghours.html#wed> .

<http://www.heppnetz.de/rdfa4google/openinghours.html#sat> a gr:OpeningHoursSpecification ;
     gr:closes "15:00:00"^^xsd:time ;
     gr:hasOpeningHoursDayOfWeek gr:Saturday ;
     gr:opens "09:00:00"^^xsd:time .

<http://www.heppnetz.de/rdfa4google/openinghours.html#thu> a gr:OpeningHoursSpecification ;
     gr:closes "18:00:00"^^xsd:time ;
     gr:hasOpeningHoursDayOfWeek gr:Thursdays ;
     gr:opens "08:00:00"^^xsd:time .

<http://www.heppnetz.de/rdfa4google/openinghours.html#tue> a gr:OpeningHoursSpecification ;
     gr:closes "18:00:00"^^xsd:time ;
     gr:hasOpeningHoursDayOfWeek gr:Tuesday ;
     gr:opens "08:00:00"^^xsd:time .

<http://www.heppnetz.de/rdfa4google/openinghours.html#wed> a gr:OpeningHoursSpecification ;
     gr:closes "14:00:00"^^xsd:time ;
     gr:hasOpeningHoursDayOfWeek gr:Wednesday ;
     gr:opens "08:00:00"^^xsd:time .

Using ENTITY definitions

We tried to use ENTITY definitions to shorten the mark-up, but eventually discourage you to try that. The problem is that as soon as the page must be

  • proper XHTML 1.0 strict and
  • served and processed as application/xml

in order for the ENTITY definitons to be resolved properly. That is unlikely on a Web scale, so don't try it in practical settings. Use the regular examples from above.


If you still want to look into what we tried, here are the files:

Personal tools
Navigation