GoodRelationsService

Overview

On this page, we explain how you can use GoodRelations to add rich meta-data about coomodity services (e.g. haircutting) to your Web pages so that state-of-the art search engines, matchmaking services, and recommender systems will find your company.

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.

If you are looking for recipes for tangible products or other types of businesses, please check the GoodRelations Cookbook.

Resources:

Target Audience of this Recipe

This recipe is intended for a Web developer maintaining the Web page for a store providing commodity services.

Scenario Description

For our example, we take the Web page http://plushbeautybar.com/services.html.
On that page, various individual services are being offered, including price information, e.g.

Further Information

This recipe refines and complements the following generic GoodRelations recipes:

  • Recipe 1: GoodRelations and Yahoo SearchMonkey: How site owners can use GoodRelations for Yahoo! SearchMonkey (status: mature)
  • Recipe 2: GoodRelations and Google: Proposed patterns, currently under review for compliance by Google (status: mature)
  • Recipe 3: Minimal Example: Describing your business, stores, and opening hours (status: mature)
  • Recipe 4: Simple Example: Minimal example plus a broad description of what you offer plus payment and deliveryoptions (status: draft, to be completed)
  • Recipe 5: Comprehensive Example: Describing individual products or services including prices etc. (status: to be completed)

Additionally, the following more specific recipes may be relevant:

Describing Services in GoodRelations

GoodRelations uses one common class for products and services, enen though there can be substantial differences in modeling tangible products vs. intangible services. The main reason is that in the commercial representation, there are a lot of similarities, and, most important, most shop owners with large databases of offer data are unable to automatically separate the products from the services in their catalogs.

Basics

In GoodRelations, you always have the following main entities

  • gr:BusinessEntity for the company - WHO is making the offer
  • gr:LocationOfSalesOrServiceProvisioning for the store or stores - WHERE is the offer physically available
  • gr:ProductOrServicesSomeInstancesPlaceholder - the article or service (several) - WHAT is being sold or provided
  • gr:Offering for the offer, i.e. the PROMISE to transfer the ownership or carry out a service in your favor.

The price and payment options etc. are attached to the gr:Offering.

In the case of a service, you simply create a placeholder for all services actions that you are promising to execute. The fact that this is a service is being expressed by attaching the business function "ProvideService" to the gr:Offering node.
So basically you describe services the very same way as commodity products, with the difference that you use the gr:hasBusinessFunction property with the gr:ProvideService value.

Remark: There are also two more important types, but they are not relevant for this recipe:

  • gr:ActualProductOrService - Article or Service for one particular individual, e.g. antiques or used goods.
  • gr:ProductOrServiceModel - Datasheet, for product model specifications provided by the manufacturer of a good.

Background (for Experts)

The class gr:ProductsAndServices and its subclasses combine objects of two different kinds - basically,

  • objects - "things that can be claimed to exist" (Proton)
  • happenings

Products are basically all objects on which property rights can be obtained and transferred, while Services are basically happenings that take place in the favor of someone. So the natural modeling would be a class gr:Product and a class gr:Service.
GoodRelations, however, defines the common class gr:ProductOrService, which is union of those two classes, because with many important data sources, it is difficult to distinguish the products from the services automatically and reliably. Keep in mind that we often have shop systems with several 100k items, and very often a few percent of the entries are services.

It is basically a trade-off decision between the ease of populating the ontology vs. maximizing the reuse of the data. Another reason is that from the commercial perspective, there are many properties that are to be attached to both products and services, so we need the superclass anyway.
Please note that GoodRelations aims at services only insofar as "commodity services", like hairdressing, waste disposal, cleaning, etc. is concerned.

Example in RDFa

Copy-and-paste a snippet into your "services details" Web page

Insert the following additional mark-up directly before the closing '''

''' element in the source code of your Web page that contains the detailed services descriptions as shown below. In our example, the page would be

http://plushbeautybar.com/services.html
...

Hepp's Bagels are the tastiest you can find on campus.

<div ns="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#"

... SNIPPET FROM BELOW ...

Snippet for the basic data

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

<p>Plush Beauty Bar for Moms | Services and Pricing | spa services for mothers of young children</p>

   ... all human-readable content to be added here ...

Snippet for the additional data

This section is a placeholder for future extensions.

Updating the XHTML/HTML page header

As a minimal solution, add a "xmlns" attribute with the value "http://www.w3.org/1999/xhtml" and a "version" attribute with the value "HTML+RDFa 1.0" to the

