Navigation
gr_banner_small.png
GoodRelations is a standardized vocabulary for product, price, and company data that can be embedded into existing static and dynamic Web pages.

Project Main Page
Vocabulary
Documentation
Developer's Wiki
GoodRelations Cookbook

GoodRelations-compliant data can be published in a variety of syntactial variants. The most popular choice is RDFa in HTML/XHTML Web content and RDF/XML for data dump files.

However, it is easily possible to use any of the following formats depending on your needs and middleware:

  • RDFa in HTML
  • RDF/XML
  • Microdata
  • Turtle
  • JSON-LD
  • dataRSS
  • NTriples
  • OData
  • GData

Below, please find simple examples for syntactical variants. We do not yet have those for OData and GData, but this is just because there is currently no tooling available to generate that automatically.

A lot of conversion work can be simplified using the following tools:


RDFa in HTML/XHTML

<xml>

</xml>

RDF/XML

<xml> <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:gr="http://purl.org/goodrelations/v1#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">

<gr:BusinessEntity rdf:about="http://www.heppnetz.de/searchmonkey/#business"> <gr:legalName>Hepp Space Ventures</gr:legalName> <rdfs:comment>Your preferred supplier for space adventures.</rdfs:comment> <gr:offers rdf:resource="http://www.heppnetz.de/searchmonkey/#myoffer" /> </gr:BusinessEntity> </rdf:RDF> </xml>

Microdata

<xml> <section itemscope itemid="http://www.heppnetz.de/searchmonkey/#business" itemtype="http://purl.org/goodrelations/v1#BusinessEntity" >

Hepp Space Ventures

Your preferred supplier for space adventures.

<a itemprop="http://purl.org/goodrelations/v1#offers" href="http://www.heppnetz.de/searchmonkey/#myoffer">Hot deal: 16-bit SCSI Controller</a>

</section> </xml>

JSON-LD

tbd, http://rdfa.digitalbazaar.com/specs/source/json-ld/

Turtle

@prefix gr: <http://purl.org/goodrelations/v1#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
<http://www.heppnetz.de/searchmonkey/#business> rdf:type gr:BusinessEntity ;
	gr:legalName "Hepp Space Ventures" ;
	rdfs:comment "Your preferred supplier for space adventures." ;
	gr:offers <http://www.heppnetz.de/searchmonkey/#myoffer> .

NTriples

<http://www.heppnetz.de/searchmonkey/#business> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.org/goodrelations/v1#BusinessEntity> .
<http://www.heppnetz.de/searchmonkey/#business> <http://purl.org/goodrelations/v1#legalName> "Hepp Space Ventures" .
<http://www.heppnetz.de/searchmonkey/#business> <http://www.w3.org/2000/01/rdf-schema#comment> "Your preferred supplier for space adventures." .
<http://www.heppnetz.de/searchmonkey/#business> <http://purl.org/goodrelations/v1#offers> <http://www.heppnetz.de/searchmonkey/#myoffer> .

dataRSS

<xml> xmlns:y="http://search.yahoo.com/datarss/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2005/Atom ../latest/xsd/datarss.xsd"> <id>http://www.heppnetz.de/searchmonkey/</id> <updated>2010-05-28T10:33:09+02:00</updated> <author><name>GR RDF2DataRSS Converter</name><uri>http://www.ebusiness-unibw.org/tools/rdf2datarss/</uri></author> <contributor><name>GR RDF2DataRSS Converter</name><uri>http://www.ebusiness-unibw.org/tools/rdf2datarss/</uri></contributor> <logo>goodrelations-logo-small.gif</logo> <title>Converted rdf to DataRSS data for Yahoo SearchMonkey</title> <entry> <id>http://www.heppnetz.de/searchmonkey/</id> <title>Converted RDF data from http://www.heppnetz.de/searchmonkey/</title> <content type="application/xml"> <y:adjunct version="1.0" updated="2010-05-28T10:33:09+02:00" name="de.heppnetz"> <y:item rel="dc:subject" resource="http://www.heppnetz.de/searchmonkey/#business"> <y:type typeof="gr:BusinessEntity commerce:Business extraction:Product" resource="http://www.heppnetz.de/searchmonkey/#business"> <y:meta property="gr:legalName">Hepp Space Ventures</y:meta> <y:meta property="rdfs:comment">Your preferred supplier for space adventures.</y:meta> <y:item rel="gr:offers" resource="http://www.heppnetz.de/searchmonkey/#myoffer"/> </y:type> </y:item> </y:adjunct> </content> </entry> </feed> </xml>

