http://purl.org/goodrelations/

 

GoodRelations:
An Ontology for Describing Web Offers

Primer and UserÕs Guide

Draft 2008-08-08

This version:

http://www.heppnetz.de/projects/goodrelations/primer/20080808/

Latest version:

http://www.heppnetz.de/projects/goodrelations/primer/

Author:

Martin Hepp, mhepp@computer.org

© 2008 by Martin Hepp, http://www.heppnetz.de. This documentation is available under a Creative Commons Attribution-No Derivative Works 3.0 Germany License. You are free to use and distribute this document as long as it remains unchanged. Note that this license applies only to the documentation. The GoodRelations ontology itself is available under a Creative Commons Attribution 3.0 license, which allows derived works etc.

Abstract

A promising application domain for Semantic Web technology is the annotation of products and services offers on the Web so that consumers and enterprises can search for suitable suppliers using products and services ontologies. While there has been substantial progress in developing ontologies for types of products and services, namely eClassOWL, this alone does not provide the representational means required for e-commerce on the Semantic Web. Particularly missing is an ontology (i.e., a uniform, machine-processable vocabulary) that allows describing the relationships between (1) Web resources, (2) offers made by means of those Web resources, (3) legal entities, (4) prices, (5) terms and conditions, and (6) the aforementioned ontologies for products and services. For example, we must be able to express that a particular Web site describes an offer to sell cell phones of a certain make and model at a certain price, that a piano house offers maintenance for pianos that weigh less than 150 kg, or that a car rental company leases out cars of a certain make and model from a particular set of branches across the country.

The GoodRelations ontology provides a generic yet lightweight vocabulary for describing in a machine-readable way the details of offers made on the Web. This allows vendors to encode their offers so that Semantic Web search engines can find such Web resources precisely. It empowers them to return exactly matching offers for a given need.

Such is in the interest of shop owners and manufacturers, because it makes sure the particular features and strengths are considered by Semantic Web search engines, and it is in the interest of buyers, because it allows them to find offers that exactly fit their requirements. As a side-effect, GoodRelations makes it easy to exchange product model details and feature data between manufacturers and shop operators, so that such data can be reused more easily along the value chain.

Status of this Document

This primer is a draft, reflecting the current version v1 of the GoodRelations ontology available at http://purl.org/goodrelations/v1. It complements the eClassOWL ontology and eClassOWL UserÕs Guide.

Important: The last official release 5.1 of eClassOWL requires a few small modifications in order to be fully compatible with GoodRelations. The current official release available at http://ontologies.deri.org/eclass/5.1/ does not yet meet this requirement. However, an updated version 5.1.4 is already available for download at http://www.heppnetz.de/projects/goodrelations/downloads/.

The only reason why this is not yet currently linked at the eClassOWL project Web page is that the documentation is not yet updated. We expect to finish that soon. In the meantime, you can safely use eClassOWL 5.1.4 with GoodRelations. The ontology itself is already final.

Disclaimer

The ontology and documentation are provided as they are, without warranty of any kind, expressed or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the ontology or its documentation or the use or other dealdings in the ontology or documentation.

Related Documents

á       The GoodRelations Ontology Specification V1.0 is available at http://purl.org/goodrelations/v1.

á       Instructions on how to make your own products and services vocabulary compatible with GoodRelations are at http://www.heppnetz.de/projects/goodrelations/ownvocabularies/.

á       For background information, see also the GoodRelations Technical Report and Errata and Change Notes.

 

1           Introduction

In this section, we explain why GoodRelations is practically relevant and what it actually contributes.

1.1       Need for a Common Vocabulary for Web Offers

Imagine, you are searching for a particular type of product or service on the Web. Using standard search engines like Google or others can be a frustrating experience. This is for a number of reasons. First, you have to know and use the very same words and the same language when searching as the vendor uses for describing the offer. If you search for ÒTVÓ, you wonÕt find pages that use ÒtelevisionÓ, for instance. Second, you have no means narrowing down your search to offers that meet certain criteria, for example, a minimal screen size, or a certain type of interface. Such criteria can also be on the commercial side. For example, you are looking for someone who actually ships to your country and serves your type of business.

Particularly unsatifying is current search when your search is based a less common meaning of a very popular term (thanks to Peter Mika for this good example), or if you have a special requirement that most of the offers do not meet.

While search for suitable suppliers is the most obvious use case, it is by far not the only one in which current Web technology is unsatisfying. Basically, the vast amount of product data exchange via the Web page is very unsatisfying from the data management perspective. It requires a lot of human labor for typing in data and for ÒstupidÓ information processing, like unit conversion or summing up two values. While there exist standardized classification schemas for products and services like UNSPCS and eClass, and even a fully-fledged OWL variant of the latter, they cannot be used for describing your offers or your needs.

Also, operators of Web shops have a hard time keeping their description of commodity items consistent with whatÕs on the vendorsÕ pages. Only if individual agreements are established, data can be exchanged and processed easily.

In short, the potential of the Web as the largest collection of persistently published product data for better search and data exchange remains unexploited.

1.2       What Does GoodRelations Contribute?

GoodRelations is a lightweight yet sophisticated vocabulary that allows manufacturers and show operators to express the exact meaning of their offers made on the Web in a machine-readable way. This empowers search engines to support more precise search, and partners in the value chain to automate their content integration tasks.

GoodRelations complements the eClassOWL ontology, which is the first non-toy ontology for products and services. Since the initial release of eClassOWL at ESWC 2005, the ontology has gained remarkable attention. The latest version provides more than 30,000 product classes and more than 5,000 attributes for describing product features.

The relationship between these two ontologies is straightforward:

á       eClassOWL provides classes, attributes, and values for describing what a product or service is.

á       GoodRelations provides everything needed for describing the relationship between a business entity and a product or service, i.e., the actual offer and its details. ThatÕs also the origin of the name – itÕs an ontology for the relations between goods and business entities.

While eClassOWL is the largest ontology for products and services, one can use any other products or services ontology in combination with GoodRelations. Only a few guidelines must be met.

For example, the Austrian ebSemantics initiative is close to release several products and services ontologies for particular domains (events, tickets, accommodation, etc.) that will be GoodRelations-compliant.

While GoodRelations is moderate in size, it is the outcome of about five years of work in progress, carried out at multiple institutions.

The main features of GoodRelations are as follows:

á       Based on currently available Semantic Web standards, tools, and infrastructure (Òready to run as of todayÓ)

á       Minimal requirements on reasoner support – any RDF-S-style reasoner, OWL DLP, DL, or ter-Horst reasoner will work.

á       Support for all common business functions, like sell, lease, dispose, repair, etc.

á       Suits both for explicit instances, product models, and anonymous instances

á       Supports different prices for different types of customers or quantities

á       Supports product bundles in combination with all kinds of units of measurements (Ò2 kg butter plus 2 cell phones for Û 99Ó would be no problem)

á       Supports price specifications both as single values or ranges

á       Supports intervals and units of measurements for product features

á       Compatible with eClassOWL and other ontologies

á       Supports ISO 4217 currencies

á       Supports defining eligible regions

á       Supports common delivery and shipping methods

á       Supports accepted payment methods

á       Offerings can be constrained to certain eligible business entities (e.g. resellers only)

á       Supports warranty promises, i.e., the duration and scope

á       Supports charges for certain payment or delivery options; the latter also individually per region

á       Compatible with international standards: ISO 3166, ISO 4217, UN/CEFACT, eCl@ss, etc.

 

2           Usage

In the following, we give a minimal example of using GoodRelations, followed by a comprehensive list of typical, more complex scenarios.

2.1       Minimal Example


LetÕs assume the following simple scenario:

ãThe shop at the Web page http://www.electronics.com offers to sell a single instance of a TV set that has a screen size of 30 centimeters, via this page, for 200 Euros.Ó

If we want to model that properly, we have to express three parts:

á       First, there is a business entity named Electronics.com.

á       Second, there exists a single TV set that has a screen size of 30 centimeters.

á       Third, there is an offer made by the Business entity to SELL this particular TV set for 200 Euros.

Before we proceed, we have to discuss the role of the URI http://www.electronics.com a little bit more. When the Web is viewed by humans, the same URI may be used to refer to different things – http://www.electronics.com can be used to point people

á       to the company,

á       to the offering, or

á       to the product description.