element of your document:

This is enough for basic access to your rich meta-data.

Your data is, however, much more visible and useful if your page is compliant with the XHTML 1.0 strict specification. If you meet that requirement, you should instead update the page header as follows:

1. Change the DOCTYPE in the header to "XHTML+RDFa"

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

2. Add a "xmlns" attribute with the value "http://www.w3.org/1999/xhtml"  and a "version" attribute with the value "XHTML+RDFa 1.0" to the

element of your document:

3. Check that the

element includes the proper content type and encoding for XHTML:

<p>Your page title blabla...</p>

Example in N3/Turtle

N3/Turtle for the basic data

@prefix base: <http://www.plushbeautybar.com/#> .
@prefix services: <http://plushbeautybar.com/services.html#> .
@prefix eco: <http://www.ebusiness-unibw.org/ontologies/eclass/5.1.4/#> .
@prefix gr: <http://purl.org/goodrelations/v1#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@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#> .

# The Business Entity is already defined in http://www.plushbeautybar.com/, so we can just reuse it here

base:BusinessEntity a gr:BusinessEntity ;
    gr:offers services:Offering_1;
    gr:offers services:Offering_2.

# NAIL SERVICES: Manicure (shiny buff or polish) - $25
# All pedicure basins have disposable liners to prevent the spread of fungus and infection. Basin liners, files, buffers, and orange sticks are never re-used.
# Metal implements are disinfected with a hospital grade anti-fungal/viral/bacterial agent between clients.

services:Offering_1 a gr:Offering ;
    gr:acceptedPaymentMethods gr:Cash, gr:MasterCard, gr:VISA ;
    gr:availableAtOrFrom base:LOSOSP_1 ;
    gr:eligibleCustomerTypes gr:Enduser ;
    gr:eligibleRegions "US"^^xsd:string ;
    gr:hasBusinessFunction gr:ProvideService ;
    gr:includes services:Service_1 ;
    gr:hasPriceSpecification services:PriceSpec_1 ;
    gr:validFrom "2010-03-09T00:00:00-08:00"^^xsd:dateTime ;
    gr:validThrough "2011-03-09T23:59:00-08:00"^^xsd:dateTime ;
    rdfs:label "NAIL SERVICES: Manicure (shiny buff or polish) - $25"@en ;
    rdfs:comment "NAIL SERVICES: Manicure (shiny buff or polish) - $25 - Salon for mothers of young children in Los Angeles, California USA"@en ;
    rdfs:isDefinedBy <http://www.plushbeautybar.com/services.html> ;
    foaf:page <http://www.plushbeautybar.com/services.html> .

services:Service_1 a gr:ProductOrServicesSomeInstancesPlaceholder, eco:C_AKG492003-tax;
    rdfs:label "NAIL SERVICES: Manicure (shiny buff or polish) - $25"@en ;
    rdfs:comment "NAIL SERVICES: Manicure (shiny buff or polish) - $25 in Los Angeles, California USA"@en ;
    foaf:page <http://www.plushbeautybar.com/services.html> .

services:PriceSpec_1 a gr:UnitPriceSpecification ;
    gr:hasCurrency "USD"^^xsd:string ;
    gr:hasCurrencyValue "25"^^xsd:float ;
    gr:hasUnitOfMeasurement "C62"^^xsd:string .

# NAIL SERVICES: Pedicure - $30
# All pedicure basins have disposable liners to prevent the spread of fungus and infection. Basin liners, files, buffers, and orange sticks are never re-used.
# Metal implements are disinfected with a hospital grade anti-fungal/viral/bacterial agent between clients.

services:Offering_2 a gr:Offering ;
    gr:acceptedPaymentMethods gr:Cash, gr:MasterCard, gr:VISA ;
    gr:availableAtOrFrom base:LOSOSP_1 ;
    gr:eligibleCustomerTypes gr:Enduser ;
    gr:eligibleRegions "US"^^xsd:string ;
    gr:hasBusinessFunction gr:ProvideService ;
    gr:includes services:Service_2 ;
    gr:hasPriceSpecification services:PriceSpec_2 ;
    gr:validFrom "2010-03-09T00:00:00-08:00"^^xsd:dateTime ;
    gr:validThrough "2011-03-09T23:59:00-08:00"^^xsd:dateTime ;
    rdfs:label "NAIL SERVICES: Pedicure - $30"@en ;
    rdfs:comment "NAIL SERVICES: Pedicure - $30 - Salon for mothers of young children in Los Angeles, California USA"@en ;
    rdfs:isDefinedBy <http://www.plushbeautybar.com/services.html> ;
    foaf:page <http://www.plushbeautybar.com/services.html> .