OData

It is possible to represent GoodRelations data in OData syntax. Kingsley Idehen from OpenLink Software created the following example for the book "Beautiful Data" from Amazon.

Original:

Example: <xml> <?xml version="1.0" encoding="utf-8" ?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:oplamz="http://www.openlinksw.com/schemas/amazon#" xmlns:gr="http://purl.org/goodrelations/v1#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > <id>http://idehen.net/sparql?default-graph-uri=http%3A%2F%2Flinkeddata.uriburner.com%2Fabout%2Fid%2Fentity%2Fhttp%2Fwww.amazon.com%2Fo%2FASIN%2F0596157118&should-sponge=&query=define+get%3Asoft+%22replace%22%0D%0A%0D%0Adescribe+%3Chttp%3A%2F%2Flinkeddata.uriburner.com%2Fabout%2Fid%2Fentity%2Fhttp%2Fwww.amazon.com%2Fo%2FASIN%2F0596157118%23Offer_1%3E%0D%0Afrom+%3Chttp%3A%2F%2Flinkeddata.uriburner.com%2Fabout%2Fid%2Fentity%2Fhttp%2Fwww.amazon.com%2Fo%2FASIN%2F0596157118%3E&format=application%2Fatom%2Bxml&debug=on&timeout=</id> <updated>2010-05-31T09:15:35.000001Z</updated> <author><name /></author> <title type="text">OData Service and Descriptor Document</title> <entry> <id>http://linkeddata.uriburner.com/about/id/entity/http/www.amazon.com/o/ASIN/0596157118#Offer_1</id> <link rel="http://purl.org/goodrelations/v1#availableDeliveryMethods" href="http://purl.org/goodrelations/v1#DeliveryModeMail"/> <link rel="http://purl.org/goodrelations/v1#availableDeliveryMethods" href="http://purl.org/goodrelations/v1#UPS"/> <link rel="http://purl.org/goodrelations/v1#hasPriceSpecification" href="http://linkeddata.uriburner.com/about/id/entity/http/www.amazon.com/o/ASIN/0596157118#OfferPrice_1"/> <link rel="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" href="http://purl.org/goodrelations/v1#Offering"/> <link rel="http://purl.org/goodrelations/v1#hasBusinessFunction" href="http://purl.org/goodrelations/v1#Sell"/> <link rel="http://purl.org/goodrelations/v1#availableDeliveryMethods" href="http://purl.org/goodrelations/v1#DeliveryModePickup"/> <link rel="http://purl.org/goodrelations/v1#includes" href="http://linkeddata.uriburner.com/about/id/entity/http/www.amazon.com/o/ASIN/0596157118"/> <title>Beautiful Data: The Stories Behind Elegant Data Solutions</title> <updated>2010-05-31T09:15:35.000001Z</updated> <author><name /></author> <content type="application/xml"> <m:properties> <oplamz:offerListingId>xhCVoQADceY4Q3QnrRPYkowicRkxCfn0tS57nAKrTepqP67JOIeqTY5OtDxq4ax1B%2F3KCtIgci4Y9yEiOQvuuJny8Dl33OgKVvA4%2BXGgqcNFmSkLjn41mOpp1wHQuBc9spsNqoOMFTg6erp0TsKnPw%3D%3D</oplamz:offerListingId> <gr:hasEAN_UCC-13>9780596157111</gr:hasEAN_UCC-13> <oplamz:condition>New</oplamz:condition> <oplamz:conditionNote>Brand NEW over 200k titles In Stock..100% Money Back Guarantee..Tracking and Delivery Notification sent to your email</oplamz:conditionNote> <oplamz:availability>Usually ships in 1-2 business days</oplamz:availability> <gr:validFrom m:type="Edm.DateTime">2010-05-30 19:52:32.000001</gr:validFrom> <oplamz:merchantId>A2OMGVG4337Z2A</oplamz:merchantId> <rdfs:label>Beautiful Data: The Stories Behind Elegant Data Solutions</rdfs:label> </m:properties> </content> </entry>

</feed> </xml>

GData

It is possible to represent GoodRelations data in GData syntax, but we have not yet done this.