Documentation/Global shopping history

From GoodRelations Wiki
Jump to: navigation, search

Exposing Ownership: Global Shopping History

Construction.png
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:

Preliminaries

@prefix foo:     <http://www.heppnetz.de/#> .
@prefix gr:      <http://purl.org/goodrelations/v1#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix foaf:    <http://xmlns.com/foaf/0.1/> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix vcard:   <http://www.w3.org/2006/vcard/ns#> .
@prefix dbpedia: <http://dbpedia.org/resource/> .
@prefix vso:     <http://purl.org/vso/ns#> .

Define yourself as an instance of gr:BusinessEntity

# Describing me
foo:MartinHepp
	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 http://linkedopencommerce.com or http://productdb.org/.

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 http://productdb.org as http://productdb.org/gtin/00027242450059.

# Describing my camera Sony MDR-V900HD
foo:myHeadphones a gr:Individual ;
 	gr:hasMakeAndModel <http://productdb.org/gtin/00027242450059> .

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 <http://dbpedia.org/resource/Coup%C3%A9> ; # 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:Power_window,
                dbpedia:Air_conditioner,
                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.