The Semantic Web requires that different things have different identifiers, so that computers can keep them apart. So we cannot use http://www.electronics.com as identifiers for all three parts (at most, we can use it for one of them). The cleanest way is to define individual identifiers for every distinct thing, and link them back via the rdfs:seeAlso property to a Web page that contains a combined description. This allows people to look up the Web page with human readable content easily without tangling items that must have separate identifiers.

This aspect is described in more details in sections 3.3.1 and 3.3.2 of the GoodRelations Technical Report.

In the following example, we simply define new identifiers within the namespace

http://www.heppnetz.de/ontologies/examples/gr#

Now, in order to express the offering using GoodRelations, we have to do the following. We will use the N3 notation for all subsequent examples because it allows breaking down statements into logical parts more easily than RDF/XML.

a)     Step 1: Define the relevant name spaces and prefixes

 

# Base: http://www.heppnetz.de/ontologies/examples/gr#

@prefix toy: <http://www.heppnetz.de/ontologies/examples/toy#> .

@prefix gr: <http://purl.org/goodrelations/v1#> .

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

@prefix default: <http://www.heppnetz.de/ontologies/examples/gr#> .

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

@prefix owl: <http://www.w3.org/2002/07/owl#> .

 

 

b)     Step 2: Choose a products and services ontology to describe the product and import GoodRelations

In order to describe the types and features of the actual products or services being offered, you need to import and refer to a respective ontology. In real scenarios, a good choice is eClassOWL. You could also create your own vocabularies for specific types of products and their features following these instructions.

In the following, we will use a toy ontology available at

http://www.heppnetz.de/ontologies/examples/toy

for reasons of simplicity. That ontology defines four types of products, namely the classes

toy:Apartment

toy:ComputerMouse, and

toy:TVSet,

plus a few product feature attributes, like the quantitative properties hasScreenSize, hasSize, hasWeight, and hasOperatingValue; and the qualitative property hasInterfaceType plus respective pre-defined values, which are not used in here.

So we import GoodRelations and the toy ontology:

 

<http://www.heppnetz.de/ontologies/examples/gr>

a owl:Ontology ;

owl:imports <http://purl.org/goodrelations/v1> ,

<http://www.heppnetz.de/ontologies/examples/toy> .

 

c)     Step 3: Describe the business entity

 

default:ElectronicsCom

a gr:BusinessEntity ;

rdfs:seeAlso <http://www.electronics.com> ;

gr:legalName "Electronics.com Ltd."^^xsd:string.

d)     Step 4: Describe all things that are being offered (not yet the offer itself, just the items)

First we say that mySony100Set is a TV set, and then we say that it is an actual TV set, not a make and model or a set of unknown instances (see section 5.2. for more details). Then we say that its screen size is defined by the value QuantitativeValueFloat_1, which holds the unit of measurement (ÒCMTÓ is the UN/CEFACT code for centimeters) and the actual amount (Ò30.0Ó). This may sound a bit complex for some readers but is caused by limitations of the OWL language. For background information, see section 3.4.2 of the the GoodRelations Technical Report.

default:mySony100TVSet

a toy:TVSet , gr:ActualProductOrServiceInstance ;

      toy:hasScreenSize default:QuantitativeValueFloat_1.

 

default:QuantitativeValueFloat_1

a gr:QuantitativeValueFloat ;

gr:hasUnitOfMeasurement

"CMT"^^xsd:string ;

gr:hasValueFloat "30.0"^^xsd:float .

 

e)     Step 5: Describe the offer and links the offer to the business entity making it

First, we must express that there is an offer to sell something and that what is being offered is described in TypeAndQuantityNode_1. Also, we have to attach that the price is defined by UnitPriceSpecification_1:

 

default:Offering_1

a gr:Offering ;

gr:hasBusinessFunction

gr:Sell ;

gr:hasPriceSpecification

default:UnitPriceSpecification_1 ;

gr:includesObject default:TypeAndQuantityNode_1 .

 

Then we must say that Electronics.com is making that offer:

default:ElectronicsCom gr:offers default:Offering_1 .

 

Then we must say what is part of the offering. In our case it is Òone piece of my TV setÓ. In another case it could also be 500 ml of milk or 350 kg of coal, or a bundle of both. The quantity is specified by a float value for amount and the unit of Measurement as an UN/CEFACT Common Code. The code for piece or item is ÒC62Ó. The full list is given in the Annex.

 

default:TypeAndQuantityNode_1

a gr:TypeAndQuantityNode ;

gr:amountOfThisGood "1.0"^^xsd:float ;

gr:hasUnitOfMeasurement

"C62"@en ;

gr:typeOfGood default:mySony100TVSet .

 

Now we must say that the price is 200 Euros per one piece of this bundl. The currency is encoded using the ISO 4217 standard (3 characters, ÒEURÓ for Euro). C62 means one piece of the bundle.

 

default:UnitPriceSpecification_1

a gr:UnitPriceSpecification ;

gr:hasCurrency "EUR"^^xsd:string ;

gr:hasCurrencyValue "200.0"^^xsd:float ;

gr:hasUnitOfMeasurement

"C62"^^xsd:string .

 

ThatÕs it. You have just encoded the offering from above in a machine-readable way.The RDF graph is shown in Figure 1 below.

 

Figure 1. RDF graph of the minimal example

 

The complete example in RDF/XML looks as follows:

<?xml version="1.0"?>

<rdf:RDF xmlns="http://www.heppnetz.de/ontologies/examples/gr#" xmlns:gr="http://purl.org/goodrelations/v1#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:toy="http://www.heppnetz.de/ontologies/examples/toy#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">

<owl:Ontology rdf:about="http://www.heppnetz.de/ontologies/examples/gr">

       <owl:imports rdf:resource="http://purl.org/goodrelations/v1" />

       <owl:imports rdf:resource="http://www.heppnetz.de/ontologies/examples/toy" />

</owl:Ontology>

<gr:BusinessEntity rdf:about="http://www.heppnetz.de/ontologies/examples/gr#ElectronicsCom">

       <rdfs:seeAlso rdf:resource="http://www.electronics.com" />

       <gr:legalName rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Electronics.com Ltd.</gr:legalName>

</gr:BusinessEntity>

<gr:Offering rdf:about="http://www.heppnetz.de/ontologies/examples/gr#Offering_1">

       <gr:hasBusinessFunction rdf:resource="http://purl.org/goodrelations/v1#Sell" />

       <gr:hasPriceSpecification>

             <gr:UnitPriceSpecification rdf:about="http://www.heppnetz.de/ontologies/examples/gr#UnitPriceSpecification_1">

                   <gr:hasCurrency rdf:datatype="http://www.w3.org/2001/XMLSchema#string">EUR</gr:hasCurrency>

                   <gr:hasCurrencyValue rdf:datatype="http://www.w3.org/2001/XMLSchema#float">200.0</gr:hasCurrencyValue>

                   <gr:hasUnitOfMeasurement rdf:datatype="http://www.w3.org/2001/XMLSchema#string">C62</gr:hasUnitOfMeasurement>

             </gr:UnitPriceSpecification>

       </gr:hasPriceSpecification>

       <gr:includesObject>

             <gr:TypeAndQuantityNode rdf:about="http://www.heppnetz.de/ontologies/examples/gr#TypeAndQuantityNode_1">

                   <gr:amountOfThisGood rdf:datatype="http://www.w3.org/2001/XMLSchema#float">1.0</gr:amountOfThisGood>

                   <gr:hasUnitOfMeasurement xml:lang="en">C62</gr:hasUnitOfMeasurement>

                   <gr:typeOfGood>

                         <toy:TVSet rdf:about="http://www.heppnetz.de/ontologies/examples/gr#mySony100TVSet">

                              <rdf:type rdf:resource="http://purl.org/goodrelations/v1#ActualProductOrServiceInstance" />

                              <toy:hasScreenSize>

                                    <gr:QuantitativeValueFloat rdf:about="http://www.heppnetz.de/ontologies/examples/gr#QuantitativeValueFloat_1">

                                          <gr:hasUnitOfMeasurement rdf:datatype="http://www.w3.org/2001/XMLSchema#string">CMT</gr:hasUnitOfMeasurement>

                                          <gr:hasValueFloat rdf:datatype="http://www.w3.org/2001/XMLSchema#float">30.0</gr:hasValueFloat>

                                    </gr:QuantitativeValueFloat>

                              </toy:hasScreenSize>

                         </toy:TVSet>

                   </gr:typeOfGood>

             </gr:TypeAndQuantityNode>

       </gr:includesObject>

