Vehicle Sales Ontology Recipes
The Vehicle Sales Ontology (VSO) is a Web vocabulary for describings cars, boats, bikes, and other vehicles for e-commerce. The vocabulary is designed to be used in combination with GoodRelations, a standard vocabulary for the commercial aspects of offers for sale, rental, repair, or disposal.
Main page: http://purl.org/vso/ns
On this page, we give examples of how it can be used in combination with GoodRelations.
Scenario: Miller Inc. sells the following car:
# Car Sales
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix gr: <http://purl.org/goodrelations/v1#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix dbpedia: <http://dbpedia.org/resource/> .
@prefix vso: <http://purl.org/vso/ns#> .
@prefix foo: <http://example.org/#> .
# Company / Vendor Data (needed only once for all offers)
foo:company a gr:BusinessEntity ;
gr:legalName "Miller Inc." ;
foaf:page <http://www.miller.com/> ;
gr:offers foo:offer1 .
# Offer: Price, Payment, Conditions
foo:offer1 a gr:Offering ;
gr:includes foo:car_155049 ;
gr:hasBusinessFunction gr:Sell ;
gr:hasPriceSpecification [ a gr:UnitPriceSpecification ;
gr:hasCurrency "USD"^^xsd:string ;
gr:hasCurrencyValue "11990"^^xsd:float ] ;
foaf:page <http://www.agautosalesny.com/details.php?key=71> . # URI of the web page
# Car Specification
foo:car_155049 a vso:Automobile, gr:ActualProductOrServiceInstance ; # 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:mileageFromOdometer [ a gr:QuantitativeValueFloat ;
gr:hasValueFloat "42000"^^xsd:float ;
gr:hasUnitOfMeasurement "SMI"^^xsd:string ] ;
gr:hasStockKeepingUnit "155049"^^xsd:string ;
vso:gearsTotal [ a gr:QuantitativeValueInteger ;
gr:hasValueInteger "6"^^xsd:int ;
gr:hasUnitOfMeasurement "C62"^^xsd:string ] ;
vso:transmission dbpedia:Manual_transmission ;
vso:fuelType dbpedia:Gasoline ;
vso:rentalUsage "false"^^xsd:boolean ;
vso:feature dbpedia:Cup_holder,
dbpedia:Power_window,
dbpedia:Air_conditioner,
dbpedia:Anti-lock_braking_system ; # Add more DBPedia / Wikipedia URIs for additional features
foaf:depiction <http://www.agautosalesny.com/super_admin/car_images/71-Photo-01_large.jpg> ; # URI of a photo
foaf:page <http://www.agautosalesny.com/details.php?key=71> . # URI of the web page
Scenario: Miller Inc. offers the following car class for rent.
# Car Rental
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix gr: <http://purl.org/goodrelations/v1#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix dbpedia: <http://dbpedia.org/resource/> .
@prefix vso: <http://purl.org/vso/ns#> .
@prefix foo: <http://example.org/#> .
# Company Data (needed only once for all offers)
foo:company a gr:BusinessEntity ;
gr:legalName "Miller Inc." ;
foaf:page <http://www.miller.com/> ;
gr:offers foo:offer2 .
# Offer: Price, Payment, Conditions
foo:offer2 a gr:Offering ;
gr:includes foo:cars ;
gr:hasBusinessFunction gr:LeaseOut ;
gr:hasPriceSpecification [ a gr:UnitPriceSpecification ;
gr:hasCurrency "USD"^^xsd:string ;
gr:hasCurrencyValue "50"^^xsd:float ;
gr:hasUnitOfMeasurement "DAY"^^xsd:string ] ;
foaf:page <http://example.org/economy-car-deal> . # URI of the web page
# Car Specification
foo:cars a vso:Automobile, gr:ProductOrServicesSomeInstancesPlaceholder ; # it' a placeholder for multiple cars
vso:ACRISSCode "ECMN"^^xsd:string ; # Rental car category
vso:doors [ a gr:QuantitativeValueInteger ;
gr:hasMinValueInteger "2"^^xsd:int ;
gr:hasMaxValueInteger "4"^^xsd:int ;
gr:hasUnitOfMeasurement "C62"^^xsd:string ] ;
vso:transmission dbpedia:Manual_transmission ;
vso:fuelType dbpedia:Gasoline ;
foaf:page <http://example.org/economy-car-deal> . # URI of the web page
Scenario: Miller Inc. offers bikes for rent. The rate is 10 $ per day.
# Bike Rental
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix gr: <http://purl.org/goodrelations/v1#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix dbpedia: <http://dbpedia.org/resource/> .
@prefix vcard: <http://www.w3.org/2006/vcard/ns#> .
@prefix vso: <http://purl.org/vso/ns#> .
@prefix foo: <http://example.org/#> .
# Company Data (needed only once for all offers)
foo:company a gr:BusinessEntity ;
gr:legalName "Miller Inc." ;
foaf:page <http://www.miller.com/> ;
gr:offers foo:offer3 .
# Offer: Price, Payment, Conditions
foo:offer3 a gr:Offering ;
gr:includes foo:bikes ;
gr:hasBusinessFunction gr:LeaseOut ;
gr:hasPriceSpecification [ a gr:UnitPriceSpecification ;
gr:hasCurrency "USD"^^xsd:string ;
gr:hasCurrencyValue "10"^^xsd:float ;
gr:hasUnitOfMeasurement "DAY"^^xsd:string ] ;
foaf:page <http://example.org/bike-rental> . # URI of the web page
# Bike Specification
foo:bikes a vso:Bicycle, gr:ProductOrServicesSomeInstancesPlaceholder ; # it' a placeholder for multiple bikes
foaf:page <http://example.org/bike-rental> . # URI of the web page
Scenario: Miller Inc. offers canoes for 2 - 3 paddlers for rent. The rate is 10 $ per day.
# Boat Rental
# Miller Inc. offers canoes for 2 - 3 paddlers for rent. The rate is 10 $ per day.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix gr: <http://purl.org/goodrelations/v1#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix dbpedia: <http://dbpedia.org/resource/> .
@prefix vcard: <http://www.w3.org/2006/vcard/ns#> .
@prefix vso: <http://purl.org/vso/ns#> .
@prefix foo: <http://example.org/#> .
# Company Data (needed only once for all offers)
foo:company a gr:BusinessEntity ;
gr:legalName "Miller Inc." ;
foaf:page <http://www.miller.com/> ;
gr:offers foo:offer4 .
# Offer: Price, Payment, Conditions
foo:offer4 a gr:Offering ;
gr:includes foo:canoes ;
gr:hasBusinessFunction gr:LeaseOut ;
gr:hasPriceSpecification [ a gr:UnitPriceSpecification ;
gr:hasCurrency "USD"^^xsd:string ;
gr:hasCurrencyValue "10"^^xsd:float ;
gr:hasUnitOfMeasurement "DAY"^^xsd:string ] ;
foaf:page <http://example.org/canoe-rental> . # URI of the web page
# Bike Specification
foo:canoes a vso:Canoe, gr:ProductOrServicesSomeInstancesPlaceholder ; # it' a placeholder for multiple canoes
vso:seatingCapacity [ a gr:QuantitativeValueInteger ;
gr:hasMinValueInteger "2"^^xsd:int ;
gr:hasMaxValueInteger "3"^^xsd:int ;
gr:hasUnitOfMeasurement "C62"^^xsd:string ] ;
foaf:page <http://example.org/canoe-rental> . # URI of the web page
# Option: Indicate pick-up location
foo:offer4 gr:availableAtOrForm foo:KeyWestStore .
foo:KeyWestStore a gr:LocationOfSalesOrServiceProvisioning ;
rdfs:label "Rental Location: Key West"@en ;
vcard:adr
[ a vcard:Address ;
vcard:country-name "USA" ;
vcard:locality "Key West" ;
vcard:postal-code "1234" ;
vcard:street-address "1234 Beach Street"
] ;
vcard:geo
[ vcard:latitude "48.08"^^xsd:float ;
vcard:longitude "11.64"^^xsd:float
] ;
vcard:tel "+1 408 970-6104" ;
foaf:page <http://example.org/canoe-rental/keywestStore> .
Scenario: Find car listings for cars with power windows, a mileage lesser or equal to 40,000 miles, and not more than two previous owners.
Note 1: The example is a bit more complex, since it is made to handle real data.
Note 2: It is relatively easy to make the query compatible with different units of measurement for the quantitative properties, but this is not shown in here.
You can try the query against the sample data provided at <http://www.heppnetz.de/ontologies/vso/examples.rdf>.
SPARQL Query:
PREFIX vso: <http://purl.org/vso/ns#>
PREFIX dbpedia: <http://dbpedia.org/resource/>
SELECT ?dealername ?dealerwebpage ?offer ?deeplink ?price ?currency ?vin ?mileage
FROM <http://www.heppnetz.de/ontologies/vso/examples.rdf>
WHERE
{
?d a gr:BusinessEntity .
OPTIONAL {?d gr:legalName ?dealername }
OPTIONAL {?d foaf:page ?dealerwebpage }
?d gr:offers ?offer .
?offer gr:hasPriceSpecification ?p .
?p gr:hasCurrencyValue ?price .
?p gr:hasCurrency ?currency .
{
{ ?offer gr:includes ?car }
UNION
{
?offer gr:includesObject ?bundle .
?bundle gr:typeOfGood ?car .
}
}
?car a vso:Automobile .
OPTIONAL { ?car vso:VIN ?vin }
?car vso:feature dbpedia:Power_window .
?car vso:mileageFromOdometer ?m .
?m gr:hasUnitOfMeasurement ?unit .
?unit bif:contains "HM" .
{
{ ?m gr:hasMaxValueFloat ?mileage }
UNION
{ ?m gr:hasValueFloat ?mileage }
}
OPTIONAL { ?offer foaf:page ?deeplink }
OPTIONAL { ?car foaf:page ?deeplink }
?car vso:previousOwners ?o .
?o gr:hasValueInteger ?owners .
FILTER (?mileage <= 40000) .
FILTER (?owners <= 2) .
}