GoodRelations4ShopSoftware

This page is  stub; it will contain a recipe for adding GoodRelations rich meta-data to your shop software.

Recipe

Company Page

HTML/RDFa Template for Snippet

 ``
   ``
   ``
   ``
     ``
       ``
       ``
       ``
       ``
     ``

   ``

   ``
   ``

   ``

{% if duns %}

   ``

{% endif %} {% if gln %}

   ``

{% endif %} {% if isic %}

   ``

{% endif %} {% if naics %}

   ``

{% endif %}

  ``

RDFa Example for Snippet

 ``
   ``
   ``
   ``
     ``
       ``
       ``
       ``
       ``
     ``

   ``

   ``
   ``

   ``

   ``
   ``
   ``
   ``
  ``

Product Item Page: Minimal

HTML/RDFa Template for Snippet

 ``
   ``
   ``

{% if ean %} {% endif %}

   ``

   ``

   ``

   ``
     ``
       ``
       ``
   ``
     ``

   ``

   ``
   ``

{% for delivery_option in delivery_options %} {% endfor %} {% for payment_method in payment_methods %} {% endfor %}

   ``
 ``

RDFa Example for Snippet

 ``
   ``
   ``
   ``

   ``

   ``

   ``

   ``
     ``
       ``
       ``
   ``
     ``

   ``

   ``
   ``

   ``

   ``    ``

   ``
 ``


Product Item Page: Full

HTML/RDFa Template for Snippet

 ``
   ``
   ``

   ``
   ``

   ``

   ``
     ``
       ``
       ``
       ``
     ``

   ``

{% for delivery_option in delivery_options %}

   ``
     ``
       ``
       ``
       ``
       ``
       ``
     ``

   ``

{% endfor %}

   ``
   ``

{% for delivery_option in delivery_options %}

   ``

{% endfor %} {% for payment_method in payment_methods %}

   ``

{% endfor %}

   ``
 ``

 ``
   ``
   ``

   ``

   ``

{% if ean %}

   ``

{% endif %} {% if gtin14 %}

   ``

{% endif %} {% if sku %}

   ``

{% endif %} {% if manufacturer_uri %}

   ``

{% endif %} {% for consumable_uri in consumable_uris %}

   ``

{% endfor %} {% for accessory_uri in accessory_uris %}

   ``

{% endfor %}

   ``

   ``
     ``
       ``
       ``
     ``

   ``

 ``

RDFa Example for Snippet

 ``
   ``
   ``

   ``
   ``

   ``

   ``
     ``
       ``
       ``
   ``
     ``

   ``

   ``
     ``
       ``
       ``
       ``
       ``
   ``
     ``

   ``

   ``
   ``

   ``

   ``
   ``

   ``
 ``

 ``
   ``
   ``

   ``

   ``

   ``
   ``
   ``

   ``

   ``

   ``

   ``

   ``
     ``
       ``
       ``
     ``

   ``

 ``

Brands Page

HTML/RDFa Template for Snippet

{% for brand in brands %}

 ``
   ``
   ``
   ``

   ``
   ``
  ``

{% endfor %}

RDFa Example for Snippet

 ``
   ``
   ``
   ``

   ``
   ``
  ``

 ``
   ``
   ``
   ``

   ``
   ``
  ``


RDF/XML Data Dump

Template

 ``
   ``
   ``
   ``
   ``
   ``
   ``
     ``
       ``
       ``
       ``
       ``
     ``

   ``

   ``
   ``
   ``

{% if company_data.duns %}

   ``

{% endif %} {% if company_data.isic %}

   ``

{% endif %} {% if company_data.naics %}

   ``

{% endif %} {% if company_data.gln %}

   ``

{% endif %}

 ``

{% for product in product_data %}

   ``
       ``
   ``

     ``
       ``
       ``
       ``
       ``
       ``
       ``

       ``
         ``
           ``
           ``
           ``
         ``

       ``

   {% for delivery_option in product.delivery_options %}
       ``
       ``
         ``
           ``
           ``
           ``
           ``
           ``
         ``

       ``

   {% endfor %}
   {% for payment_method in product.payment_methods %}
       ``
   {% endfor %}
       ``
         ``
           ``
           ``
           ``
           ``
           ``
           ``
           ``
           ``

           ``
           ``
           ``
           ``

           ``
             ``
               ``
               ``
             ``

           ``

         ``
       ``
     ``
   {% for consumable_uri in product.consumable_uris %}
   ``
       ``
   ``

   {% endfor %}
   {% for accessory_uri in product.accessory_uris %}
   ``
       ``
   ``

   {% endfor %}

{% endfor %}

{% for brand in brand_data.brands %}

 ``
   ``
   ``
   ``
   ``
   ``
   ``
   ``
   ``
 ``

{% endfor %}