</gr:Offering>

</rdf:RDF>

 

Now, letÕs query for offers of TV sets, and respective Web pages. In SPARQL, the proper query would be.

PREFIX gr: <http://purl.org/goodrelations/v1#>

PREFIX toy: <http://www.heppnetz.de/ontologies/examples/toy#>

 

SELECT ?offering

WHERE { ?offering rdf:type gr:Offering .

?offering gr:includesObject ?object .

?object gr:typeOfGood ?item .

?item rdf:type toy:TVSet .

}

 

Figure 2 shows the result to that query in ProtŽgŽ. (Note that for more complicated examples later in this primer, the ProtŽgŽ SPARQL query window cannot be used, since it operates only on the explicit triples, i.e., there is no reasoning.)

 

Figure 2. Result to the SPARQ Query

2.2       Motivating Scenarios

Now that you have seen the very basic flavor of offerings, we want to demonstrate the complexity of offers on the Web. This should explain why goodrelations is a bit more comprehensive than what has been shown above.

In the following, we describe a few typical examples of offerings made on the Web.

Scenario 1: A Web resource represents an entity that, in general, offers items of a particular kind of good for sale, either to wholesalers or to end users, or both; they might offer concrete, identifiable instances or it may be that it is only said that such instances exist.

Example 1.1.: ãSiemens, described by http://www.siemens.com, offers cell phonesÒ

Example 1.2.: ãMarmot, described by http://www.marmot.comÒ, produces sleeping bags (and, implicitly, sells them to wholesalers only)Ò.

Example 1.3.: ãMediamarkt, described by http://www.mediamarkt.at, offers to sell one remaining tumble drier MIELE xyz123 at Û 999 on the Web page

http://www.mediamarkt.at/clearance/mielexyz123.Ó

Scenario 2: A Web resource describes the make and model of a commodity and its properties. Such Web resources are usually within the domain name space of the respective manufacturer. There may exist actual individuals of this make and model, which share the default properties defined by the make and model, but also have additional properties of their own (e.g. the date of production, the serial number).

Example 2.1: ãhttp://www.sony.de/cellphones/sony123 describes the Sony cell phone model 123, which is green and manufactured by Sony.Ó

Example 2.2: Òhttp://www.marmot.com/bags/ultralightBag describes the Marmot sleeping bag model Ultralight Bag. Such a sleeping bag weighs 850 grams.Ó

Note: For an in-depth discussion of the semantics of makes and models, see section 3.1.5 in the GoodRelations Technical report, available at http://www.heppnetz.de/projects/goodrelations/GoodRelations-TR-final.pdf.

Scenario 3: A Web resource represents (1) the description of a particular make and model of a commodity and its properties, and (2) a concrete offer to sell unidentified instances thereof. Such Web resources are usually within the domain name space of Web shops.

Example 3.1: ãhttp://www.mycellphoneshop.com/sony/sony123 describes the Sony cell phone model 123, which is green and manufactured by Sony. Instances can be ordered via this page for 100 euro by end users or wholesalers.Ó

Example 3.2: ãhttp://www.outdoorwholesale.com/bags/ultralightBag describes the Marmot sleeping bag Ultralight Bag, which weighs 850 grams, and instances can be ordered, by wholesalers only, via this page for 200 euro.Ó

Scenario 4: A Web resource represents (1) the description of a particular range of products, determined either by product classes or makes and models, and property ranges, and (2) a concrete offer to rent out unidentified instances thereof. Such Web resources are usually within the domain name space of rental agencies or Web pages of local dealers.

Example 4.1: ãhttp://www.outdoorwholesale.com/tents-for-rent describes that the shop described by http://www.outdoorwholesale.com/ offers for rent Marmot sleeps-two tents, which weigh 2850 grams, via this page for 20 euro a day.Ó

Scenario 5: A particular Web resource represents (1) the description of a particular range of products, determined either by product classes, makes and models, or property ranges, and (2) a concrete offer to provide a certain type of service for this range of products (e.g. maintenance, repair, disposal). Such Web resources are usually within the domain name space of local dealers.

Example 5.1: ãhttp://www.volkswagen-sanfrancisco.com/service describes that the dealer described by http://www.volkswagen-sanfrancisco.com/ offers to repair any Volkswagen make and model.Ó

Example 5.2: ãMyWebshop, described by http://www.mywebshop.com, sells red and green cell phones and repairs any cell phone made by Nokia or SiemensÒ.

 

3           Step-By-Step Instructions

In the following, we give examples of how the GoodRelations ontology is to be used in typical scenarios. Since eClassOWL is pretty large and uses non-intuitive identifiers for its elements, which would make the examples hard to readwe first produce a toy products and services ontology that contains four product classes ÒCellphoneÓ, ÒPianoÓ, ÒWineÓ and ÒBatteryÓ, and the quantitative properties ÓhasWeightÓ and ÒhasTalkTimeÓ. The resulting ontology is shown below.

3.1       Preliminaries: Header and Namespace Definition

First, we have to define namespace prefixes in order to keep the examples readable:

# Base: http://www.heppnetz.de/ontologies/goodrelations/examples#

@prefix gr: <http://purl.org/goodrelations/v1#> .

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

@prefix default: <http://www.heppnetz.de/ontologies/goodrelations/examples#> .

@prefix protege: <http://protege.stanford.edu/plugins/owl/protege#> .

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

@prefix owl: <http://www.w3.org/2002/07/owl#> .

Then we have to import the GoodRelations ontology:

<http://www.heppnetz.de/ontologies/goodrelations/examples>

a owl:Ontology ;

owl:imports <http://purl.org/goodrelations/v1> .

 

For the following examples, we also define a toy vocabulary for products and services, because this keeps the examples short and more intuitive, as motivated above. The process is the same as in the minimal example from section 2.1.

default:Battery

a owl:Class ;

rdfs:subClassOf gr:ProductOrService .

 

default:Cellphone

a owl:Class ;

rdfs:subClassOf gr:ProductOrService .

 

default:Piano

a owl:Class ;

rdfs:subClassOf gr:ProductOrService .

 

default:Wine

a owl:Class ;

rdfs:subClassOf gr:ProductOrService .

 

default:hasWeight

a owl:ObjectProperty ;

rdfs:subPropertyOf gr:quantitativeProductOrServiceProperty .

 

default:hasTalkTime

a owl:ObjectProperty ;

rdfs:subPropertyOf gr:quantitativeProductOrServiceProperty .

 

3.2       Finding Suitable Unique Identifiers

While on the Web, the same page can describe both an offering and a company making the offering, this does not work on the Semantic Web. As said, you always have to define unique identifiers for distinct conceptual entities. If there is a retrievable resource describing one or more of those entities, link to this resource using rdfs:seeAlso.

3.3       Step 1: Business Entity

We assume there exist three business entities, Sony AG as a manufacturer, Amazon as a mail order vendor, and Peter Miller as a small business that sells cell phones on the Web, mostly via eBay. All three have a company Web site at http://www.sony.com, http://www.amazon.com, http://www.peter-millers-shop.com respectively. GoodRelations provides properties for the DUNS and GLN/ILN number of businesses. In our example, we assume the DUNS number of Amazon to be 884745530, and the GLN/ILN number of SONY Deutschland GmbH to be 4013675000004.

Quite clearly, other popular vocabularies (e.g. vCard or FOAF) for address details and contacts can and should be attached to the business entities.

The N3 code for Amazon is:

default:Amazon

a gr:BusinessEntity ;

rdfs:comment "Amazon"^^xsd:string ;

rdfs:seeAlso <http://www.amazon.com> ;

gr:hasDUNS "884745530"^^xsd:string ;

gr:legalName "Amazon Inc."^^xsd:string .

The N3 code for Peter Miller is:

default:PeterMiller

a gr:BusinessEntity ;

rdfs:comment "Peter Miller"^^xsd:string ;

rdfs:seeAlso <http://www.peter-millers-shop.com> ;

gr:legalName "Peter Miller's Shop"^^xsd:string .

The N3 code for Sony is:

default:Sony

a gr:BusinessEntity ;

rdfs:comment "Sony AG"^^xsd:string ;

