Documentation/Global shopping history

From GoodRelations Wiki
Jump to: navigation, search

Exposing Ownership: Global Shopping History

Work in progress: This page is an incomplete draft. Please help to improve it by addressing the issues from the discussion page and remove this template when finished.

Many shopping sites provide recommendations based on your past purchases. For example, Amazon suggest books related to books or book topics from previous purchases.

The main limitation of such recommendations is that they are limited to what you previously bought in that particular store. If you buy stuff from multiple sites, the current site cannot take into account what you bought from the other ones, which limits the quality of the recommendations.

GoodRelations includes a simple yet extremely powerful mechanism for making information about what you previously bought or own to multiple shopping sites.

So you can expose data about ALL products that you own to ALL shopping sites that you want to be aware of those for recommendations. With GoodRelations, you can do that at Web scale.

Here is how it works in GoodRelations:


@prefix foo:     <> .
@prefix gr:      <> .
@prefix xsd:     <> .
@prefix foaf:    <> .
@prefix rdfs:    <> .
@prefix vcard:   <> .
@prefix dbpedia: <> .
@prefix vso:     <> .

Define yourself as an instance of gr:BusinessEntity

# Describing me
	a gr:BusinessEntity ;
	gr:legalName "Martin Hepp" ;
   	vcard:fn "Martin Hepp"@en .

Describe the product as an instance of gr:Individual

Next, you have to describe the product as an instance of gr:Individual and ideally point to the make and model via gr:hasMakeAndModel.

This is very easy if you can find the URI of a respective make and model dataset, which you could take from DBPedia or or

Simple: An item contained in ProductDB

Assume I own a pair of Sony MDR-V900HD digital surround stereo headphones, for which I can find a valid URI in as

# Describing my camera Sony MDR-V900HD
foo:myHeadphones a gr:Individual ;
 	gr:hasMakeAndModel <> .

Advanced: A Car

Sometimes, the make and model data is too generic to tell a lot about your preferences. For example, car makes and models have so many configurational options that stating your base model is not sufficient for powerful recommendations. In such cases, you should augment the description of your car with additional features. Such a description is most useful if you use a GoodRelations extension for types of products or services, like the VSO ontology for cars, bikes, boats, etc., the CEO ontology for consumer electronics, etc.

Let's assume I owned the following car:

  • Make and Model: 2002 Chevrolet Camaro
  • VIN: 2G1FP22G522155049
  • Drivetype: RWD
  • Transmission: Manual
  • Engine: 5.7L V8 OHV 16V
  • Exterior Color: red
  • Features: Cup holder, Power windows, Air conditioner, ABS
# Describing my car
foo:myCar a vso:Automobile, gr:Individual ; # it' a real car
    gr:hasManufacturer dbpedia:Chevrolet ;
    gr:hasMakeAndModel dbpedia:Chevrolet_Camaro ;
    vso:modelDate "2002-01-01"^^xsd:date ;
# year-only data is not possible in xsd:date and also problematic
    vso:VIN "2G1FP22G522155049"^^xsd:string ;
    vso:bodyStyle <> ; # Coupé
    vso:color "red"@en ;
    vso:engineDisplacement [ a gr:QuantitativeValueFloat ;
                             gr:hasValueFloat "5.7"^^xsd:float ;
                             gr:hasUnitOfMeasurement "LTR"^^xsd:string ] ;
    vso:engineName "5.7L V8 OHV 16V"@en ;
    vso:transmission dbpedia:Manual_transmission ;
    vso:fuelType dbpedia:Gasoline ;
    vso:feature dbpedia:Cup_holder,
                dbpedia:Anti-lock_braking_system .
# Add more DBPedia / Wikipedia URIs for additional features

Link yourself and the products you own via gr:owns.

# Stating that I own the headphones and that car
foo:MartinHepp gr:owns foo:myHeadphones, foo:myCar .

Publishing the data

Publish the resulting data on the Web, e.g. as RDFa markup in your homepage or as part of your FOAF profile.

How can I control access to that data?

You don't have to share your data with everybody on the Web, since you can use existing access control techniques, namely WebID (formerly FOAF+SSL), to manage who can see which part of your onwership data.