GoodRelations4ShopSoftware

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

Jump to: navigation, search

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


Contents

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:

<html lang="en">
<head>
 <title></title>
 <link rel="meta" type="application/rdf+xml" title="RDF/XML data for ***your company name***" href="
http://mysite.com/goodrelations.rdf" />
</head>
...

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

 
<div xmlns="http://www.w3.org/1999/xhtml" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:media="http://search.yahoo.com/searchmonkey/media/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:use="http://search.yahoo.com/searchmonkey-datatype/use/" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:gr="http://purl.org/goodrelations/v1#" xmlns:review="http://purl.org/stuff/rev#" xmlns:commerce="http://search.yahoo.com/searchmonkey/commerce/" xmlns:vcard="http://www.w3.org/2006/vcard/ns#" xmlns:product="http://search.yahoo.com/searchmonkey/product/" class="rdf2rdfa">
   <div class="description" about="http://www.heppnetz.de/searchmonkey/company.html#business">
      <div rel="gr:offers">
         <div class="description" about="http://www.heppnetz.de/searchmonkey/product.html#myoffer" typeof="gr:Offering">
            <div rel="gr:availableAtOrFrom" resource="http://www.heppnetz.de/searchmonkey/company.html#myshop"></div>
            <div rel="gr:hasBusinessFunction" resource="http://purl.org/goodrelations/v1#Sell"></div>
            <div rel="gr:hasPriceSpecification">
               <div class="description" about="http://www.heppnetz.de/searchmonkey/product.html#UnitPriceSpecification" typeof="gr:UnitPriceSpecification">
                  <div property="gr:hasCurrency" content="USD" datatype="xsd:string"></div>
                  <div property="gr:hasCurrencyValue" content="34.99" datatype="xsd:float"></div>
               </div>
            </div>
            <div rel="gr:includesObject">
               <div class="description" about="http://www.heppnetz.de/searchmonkey/product.html#TypeAndQuantityNode" typeof="gr:TypeAndQuantityNode">
                  <div property="gr:amountOfThisGood" content="1.0" datatype="xsd:float"></div>
                  <div property="gr:hasUnitOfMeasurement" content="C62" datatype="xsd:string"></div>
                  <div rel="gr:typeOfGood">
                     <div class="description" about="http://www.heppnetz.de/searchmonkey/product.html#product" typeof="gr:ProductOrServicesSomeInstancesPlaceholder">
                        <div rel="rdf:type" resource="http://search.yahoo.com/searchmonkey/product/Product"></div>
                        <div 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." xml:lang="en"></div>
                        <div rel="foaf:depiction" resource="http://www.heppnetz.de/searchmonkey/pscsi.jpg"></div>
                        <div rel="product:faq" resource="http://www.heppnetz.de/searchmonkey/heppcomputer.html#faq"></div>
                        <div property="gr:hasEAN_UCC-13" content="00010363780" datatype="xsd:string"></div>
                        <div rel="gr:hasManufacturer">
                           <div class="description" about="http://www.heppnetz.de/searchmonkey/product.html#heppcomputer" typeof="gr:BusinessEntity">
                              <div rel="rdf:type" resource="http://search.yahoo.com/searchmonkey/commerce/Business"></div>
                              <div rel="rdf:type" resource="http://www.w3.org/2006/vcard/ns#VCard"></div>
                              <div property="vcard:organization-name" content="Hepp Computertechnik Inc." xml:lang="en"></div>
                              <div rel="rdfs:seeAlso" resource="http://www.heppnetz.de/searchmonkey/heppcomputer.html"></div>
                              <div rel="vcard:url" resource="http://www.heppnetz.de/searchmonkey/heppcomputer.html"></div>
                           </div>
                        </div>
                        <div rel="review:hasReview">
                           <div class="description" typeof="review:Review">
                              <div property="review:maxRating" content="5" datatype="xsd:integer"></div>
                              <div property="review:minRating" content="0" datatype="xsd:integer"></div>
                              <div property="review:rating" content="4.5" datatype="xsd:float"></div>
                              <div property="review:totalRatings" content="45" datatype="xsd:integer"></div>
                           </div>
                        </div>
                        <div property="product:identifier" content="10363780" datatype="use:sku"></div>
                        <div rel="media:image" resource="http://www.heppnetz.de/searchmonkey/pscsi.jpg"></div>
                        <div property="rdfs:label" content="Personal SCSI 16-bit SCSI Controller" xml:lang="en"></div>
                        <div rel="product:manual" resource="http://www.heppnetz.de/searchmonkey/heppcomputer.html#manual"></div>
                        <div rel="product:manufacturer" resource="http://www.heppnetz.de/searchmonkey/product.html#heppcomputer"></div>
                        <div rel="rdfs:seeAlso" resource="http://www.heppnetz.de/searchmonkey/product.html"></div>
                        <div rel="rdfs:seeAlso" resource="http://www.heppnetz.de/searchmonkey/pscsi.jpg"></div>
                        <div rel="product:specification" resource="http://www.heppnetz.de/searchmonkey/heppcomputer.html#spec"></div>
                     </div>
                  </div>
               </div>
            </div>
            <div rel="rdfs:seeAlso" resource="http://www.heppnetz.de/searchmonkey/product.html"></div>
            <div property="gr:validFrom" content="2009-07-20T00:00:00Z" datatype="xsd:dateTime"></div>
            <div property="gr:validThrough" content="2010-07-20T00:00:00Z" datatype="xsd:dateTime"></div>
         </div>
      </div>
   </div>
</div>
 


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/<your page>

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.



Personal tools
Navigation