rdfs:seeAlso <http://www.sony.com> ;

gr:hasGlobalLocationNumber

"4013675000004"^^xsd:string ;

gr:legalName "Sony AG"^^xsd:string .

3.4       Step 2: Products and Offerings

As a next step, we have to describe the actual products or services that are being offered, and the offering – e.g., the actual business function (sell, repair, dispose, etc.) and other commercial properties.

You know from the minimal example that the basic structure of an offering is always a graph that links (1) a business entity to (2) an offering, which is itself linked to one or multiple type and quantity node and one or more price specification nodes. Each type and quantity node hold the quantity, the unit of measurement for the quantity, and the product or service that is included in the offering.

For each product or service included in the offering, we must know whether this is an actual instance (e.g. my MacBook Pro), a make and model (e.g. the brand MacBook Pro), or multiple anonymous instances (e.g. all of the MacBook Pro computers that a particular shop is selling). This distinction is explained in more detail in section 5.3 of this document.

A particular object that is advertised is then be defined as and rdfs:subClassOf of both the proper product class and one of the three GoodRelations classes gr:ActualProductOrServiceInstance, gr:ProductOrServiceModel, or gr:ProductOrServiceSomeInstancesPlaceholder.

We assume there is a Sony cell phone model s1234. It has a weight of 100g and runs for 120 hours. The model is described on the Web page http://www.sony.com/cellphones/s1234/.

In our case, the cell phone model is an instance of both the class default:Cellphone from the products and services ontology, and of the class gr:ProductOrServiceModel from GoodRelations for the reasons explained in sections 3.4.3 and 3.4.4 of the GoodRelations Technical Report.

The N3 code is:

default:SonyCellPhoneModel_s1234

a gr:ProductOrServiceModel , default:Cellphone ;

rdfs:comment "Sony cellphone model s1234"^^xsd:string ;

rdfs:seeAlso <http://www.sony.com/cellphones/s1234/> ;

default:hasTalkTime default:QuantitativeValueInteger_9 ;

default:hasWeight default:QuantitativeValueFloat_10 .

 

default:QuantitativeValueFloat_10

a gr:QuantitativeValueFloat ;

rdfs:comment "The value node representing a weight of 100 grams"^^xsd:string ;

gr:hasValueFloat "100.0"^^xsd:float ;

gr:hasUnitOfMeasurement "GRM"^^xsd:string .

 

default:QuantitativeValueInteger_9

a gr:QuantitativeValueInteger ;

rdfs:comment "The node representing a time duration of 120 minutes."^^xsd:string ;

gr:hasValueInteger "120"^^xsd:int ;

gr:hasUnitOfMeasurement "HUR"^^xsd:string .

 

Note that the respective UN/CEFACT Common Codes for the units of measurement are as follows:

Unit of Measurement

UN/CEFACT Common Code

Hour

HUR

Gram

GRM

 

We can see how the flexible modeling of quantitative properties and the lack of ternary relations in OWL increase the size of the code; however, this should not be a very relevant issue, since most data will be generated and consumed by machines rather than humans. We are also planning an on-line conversion service that helps users generate GoodRelations data.

Now, we want to model some explicit or implicit offerings:

a)     Amazon sells bundles of this model plus two batteries via its shop. This is announced on the Web page http://www.amazon.com/cellphones/ too. The general offer is valid from July 1 – December 31, 2008.

First, we model the included objects, i.e., the actual cell phones and the actual batteries.

default:Cellphone_3

a gr:ProductOrServicesSomeInstancesPlaceholder , default:Cellphone ;

gr:hasMakeAndModel default:SonyCellPhoneModel_s1234 .

 

default:CellPhoneBattery_InstancePlaceholder

a gr:ProductOrServicesSomeInstancesPlaceholder , default:Battery .

 

The we define the offering and what it includes, and link that to the business entity Amazon. All times are given in UTC/GMT by adding the ÒZÓ suffixÓ to date/time values. Other time zones can be specified; see below for details.

 

default:Amazon

gr:offers default:AmazonOfferingABundle .

 

default:AmazonOfferingABundle

a gr:Offering ;

rdfs:comment "Amazon is offering a bundle, composed of s1234 phones and two batteries."^^xsd:string ;

rdfs:seeAlso <http://www.amazon.com/cellphones/> ;

gr:hasBusinessFunction

gr:Sell ;

gr:includesObject default:TypeAndQuantityNode_Amazon1 , default:TypeAndQuantityNode_Amazon2 ;

gr:validFrom "2008-01-01T00:00:00Z"^^xsd:dateTime ;

gr:validThrough "2008-12-31T23:59:59Z"^^xsd:dateTime .

What the bundle exactly includes is specified by two type and quantity nodes:

 

default:TypeAndQuantityNode_Amazon1

a gr:TypeAndQuantityNode ;

rdfs:comment "This node represents that the Amazon offering includes two batteries."^^xsd:string ;

gr:amountOfThisGood "2.0"^^xsd:float ;

gr:hasUnitOfMeasurement "C62"^^xsd:string ;

gr:typeOfGood default:CellPhoneBattery_InstancePlaceholder .

 

default:TypeAndQuantityNode_Amazon2

a gr:TypeAndQuantityNode ;

rdfs:comment "This instance reflects that the Amazon offering includes 1 unit (Code 62) of the instances placeholder Cellphone_3."^^xsd:string ;

gr:amountOfThisGood "1.0"^^xsd:float ;

gr:hasUnitOfMeasurement "C62"^^xsd:string ;

gr:typeOfGood default:Cellphone_3 .

 

b)     Peter Miller sells a used instance of this model via eBay and offers to repair any Sony s1234 cell phone. This is announced on the Web page http://www.ebay.com/auction1234/ and http://www.peter-millers-shop.com/service/ respectively. Both of his offers are valid from December 1 – December 31, 2008.

Again, we first model the objects that are being offered for sale or repair:

default:PetersUsedCellphone

a gr:ActualProductOrServiceInstance , default:Cellphone ;

gr:hasMakeAndModel default:SonyCellPhoneModel_s1234 .

 

default:AnonymousCellphoneInstancesOfTypeSony_s1234

a gr:ProductOrServicesSomeInstancesPlaceholder,

default:Cellphone ;

rdfs:comment "This node represents all of the anonymous cellphone instances of Sony s1234 which Peter Miller is willing to try to repair."^^xsd:string ;

gr:hasMakeAndModel default:SonyCellPhoneModel_s1234 .

 

 

Then we model the two actual offers and what they include and link them to the business entity:

default:PeterMiller

gr:offers default:MillersOfferToRepair , default:MillersOfferingEbay .

 

default:MillersOfferingEbay

a gr:Offering ;

rdfs:comment "Peter Miller's Offering to sell his cellphone on eBay."^^xsd:string ;

rdfs:seeAlso <http://www.ebay.com/auction1234/> ;

gr:hasBusinessFunction gr:Sell ;

gr:includesObject default:TypeAndQuantityNode_PeterEbay ;

gr:validFrom "2008-12-01T00:00:00Z"^^xsd:dateTime ;

gr:validThrough "2008-12-31T23:59:59Z"^^xsd:dateTime .

 

default:MillersOfferToRepair

a gr:Offering ;

rdfs:comment "Peter Miller's Offering to repair Sony s1234 cellphones."^^xsd:string ;

rdfs:seeAlso <http://www.peter-millers-shop.com/service/> ;

gr:hasBusinessFunction gr:Repair ;

gr:includesObject default:TypeAndQuantityNode_MillersRepair ;

gr:validFrom "2008-12-01T00:00:00Z"^^xsd:dateTime ;

gr:validThrough "2008-12-31T23:59:59Z"^^xsd:dateTime .

 

default:TypeAndQuantityNode_PeterEbay

a gr:TypeAndQuantityNode ;

gr:amountOfThisGood "1.0"^^xsd:float ;

gr:hasUnitOfMeasurement

"C62"^^xsd:string ;

gr:typeOfGood default:PetersUsedCellphone .

 

default:TypeAndQuantityNode_MillersRepair

a gr:TypeAndQuantityNode ;

rdfs:comment "The node that represents that Peter Miller's offer to repair Sony s1234 cell phones refers to 1 cell phone. This node may become significant in combination with Unit Price Specifications."^^xsd:string ;

gr:amountOfThisGood "1.0"^^xsd:float ;