Example

 ``
   ``Best Purchase Electronics Shop Ltd.``
   ``Best Purchase Electronics Shop Ltd.``
   ``
   ``
   ``
   ``
     ``
       ``Munich``
       ``12345``
       ``Germany``
       ``Example Street 123``
     ``

   ``

   ``+49-89-6004-4217``
   ``
   ``

   ``012345678``

   ``5610``

   ``722110``

   ``1234567890123``

 ``

   ``
       ``
   ``

     ``
       ``Canon Rebel T2i (EOS 550D)``
       ``The Rebel T2i EOS 550D is Canon's top-of-the-line consumer digital SLR camera.

It can shoot up to 18 megapixel resolution photos and features an ISO range of 100-6400.

       ``
       ``2010-05-01T00:00:00Z``
       ``2010-05-07T23:59:59Z``
       ``

       ``
         ``
           ``EUR``
           ``true``
           ``899.00``
         ``

       ``

       ``
       ``
         ``
           ``de``
           ``EUR``
           ``true``
           ``10.00``
           ``
         ``

       ``

       ``

       ``

       ``
         ``
           ``
           ``
           ``Canon Rebel T2i (EOS 550D)``
           ``The Rebel T2i EOS 550D is Canon's top-of-the-line consumer digital SLR camera.

It can shoot up to 18 megapixel resolution photos and features an ISO range of 100-6400.

           ``
           ``
           ``
           ``

           ``013803123784``
           ``CANON_EOS550D-KIT``
           ``0013803123784``
           ``

           ``
             ``
               ``C62``
               ``9``
             ``

           ``

         ``
       ``
     ``

   ``
       ``
   ``

   ``
       ``
   ``

 ``
   ``
   ``
   ``
   ``
   ``
   ``Canon Europe Ltd.``
   ``
   ``Canon Europe Ltd.``
 ``

 ``
   ``
   ``
   ``
   ``
   ``
   ``International Business Machines Inc.``
   ``
   ``International Business Machines Inc.``
 ``

Sitemap with Semantic Sitemap Extension

Sitemap Template

{% for uri in uris %}

  ``
     ``
     ``
     ``
     ``0.8``
  ``

{% endfor %}


   ``
   ``#dump``
   ``
   ``
   ``
   ``
   ``
 ``

Sitemap Example

  ``
     ``http:/www.heppnetz.de/gr4shops/index.html
     ``2010-05-28``
     ``daily``
     ``0.8``
  ``

  ``
     ``http:/www.heppnetz.de/gr4shops/brands.html
     ``2010-05-28``
     ``daily``
     ``0.8``
  ``

  ``
     ``http:/www.heppnetz.de/gr4shops/product_product-canon_eos550D-kit.html
     ``2010-05-28``
     ``daily``
     ``0.8``
  ``


   ``GoodRelations RDF Data Dump for http://www.heppnetz.de/gr4shops/
   ``http://www.heppnetz.de/gr4shops/goodrelations.rdf#dump
   ``http://www.heppnetz.de/gr4shops/product_product-canon_eos550D-kit.html
   ``http://www.heppnetz.de/gr4shops/index.html
   ``http://www.heppnetz.de/gr4shops/brands.html
   ``http://www.heppnetz.de/gr4shops/goodrelations.rdf
   ``daily``
 ``

Robots.txt with Sitemap Listing

User-agent: *
Disallow:
Sitemap: http://www.heppnetz.de/gr4shops/sitemap.xml

Updating the Page Headers

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">

<p>untitled</p>

   ``

Old materials, to be reviewed / incorporated up

Background

(but you may already know the "why it is important") - 15 min Web cast
http://www.slideshare.net/mhepp/a-short-introduction-to-semantic-webbased-ecommerce-the-goodrelations-vocabulary-presentation

How-to



a) Overview from an RDFa perspective:

See

http://www.ebusiness-unibw.org/wiki/GoodRelations_and_Yahoo_SearchMonkey
and
http://www.ebusiness-unibw.org/wiki/Rdfa4google

You can also experiment with the GoodRelations Annotator at

http://www.ebusiness-unibw.org/tools/goodrelations-annotator/

It will return an RDFa snippet for simple-copy-and-paste.


Main resource for developers: http://www.ebusiness-unibw.org/wiki/GoodRelations
*
III. Proposed Approach
*
We should have two types of support in your software:

a) Minimal template/form-based style for basic company information including opening hours etc. This would basically mean defining a template based on the Yahoo or Google patterns from above.

That should be available in the default shop app package, because every shop owner in the world will benefit from it - the small hairdresser shop same as every restaurant.

Ideally, we would bundle a variant of the GoodRelations Annotator with Drupal. The Annotator is open-source, written in Python, but should be easily portable.

b) Comprehensive data export for individual products and prices for Ubercart

The best approach is basically as follows:

1. Make sure you have all master data about the business / store / shop - if not, create additional fields in a config file or similar.