services:Service_2 a gr:ProductOrServicesSomeInstancesPlaceholder, eco:C_AKG492003-tax ;
    rdfs:label "NAIL SERVICES: Pedicure - $30"@en ;
    rdfs:comment "NAIL SERVICES: Pedicure - $30 in Los Angeles, California USA"@en ;
    foaf:page <http://www.plushbeautybar.com/services.html> .

services:PriceSpec_2 a gr:UnitPriceSpecification ;
    gr:hasCurrency "USD"^^xsd:string ;
    gr:hasCurrencyValue "30"^^xsd:float ;
    gr:hasUnitOfMeasurement "C62"^^xsd:string .

N3/Turtle for the additional data

This section is a placeholder for future extensions.

Example in RDF/XML

RDF/XML for the basic data

 ``
   ``
     ``
       ``
       ``
       ``
       ``
       ``
       ``US``
       ``
       ``
         ``
           ``
           ``NAIL SERVICES: Manicure (shiny buff or polish) - $25``
           ``NAIL SERVICES: Manicure (shiny buff or polish) - $25 in Los Angeles, California USA``
           ``
         ``

       ``

       ``
         ``
           ``USD``
           ``25``
           ``C62``
         ``

       ``

       ``2010-03-09T00:00:00-08:00``
       ``2011-03-09T23:59:00-08:00``
       ``NAIL SERVICES: Manicure (shiny buff or polish) - $25``
       ``NAIL SERVICES: Manicure (shiny buff or polish) - $25 - Salon for mothers of young children in Los Angeles, California USA``
       ``
       ``
     ``

   ``

   ``
     ``
       ``
       ``
       ``
       ``
       ``
       ``US``
       ``
       ``
         ``
           ``
           ``NAIL SERVICES: Pedicure - $30``
           ``NAIL SERVICES: Pedicure - $30 in Los Angeles, California USA``
           ``
         ``

       ``

       ``
         ``
           ``USD``
           ``30``
           ``C62``
         ``

       ``

       ``2010-03-09T00:00:00-08:00``
       ``2011-03-09T23:59:00-08:00``
       ``NAIL SERVICES: Pedicure - $30``
       ``NAIL SERVICES: Pedicure - $30 - Salon for mothers of young children in Los Angeles, California USA``
       ``
       ``
     ``

   ``

 ``

RDF/XML for the additional data

This section is a placeholder for future extensions.

Extensions and Improvements

Determine the geographical position of your offices and stores

You can attach the address and geo position of your main office and of your shop or shops to the respective elements, even if you don't know the latitude and longitude of your addresses. Simply use  free online services to determine them, e.g. the excellent one by Stephen P. Morse at http://stevemorse.org/jcal/latlon.php.

Adding multiple stores

Simply add two or more gr:hasPOS properties to the gr:BusinessEntity and define more than one gr:LocationOfSalesOrServiceProvisioning nodes.

Query Example

# Find someone who provides a service that contains "manicure" in the description

SELECT ?offer ?uri ?price ?currency WHERE
{
  ?offer a gr:Offering .
  ?offer gr:hasBusinessFunction gr:ProvideService .
  {
    {
      ?offer gr:includes ?service.}
    UNION
    {
      ?offer gr:includesObject ?o .
      ?o gr:typeOfGood ?service .
    }
  }
  OPTIONAL {?service rdfs:label ?label}
  OPTIONAL {?service rdfs:description ?description}
  OPTIONAL {?service foaf:page ?uri}

  ?offer gr:hasPriceSpecification ?p .
  ?p a gr:UnitPriceSpecification .
  ?p gr:hasCurrency ?currency .
  ?p gr:hasCurrencyValue ?price .

  FILTER (regex(?label, "manicure", "i") || regex(?description, "manicure", "i"))
}

Unprocessed Resources

property gr:billingIncrement with a domain of gr:UnitPriceSpecification and a range of xsd:float.

  • This allows indicating the smallest billable unit of an item.
  • Example: Price 2 euros per hour, billing in units of 15 minutes

Prices per sqft etc.: http://www.monsterclean.net/prices.html

Bank Example: eclassOWL 5.1.4:

Classification:    25-15-00-00 [ AAB447003 ]
Preferred Name:    Finance and insurance services
Definition:  
Keywords:    Financial service, Insurance service