gr:hasUnitOfMeasurement

"C62"^^xsd:string ;

gr:typeOfGood default:AnonymousCellphoneInstancesOfTypeSony_s1234 .

 

c)     Sony produces that model and implicitly sells instances thereof. This is announced on the Web page http://www.sony.com/cellphones/s1234/, too. The general offer is valid from January 1 – December 31, 2008.

Now, the cell phone model default:SonyCellPhoneModel_s1234 has already been defined above. What remains to be stated is that there exist unknown instances of this type of cell phone, which Sony is offering for sale. This looks as follows:

default:Cellphone_SomeSonys

a gr:ProductOrServicesSomeInstancesPlaceholder , default:Cellphone ;

gr:hasMakeAndModel default:SonyCellPhoneModel_s1234 .

 

default:Sony gr:offers default:SonyOffering_s1234_phones .

 

default:SonyOffering_s1234_phones

a gr:Offering ;

rdfs:comment "The general Sony offer to sell s1234s"^^xsd:string ;

rdfs:seeAlso <http://www.sony.com/cellphones/s1234/> ;

gr:hasBusinessFunction

gr:Sell ;

gr:includesObject default:TypeAndQuantityNode_Sony ;

gr:validFrom "2008-01-01T00:00:00Z"^^xsd:dateTime ;

gr:validThrough "2008-12-31T23:59:59Z"^^xsd:dateTime .

 

default:TypeAndQuantityNode_Sony

a gr:TypeAndQuantityNode ;

rdfs:comment "The node representing the fact that the general Sony offer refers to one cellphone. C62 is the common code for \"unit\"."^^xsd:string ;

gr:amountOfThisGood "1.0"^^xsd:float ;

gr:hasUnitOfMeasurement

"C62"^^xsd:string ;

gr:typeOfGood default:Cellphone_SomeSonys .

 

 

Note 1: GoodRelations supports time zone specifications for gr:validFrom and gr:validThrough as follows:

For a time in GMT/UTC, simply add a "Z" following the time:

2008-05-30T09:30:10Z

Alternatively, you can specify an offset from the UTC time by adding a positive or negative time following the time:

2008-05-30T09:30:10-09:00

or

2008-05-30T09:30:10+09:00.

Note 2: EAN/UCC/GTIN-13 codes for product models or product instances can be attached using the gr:hasEAN_UCC-13 property. GTIN-14 codes can be attached using the gr:hasGTIN-14 property.

3.5       Step 3: Eligible Customers and Regions

Now, letÕs state that the Sony offering is for resellers only:

default:SonyOffering_s1234_phones gr:eligibleCustomerTypes gr:Reseller .

Also, Amazon ships the phone to Austria, Germany, and Switzerland only:

default:AmazonOfferingABundle

gr:eligibleRegions "CH"^^xsd:string , "AT"^^xsd:string , "DE"^^xsd:string .

 

Peter Miller will sell to Austria and Italy only:

default:MillersOfferingEbay

gr:eligibleRegions "AT"^^xsd:string , "IT"^^xsd:string .

 

3.6       Step 4: Price Specifications

We should now add information on the prices asked by the various vendors.

As for Peter Miller, the price for the cell phone his fix price auction at eBay is 80 Euros including VAT. The validity of that price is from Dec 1 – Dec 31, 2008.

default:MillersOfferingEbay

gr:hasPriceSpecification

default:UnitPriceSpecification_MillersCellPhone .

 

default:UnitPriceSpecification_MillersCellPhone

a gr:UnitPriceSpecification ;

rdfs:comment "The price specification for Peter Miller's fix-price auction."^^xsd:string ;

gr:hasCurrency "EUR"^^xsd:string ;

gr:hasCurrencyValue "80.0"^^xsd:float ;

gr:hasUnitOfMeasurement

"C62"^^xsd:string ;

gr:validFrom "2008-12-01T00:00:00Z"^^xsd:dateTime ;

gr:validThrough "2008-12-31T23:59:59Z"^^xsd:dateTime ;

gr:valueAddedTaxIncluded

"true"^^xsd:boolean .

Note that the validity of price specifications may be shorter than the validity of the offering.

Sometimes, vendors donÕt give actual prices but just indicate ranges. GoodRelations supports that because it is a practical requirement, even though it is a bit problematic from the ontological perspective. LetÕs assume the price for the cell phone at Amazon is a range between 50 and 99 Euros per cell phone including VAT. The validity of that price be from Dec 1 – Dec 31, 2008.

default:AmazonOfferingABundle

gr:hasPriceSpecification

default:UnitPriceSpecification_Amazon99 .

default:UnitPriceSpecification_Amazon99

a gr:UnitPriceSpecification ;

rdfs:comment "The price specification that one unit of the bundle costs between 50 and 99 Euros including VAT."^^xsd:string ;

gr:hasCurrency "EUR"^^xsd:string ;

gr:hasMaxCurrencyValue

"99.0"^^xsd:float ;

gr:hasMinCurrencyValue

"50.0"^^xsd:float ;

gr:hasUnitOfMeasurement

"C62"^^xsd:string ;

gr:validFrom "2008-12-01T00:00:00Z"^^xsd:dateTime ;

gr:validThrough "2008-12-31T23:59:59Z"^^xsd:dateTime ;

gr:valueAddedTaxIncluded

"true"^^xsd:boolean .

Sony does only publish a list price specification of 150 Euros including VAT. This is handles by the Boolean datatype property gr:isListPrice.

default:SonyOffering_s1234_phones

gr:hasPriceSpecification

default:UnitPriceSpecification_SonyListPrice .

 

default:UnitPriceSpecification_SonyListPrice

a gr:UnitPriceSpecification ;

gr:hasCurrency "EUR"^^xsd:string ;

gr:hasCurrencyValue "150.0"^^xsd:float ;

gr:hasUnitOfMeasurement

"C62"^^xsd:string ;

gr:isListPrice "true"^^xsd:boolean ;

gr:valueAddedTaxIncluded

"true"^^xsd:boolean .

3.7       Step 5: Delivery Options and Delivery Charge Specifications

Amazon ships via DHL or Mail:

default:AmazonOfferingABundle

gr:availableDeliveryMethods

gr:DHL , gr:DeliveryModeMail .

The shipment charge via DHL is 8 Euros to Austria, Germany, and Switzerland:

default:AmazonOfferingABundle

gr:hasPriceSpecification

default:DeliveryChargeSpecification_3-Amazon-8EUR .

 

default:DeliveryChargeSpecification_3-Amazon-8EUR

a gr:DeliveryChargeSpecification ;

rdfs:comment "The specification of shipment charges for the Amazon offering."^^xsd:string ;

gr:appliesToDeliveryMethod

gr:DHL ;

gr:eligibleRegions "CH"^^xsd:string , "AT"^^xsd:string , "DE"^^xsd:string ;

gr:hasCurrency "EUR"^^xsd:string ;

gr:hasCurrencyValue "8.0"^^xsd:float ;

gr:valueAddedTaxIncluded

"true"^^xsd:boolean .

 

The other offerings have no information of delivery modes and respective charges.

3.8       Step 6: Payment Options and Payment Charge Specifications

Amazon accepts Visa and MasterCard:

default:AmazonOfferingABundle

gr:acceptedPaymentMethods

gr:VISA , gr:MasterCard .

Peter Miller accepts payment by bank transfer in advance only:

default:MillersOfferingEbay

gr:acceptedPaymentMethods

gr:ByBankTransferInAdvance .

 

default:MillersOfferToRepair

gr:acceptedPaymentMethods

gr:ByBankTransferInAdvance .

 

Note that such must be specified for each offering individually.

3.9       Step 7: Warranty Promises

Often, an offer includes a bundle of services in case of defects or malfunction. GoodRelations support that, too.

LetÕs assume Sony grants a warranty of 24 months parts and labor, customer bring-in:

default:SonyOffering_s1234_phones

gr:hasWarrantyPromise

default:WarrantyPromise_Sony_24_months .

 

default:WarrantyPromise_Sony_24_months

a gr:WarrantyPromise ;

rdfs:comment "Sony grants a warranty of 24 months parts and labor, customer bring-in."^^xsd:string ;

gr:durationOfWarrantyInMonths

"0"^^xsd:int ;

gr:hasWarrantyScope gr:PartsAndLabor-BringIn .