That should hold all the data about the business itself - contact details, legal name, etc.

2. Add additional GoodRelations RDFa markup to the template for the "about" or main page in the shop. This will define the business entity etc. The markup does not have to be tightly coupled with the existing markup; you can simply add it before the closing body element. See our RDF2RDFa paper, attached.

3. Add additional markup for each individual product / item and its prices and features to the template for the "product" page.
That markup should be basically the same as

http://www.ebusiness-unibw.org/wiki/GoodRelations_and_Yahoo_SearchMonkey#Describing_Each_Product

Again, you can also move that to the end of the template and decouple it from the human-readable content. That is usually better for managing the code.

I attach the basic code you have to insert.

Important: You have to link back from each gr:Offering node to the URI of the gr:BusinessEntity using the "rev" (not rel!) attribute. When in doubt, ask.

With that, you are already almost set.

You should have clean/cool URIs - if that is the case, the RDF created this way will be nice and complete

4. A very good extension would be to also generate one large RDF/XML data dump that basically contains ALL products and the business entity definition, e.g. in the form

http://mysite.com/goodrelations.rdf

That is best created by a cron job or similar every 24 hours.

Example:

    http://www.saveonvideo.com/Bosch-BDS10-8DS_p_10036.html#UnitPrice

instead of

    http://www.saveonvideo.com/semanticweb.rdf#UnitPrice or

one exemption: the gr:BusinessEntity should be defined here

    http://www.saveonvideo.com/semanticweb.rdf#BusinessEntity

or

    http://www.saveonvideo.com/#BusinessEntity

otherwise, it would be defined 9000 times with 9000 different identifiers.




 i cannot assess whether using the tool or a dedicated script is less effort in your case. basically, it would be sufficient if you  define a string template from the RFD/XML extracted from each page and rund a script that replaces the data values in each element with the database content. i guess that would be less than 20 lines of python code, following this pseudocode pattern:


template = "... RDF/XML template for each product" (you can get that by extracting the RDF/XML from one product page via pyrdfa)

o = "goodrelations.rdf"

file = open (o)

for item in database:
    get price, label, URI, .…
    replace placeholders in template
    add result to file
close (o)



Important: The URIs for all elements in that dump file should be the ones defined in the individual RDFa in the pages.

If you do that, you have the best of both worlds:
- a data dump that can be cheaply harvested by search engines
- rdfa that will be read by yahoo and maybe google
- the URIs from the data dump directly point to the Web pages and are thus resolvable

Then, you should also add a link element pointing to the dump file to the header of all pages page in the system:




 http://mysite.com/goodrelations.rdf" />


...

See also here

http://www.ebusiness-unibw.org/wiki/GoodRelations_Recipe_8

That's it!

PS: You may also want to look at how it is done in Joomla/Virtuemart,
http://code.google.com/p/goodrelations-for-joomla/

Code Examples


Notifying Web of Linked Data Repositories

Now, notify the key Web of Linked Data crawlers to load and use your data. To do so, simply paste the URI of the page that contains the snippet (likely http://example.org/) into the respective fields of the following submission pages:

   * a) Sindice: http://sindice.com/main/submit
   * b) Yahoo SearchMonkey: http://siteexplorer.search.yahoo.com/submit (this requires free registration with Yahoo)
   * c) URIBurner: http://linkeddata.uriburner.com/

Also, you should tell the URIBurner service of your new data. To do so, simply enter the following URI into your browser once you have published your updated page:

   * http://linkeddata.uriburner.com/about/html/

Example: If your augmented Web page is at http://www.mmmeeja.com/, then invoke the following URI:

   * http://linkeddata.uriburner.com/about/html/http://www.mmmeeja.com/

If you have checked the respective button on the previous page, we will also try to notify additional search engines of your new description. Step 4 (Optional): Publish a pure data file

You can increase the reach of your self-description even further as follows: 1. the description as a RDF/XML rich meta-data file.

2. Save and publish the file on your Web server under the filename http://example.org/goodrelations.rdf; for details see here.

3. Notify additional search engines for the Web of Linked Data. To do so, simply paste the URI of that file (e.g. http://example.org/goodrelations.rdf) into the respective fields of the following submission pages:

   * a) PingTheSemanticWeb: http://pingthesemanticweb.com/
   * b) Swoogle: http://swoogle.umbc.edu/index.php?option=com_swoogle_service&service=submit

Note: You must upload your file to the target location before you notify the search engines. They will not come back if your page is not available when they try for the first time. Congratulations! You will be found on the Web of Linked Data!

The rich description of your products and services will soon appear in various search engines and matchmaking services. This will direct additional customers to your business.

If you want to go further and expose detailed product and price information on a per-item level, please see the GoodRelations CookBook for instructions or install respective extensions for your shop software.

For more information on the GoodRelations vocabulary for e-commerce, see http://www.ebusiness-unibw.org/wiki/GoodRelations.