LetÕs assume Amazon grants a warranty of 12 months parts and labor, pick-up, and 36 months covering labor only:

default:AmazonOfferingABundle

gr:hasWarrantyPromise

default:WarrantyPromise_5-Amazon-12months , default:WarrantyPromise_6-Amazon-36months .

 

default:WarrantyPromise_5-Amazon-12months

a gr:WarrantyPromise ;

rdfs:comment "Amazon grants a warranty of 12 months parts and labor, pick-up."^^xsd:string ;

gr:durationOfWarrantyInMonths

"12"^^xsd:int ;

gr:hasWarrantyScope gr:PartsAndLabor-PickUp .

 

default:WarrantyPromise_6-Amazon-36months

a gr:WarrantyPromise ;

rdfs:comment "Amazon grants a warranty of 36 months covering labor only."^^xsd:string ;

gr:durationOfWarrantyInMonths

"0"^^xsd:int ;

gr:hasWarrantyScope gr:Labor-BringIn .

Peter Miller grants a warranty on parts and labor for 1 month, customer bring-in.

default:MillersOfferToRepair

gr:hasWarrantyPromise

default:PeterMillersWarrantyPromise .

 

default:MillersOfferingEbay

gr:hasWarrantyPromise

default:PeterMillersWarrantyPromise .

 

default:PeterMillersWarrantyPromise

a gr:WarrantyPromise ;

rdfs:comment "Peter Miller grants a warranty on parts and labor for 1 month, customer bring-in."^^xsd:string ;

gr:durationOfWarrantyInMonths

"1"^^xsd:int ;

gr:hasWarrantyScope gr:PartsAndLabor-BringIn .

 

You see that the scope and duration needs to be defined only once, but it must be attached to each individual offering it applies to.

3.10    Step 8: Bundles

Often, vendors offer a bundle of objects at a single price. This may even require the combination of arbitrary units of measurement, e.g. Ò500 grams of butter, 1 m of wire, and one piece of cell phone.Ó GoodRelations supports this inherently, because the type and quantity nodes always contain an explicit unit of measurement.

For example, assume that we offer a bundle of 1 piano and 0.7 liters of wine.

First, we define the objects included:

default:SomeRedWine

a default:Wine,

gr:ProductOrServicesSomeInstancesPlaceholder .

 

default:Piano_4

a default:Piano,

gr:ProductOrServicesSomeInstancesPlaceholder .

 

Then we define the offering an link it to two type and quantity nodes.

default:PianoAndWineBundleOffering

a gr:Offering ;

gr:includesObject default:TypeAndQuantityNode_OnePiano , default:TypeAndQuantityNode_700mlWine .

Then we specify the quantities included in each type and quantity node.

default:TypeAndQuantityNode_OnePiano

a gr:TypeAndQuantityNode ;

gr:amountOfThisGood "1.0"^^xsd:float ;

gr:hasUnitOfMeasurement

"C62"^^xsd:string ;

gr:typeOfGood default:Piano_4 .

 

default:TypeAndQuantityNode_700mlWine

a gr:TypeAndQuantityNode ;

gr:amountOfThisGood "0.7"^^xsd:float ;

gr:hasUnitOfMeasurement

"LTR"^^xsd:string ;

gr:typeOfGood default:SomeRedWine .

 

Keep in mind that the UN/CEFACT Common Code for liter is Ò LTRÓ and that for Òunit or pieceÓ is ÒC62Ó

Note that this bundle offering is not yet linked to a business entity and price specification. In a real-world scenario, such would be necessary but is done exactly as demonstrated for non-bundles before. The only difference is that the only meaningful unit of measurement for price specifications of bundles is ÒC62Ó for ÒUnit or pieceÓ, because the price is per bundle.

3.11    Step 9: Services and Value Ranges

Now Peter Miller says that he will also repair any cell phone that weigh between 10 and 120 grams. This works simply by using gr:hasMinValueFloat and gr:hasMaxValueFloat.

default:MillersOfferingToRepairAnyCellPhone

a gr:Offering ;

rdfs:comment "Peter Miller promises to repair cell phones that weigh between 10 and 120 grams."^^xsd:string ;

gr:hasBusinessFunction

gr:Repair ;

gr:includesObject default:TypeAndQuantityNode_Miller-CellPhoneRepair .

 

default:TypeAndQuantityNode_Miller-CellPhoneRepair

a gr:TypeAndQuantityNode ;

rdfs:comment "This node represents that Peter Miller's offer to repair refers to one unit of a cell phone."^^xsd:string ;

gr:amountOfThisGood "1.0"^^xsd:float ;

gr:hasUnitOfMeasurement

"C62"^^xsd:string ;

gr:typeOfGood default:Cellphone_10-AnyCellphoneThatWeighs10-120grams .

 

default:Cellphone_10-AnyCellphoneThatWeighs10-120grams

a gr:ProductOrServicesSomeInstancesPlaceholder , default:Cellphone ;

rdfs:comment "This entity represents anonymous instances of cellphones that weigh between 10 and 120 grams."^^xsd:string ;

default:hasWeight default:QuantitativeValueFloat_11-WeightBetween10_and_120Gram .

 

default:QuantitativeValueFloat_11-WeightBetween10_and_120Gram

a gr:QuantitativeValueFloat ;

rdfs:comment "This value object represents weights between 10 and 120 grams."^^xsd:string ;

gr:hasMaxValueFloat "120.0"^^xsd:float ;

gr:hasMinValueFloat "10.0"^^xsd:float ;

gr:hasUnitOfMeasurement

"GRM"^^xsd:string .

 

3.12    Step 10: Shop Locations and Opening Hours

Now, letÕs assume that Peter MillerÕs shop, from which he provides the service described in step 9, is located in Boston and opens Mondays through Saturdays, 10:00 a.m. – 8:00 p.m.

First, we say for which offers this location is relevant (only his service offers):

default:MillersOfferToRepair

gr:availableAtOrFrom

default:MillersShopBoston .

 

default:MillersOfferingToRepairAnyCellPhone

gr:availableAtOrFrom

default:MillersShopBoston .

Now we define the shop location itself. Note that contact details etc. can (and should) be attached using other standardized vocabularies. Then we link it to the nodes holding the opening hours for a given day of the week.

default:MillersShopBoston

a gr:LocationOfSalesOrServiceProvisioning ;

gr:hasOpeningHoursSpecification

default:OpeningHoursSpecification_Sat10To8 , default:OpeningHoursSpecification_Fri10To8 , default:OpeningHoursSpecification_Tue10To8 , default:OpeningHoursSpecification_Wed10To8 , default:OpeningHoursSpecification_Mo-10To8 , default:OpeningHoursSpecification_Thu10To8 .

An gr:hasGlobalLocationNumber property could also be added here in order to hold the GLN/ILN number for a business location.

Then we define the opening hours day by day. Note that while this is a bit verbose, you have to do so only once for each shop. If you have multiple shops that are in the same time zone and have the exact same opening hours, you can also use the same opening hour specifications for all your locations.

default:OpeningHoursSpecification_Mo-10To8

a gr:OpeningHoursSpecification ;

gr:closes "20:00:00"^^xsd:time ;

gr:hasOpeningHoursDayOfWeek

gr:Monday ;

gr:opens "10:00:00"^^xsd:time .

 

default:OpeningHoursSpecification_Tue10To8

a gr:OpeningHoursSpecification ;

gr:closes "20:00:00"^^xsd:time ;

gr:hasOpeningHoursDayOfWeek

gr:Tuesday ;

gr:opens "10:00:00"^^xsd:time .

 

default:OpeningHoursSpecification_Wed10To8

a gr:OpeningHoursSpecification ;

gr:closes "20:00:00"^^xsd:time ;

gr:hasOpeningHoursDayOfWeek

gr:Wednesday ;

gr:opens "10:00:00"^^xsd:time .

 

default:OpeningHoursSpecification_Thu10To8

a gr:OpeningHoursSpecification ;

gr:closes "20:00:00"^^xsd:time ;

gr:hasOpeningHoursDayOfWeek

gr:Thursday ;

gr:opens "10:00:00"^^xsd:time .

 

default:OpeningHoursSpecification_Fri10To8

a gr:OpeningHoursSpecification ;

gr:closes "20:00:00"^^xsd:time ;

gr:hasOpeningHoursDayOfWeek

gr:Friday ;

gr:opens "10:00:00"^^xsd:time .

 

default:OpeningHoursSpecification_Sat10To8

a gr:OpeningHoursSpecification ;

gr:closes "20:00:00"^^xsd:time ;

gr:hasOpeningHoursDayOfWeek

gr:Saturday ;

gr:opens "10:00:00"^^xsd:time .

 

Important: GoodRelations supports time zones for "opens" and "closes". If no time-zone suffix is included, the time is given in the local time valid at the location (local time, whatever that is). For a time in GMT/UTC, simply add a "Z" following the time, e.g.

gr:opens "10:00:00Z"^^xsd:time

Alternatively, you can specify an offset from the UTC time by adding a positive or negative time following the time, e.g.

gr:opens "10:00:00-09:00"^^xsd:time

or

gr:opens "10:00:00+09:00"^^xsd:time

 

3.13    Step 11: Consumables, Accessories, Spare Parts, and Similar Products

Peter Miller also sells one used battery, which is an accessory and a spare part for the Sony cell phone model s1234:

default:PetersUsedBattery

a default:Battery ;

gr:isAccessoryOrSparePartFor

default:SonyCellPhoneModel_s1234 .

 

default:MillersOfferingUsedBattery

a gr:Offering ;

gr:hasBusinessFunction

gr:Sell ;

gr:includesObject default:TypeAndQuantityNode_OneUsedBattery .

 

default:TypeAndQuantityNode_OneUsedBattery

a gr:TypeAndQuantityNode ;

gr:amountOfThisGood "1.0"^^xsd:float ;

gr:hasUnitOfMeasurement

"C62"^^xsd:string ;

gr:typeOfGood default:PetersUsedBattery .

 

4           Quering GoodRelations Offers using SPARQL

In the following, we give examples in SPARQL on how to query respective product and services data on the Semantic Web. This section may be extended in a future version of the report. In particular, we may model the full set of competency questions in SPARQL.

4.1.1  Find all known business entities and their legal names

 

PREFIX gr: <http://purl.org/goodrelations/v1#>

SELECT ?entity ?legalname

WHERE { ?entity rdf:type gr:BusinessEntity.

?entity gr:legalName ?legalname.}

 

The query executes as expected in ProtŽgŽ:

 

Figure 3. Query results to query 4.1.1 in ProtŽgŽ

 

4.1.2  Who sells cell phones and on which Web pages can I get more information on respective offerings?

 

PREFIX gr: <http://purl.org/goodrelations/v1#>

PREFIX ex: <http://www.heppnetz.de/ontologies/goodrelations/examples#>

SELECT ?business ?uri

WHERE {

?business gr:offers ?offering .

?offering gr:includesObject ?TypeAndQuantityNode .

?TypeAndQuantityNode gr:typeOfGood ?something .

?something rdf:type ex:Cellphone .

?offering gr:hasBusinessFunction gr:Sell.

?offering rdfs:seeAlso ?uri

}

 

The query executes as expected in ProtŽgŽ:

 

Figure 4. Query results to query 4.1.2 in ProtŽgŽ

 

4.1.3  Which offers of cell phones exists, what is the price, and where can I find the offering on the Web?

 

Note: Since we introduced price ranges, you must always use gr:hasMaxCurrencyValue or gr:hasMinCurrencyValue (or both) when querying for prices. gr:hasCurrencyValue is only a shortcut if the price is no range, i.e. the upper and lower bound are identical, and the reasoner will then infer that both gr:hasMaxCurrencyValue and gr:hasMinCurrencyValue will have the respective value (but not vice versa, naturally!). In most standard cases, you can simply use gr:hasMaxCurrencyValue for what we consider the price in our daily lives.

 

PREFIX gr: <http://purl.org/goodrelations/v1#>

PREFIX ex: <http://www.heppnetz.de/ontologies/goodrelations/examples#>

SELECT ?offering ?uri ?maxprice ?currency

WHERE {

?offering gr:includesObject ?TypeAndQuantityNode .

?TypeAndQuantityNode gr:typeOfGood ?something .

?something rdf:type ex:Cellphone .

?offering gr:hasBusinessFunction gr:Sell.

?offering rdfs:seeAlso ?uri .

?offering gr:hasPriceSpecification ?priceSpecification .

?priceSpecification rdf:type gr:UnitPriceSpecification .

?priceSpecification gr:hasCurrency ?currency .

?priceSpecification gr:hasMaxCurrencyValue ?maxprice .

}

 

Since ProtŽgŽ considers only explicit triples in the SPARQL query function, this return only one hit:

Figure 5. Query results to query 4.1.3 in ProtŽgŽ

 

If we change the last line in the query to

?priceSpecification gr:hasCurrencyValue ?maxprice .

 

the two other offerings, which specify the price using gr:hasCurrencyValue. If one uses a repository with reasoning support, the query given above will return all three results. The reason they are missing if there is no reasoners is that the triple

x gr:hasMaxCurrencyValue y .

 

is to be produced by the reasoner out of

 

x gr:hasCurrencyValue y.

Figure 6. Query results to the modified query 4.1.3 in ProtŽgŽ

Note that offerings that do not have a price specification at all do not appear in here due to the structure of the query.

4.1.4  Who repairs at least one type of cell phone?

 

PREFIX gr: <http://purl.org/goodrelations/v1#>

PREFIX ex: <http://www.heppnetz.de/ontologies/goodrelations/examples#>

SELECT ?business ?businessuri ?offeringuri

WHERE {

?business gr:offers ?offering .

?offering gr:includesObject ?TypeAndQuantityNode .

?TypeAndQuantityNode gr:typeOfGood ?something .

?something rdf:type ex:Cellphone .

?offering gr:hasBusinessFunction gr:Repair.

?offering rdfs:seeAlso ?offeringuri .

?business rdfs:seeAlso ?businessuri .

}

Note that this query does not guarantee that this shop will repair any make and model. We only know that it has offered to repair some objects of which is known that they are cell phones.

The query executes as expected in ProtŽgŽ. We are pointed to Peter MillerÕs Website and the URI describing his offer to repair cell phones.

 

Figure 7. Query results to query 4.1.4 in ProtŽgŽ

 

5           Advanced Topics

In this section, we explain the more sophisticated features of GoodRelations. For background information, please refer to the GoodRelations Technical Report.

5.1       Handling of Ranges and Intervals

Most quantitative properties of products or services are actually intervals and not single values. Even simple characteristics like the weight of a tangible object can in principle, only be specified as intervals (even if very small).

Also, there are many scenarios in which queries for suitable products or services must allow ranges in the query and must reason properly about such ranges. For example, if someone is looking for a TV set with a screen size between 10 and 15 inches, a model with 12 inches must be reported as a match, and if someone has a piano that needs to be transported and weighs 120 kg, a company offering to transport all pianos up to 150 kg of weight must be found.

Now, there have been approaches of extending Web ontology languages, namely OWL, by support for datatype ranges. The most prominent approach is the OWL-Eu proposal by Pan and Horrocks (Pan & Horrocks:, 2005). This would allow proper reasoning about value ranges for OWL datatype properties. However, this extension is currently not widely supported by standard tooling; it has yet to find its way into mainstream Semantic Web infrastructure. Since GoodRelations aims at making Semantic Web-based E-Commerce a reality on the basis of current technology components, using OWL-Eu was not an option for the moment.

Instead, we use a pragmatic workaround that shifts part of the work on the individual expressing the query but at the same time requires only a standard RDF-S or OWL reasoner that supports rdfs:subPropertyOf.

The approach is as follows (see Figure 8):

a)     We create an ontology class Quantitative Value.

b)     All properties reflecting quantitative characteristics of products or services are represented as object properties with the range of Quantitative Value.

c)     For each quantitative value, we create a new instance of Quantitative Value.

d)     We then attach the upper and lower limits of this value by two datatype properties (i.e. attributes) hasMinValue and hasMaxValue, and the unit of measurement by a datatype or object property hasUnitOfMeasurement.

Now, querying for suitable object requires just specifying the lower and upper limits for the respective characteristics. Figure 8 illustrates this approach.

 

Figure 8. Work-around for Value Ranges

One may object that this means a lot of redundancy for those cases where the upper and the lower limit are practically the same. In order to mitigate this, we introduce a third datatype property hasValue, which is an rdfs:subPropertyOf both hasMinValue and of hasMaxValue.

We can then simply say

myTVSet hasWeight X

X instance of QuantitativeValue

X hasValue 10

X hasUnitOfMeasurement ÒkgÓ

As long as there is reasoner that computes the implicit fact that all triples

X hasValue Y

imply

X hasMinValue Y and

X hasMaxValue Y,

this shortcut will return the very same results.

Note: Users of this workaround must be advised that ranges in here mean that all possible values in this interval are covered. (Sometimes, the actual commitment may be less than that: we rent cars from 2 – 12 seats does often not really mean that they have cars with 2,3,4,É12 seats.). Someone renting two types of rowing boats, one that fits for 1 or 2 people, and another that must be operated by 4 people cannot claim to rent boats with a seating capacity between 1 and 4 people. He or she is renting out two boat types , one holding 1-2 and another holding 4 passengers.

In practice, we created two specializations of the classes and datatype properties, one for float values and one for integer values. Figure 9 shows the respective part in ProtŽgŽ.

Figure 9. The work-around for ranges in ProtŽgŽ

 

The same mechanism is now also used for price ranges, see the definition of hasCurrencyValue, hasMaxCurrencyValue, and hasMinCurrencyValue.

Important Note: When querying, you must always use thasMinValue / hasMaxValue, and not the shortcut hasValue, because the reasoner will compute the identical values for the upper and lower bound when the shortcut is used, but it will not and cannot compute a value for hasValue in case an interval is specified.

5.2       Products and Services: Models, Classes, and Instances

eCl@ss, eClassOWL, and many other taxonomies for products and services donÕt make the important but subtle distinction between instances and models of a type of product or service, as explained in section 3.1.5 of the GoodRelations Technical Report . In fact, eCl@ss and eClassOWL provide classes like ÒTV SetÓ and attributes like ÒhasScreensizeÓ that can, in the absence of a formal definition of their semantics, be used both for describing product models (e.g. the default screensize of a particular Siemens TV set), and product instances (e.g. my actual TV set).

This is why eClassOWL products and services classes are all subclasses of a top-level class that is the union of ÒProduct or Service ModelÓ and ÒProduct or Service ClassesÓ. Thus, we introduce four classes for product or services classes, instances, and models:

ProductOrService as a top-level class, and ActualProductOrService, ProductOrServiceModel, and ProductOrServicesSomeInstancesPlaceholder as subclasses of this top-level class. They are defined as follows:

owl:Class ProductOrService

The superclass of all classes describing products or services types, either by nature or purpose. Examples for such subclasses are "TV set", "vacuum cleaner", etc. All eClassOWL "gen" classes are subclasses of this class. An instance of this class can be either an actual product or service or a placeholder instance for unknown instances of a mass-produces commodity. Since eClassOWL and other large products and services ontologies are used for both describing product and services instances and product and service makes and models, this top-level concept is the union of (1) Actual Product or Service Instances, (2) Product or Service Models, and (3) ProductOrServiceSome-Instances Placeholders. The latter are "dummy" instances representing anonymous products or services instances (i.e. such that are said to exist but not actually being exposed on the Web).

Examples: a) MyCellphone123, i.e. my personal, tangible cell phone b) Siemens1234, i.e. the Siemens cell phone make and model 123 c) dummyCellPhone123 as a placeholder for actual instances of a certain kind of cellphones.

owl:Class ActualProductOrServiceInstance

An Actual Product or Service Instance is a single identifiable object or action that creates some increase in utility (in the economic sense) for the individual possessing or using this very object (Product) or for the individual in whose favor this very action is being taken (Service). Products or Services are types of goods in the economic sense.

Examples: MyThinkpad T60, the pint of beer standing in front of me, my Volkswagen Golf, the haircut that I received or will be receiving at a given date and time. Note: In many cases, product or service instances are not explicitly exposed on the Web but only existentially quantified. For a detailed discussion and practical solutions, see section 3.3.3.

owl:Class ProductOrServiceModel

From the ontological perspective, a Product or Service Model is an intangible entity that specifies some characteristics of a group of similar, usually mass-produced Products. In case of mass-produces Products, there exists a relation hasMakeAndModel between the Products and Services Instance and the Product or Service Model. However, since eClassOWL and other products and services ontologies don't support this important disctinction, Product or Service Models are a subclass of Product or Service in GoodRelations.

Examples: Ford T, Volkswagen Golf, Sony Ericsson W123 cellphone

owl:Class ProductOrServicesSomeInstancesPlaceholder

A placeholder instance for unknown instances of a mass-produces commodity. This is used as a computationally cheap workaround for such instances that are not individually exposed on the Web but just stated to exist (i.e., which are existentially quantified).

Example: An instance of this class can represent an anonymous set of green Siemens1234 phones. It is different from the ProductOrServiceModel Siemens1234, since this refers to the make and model, and it is different from a particular instance of this make and mode (e.g. my individual phone) since the latter can be sold only once. Siemens1234, i.e. the Siemens cell phone make and model 123 as a placeholder for all actual instances. Figure 10 shows the resulting subsumption hierarchy.

Figure 10. The GoodRelations ontology in OWL uses these four classes for products and services in order to maximize compatibility with existing products and services ontologies. Shown in yellow are the GoodRelations language elements. Shown in green is an example example of a products and services class. Shown in blue are examples of an actual product instance, a make and model, and a placeholder for unknown (but existentially quantified) instances.

The GoodRelations ontology in OWL uses these four classes for products and services in order to maximize compatibility with existing products and services ontologies. Shown in yellow are the GoodRelations language elements. Shown in green is an example of a products and services class. Shown in blue are examples of an actual product instance, a make and model, and a placeholder for unknown (but existentially quantified) instances.

An key reason for this modeling workaround is the large amount of properties for product characteristics that are part of eCl@ss and eClassOWL, with more than 5,000 precisely defined elements for all kinds of aspects. Properly separating products from models, as described in the domain capture in section 3.1.5 the GoodRelations Technical Report , and as would follow from OntoClean (Guarino & Welty, 2002, , 2004) would mean we have to duplicate both the hierarchy of categories of eCl@ss (now more than 30,000 categories) and the properties (more than 5,000), which is unfeasible. Quite clearly, we need to be able to specify e.g, screen sizes for both models and instances, but a model does not have a screen size in the same way an instance has a screen size. The semantics of screen size attached to a model implies that an actual product that is of the respective make and model will (likely) have the respective screen size (see section 3.1.5 of the GoodRelations Technical Report for details).

When annotating an entity, we can then be more specific and say that the entity is either a model or a product or a placeholder for anonymous instances. The difference between actual instances, models, and anonymous instances of a product or service is then expressed by making a particular object the intersection of both the product category and one of the three subclasses of gr:ProductOrService.

6           Annex: Popular UN/CEFACT Common Codes

GoodRelations relies on the UN/CEFACT Common Codes for specifying unit of measurement. The normative list is available at http://www.unece.org/cefact/recommendations/rec20/rec20_rev4E_2006.xls

For your convenience, this document includes a list with the most popular codes.

 

UN/CEFACT
Common Code

Unit of
Measurement

28

kg/m²

2N

dB

4H

µm

4K

mA

4P

N/m

A24

cd/m²

A86

GHz

A94

g/mol

B22

kA

B32

kg á m2

B43

kJ/(kg.K)

B49

k?

B61

lm/W

BAR

bar

C16

mm/s

C24

mPa.s

C26

ms

C45

nm

C62

1

C65

Pa.s

C91

1/K

C94

min-1

CDL

cd

CEL

¡C

CMQ

cm³

D33

T

D52

W/K

D74

kg/mol

DAY

d

DD

¡

E01

N/cm²

E32

l/h

FAR

F

GM

g/m²

GRM

g

HTZ

Hz

HUR

h

KEL

K

KGM

kg

KGS

kg/s

KHZ

kHz

KL

kg/m

KMQ

kg/m³

KVT

kV

KWT

kW

L2

l/min

LTR

l

LUM

lm

LUX

lx

MBR

mbar

MHZ

MHz

MIN

min

MMK

mm²

MMQ

mm³

MMT

mm

MPA

MPa

MQH

m3/h

MQS

m³/s

MTK

MTQ

MTR

m

MTS

m/s

NEW

N

NU

N á m

NU

N.m

OHM

?

P1

%

PAL

Pa

SEC

s

VLT

V

WTT

W