GoodRelations Recipe 8
|GoodRelations is a standardized vocabulary for product, price, and company data that can be embedded into existing static and dynamic Web pages.|
- 1 Publishing GoodRelations Data on the Web
- 2 Additional Resources
Publishing GoodRelations Data on the Web
This page describes how to publish GoodRelations data on the Web.
Option 1: Publishing RDFa (RDF embedded inside HTML or XHTML)
Step 1: Insert the additional mark-up into your XHTML/HTML Web page
First, insert the additional mark-up into your XHTML/HTML Web page. There are two basic styles of RDFa usage, i.e.
- reusing existing content: inserting RDFa attributes directly where the original content is located in the page and
- snippet style: inserting an independent block of invisible RDFa directly before the closing "body" element of your page.
The first minimizes redundancy of data and is more suited for simple data structures on static Web pages, because updating the visible part will automatically update the rich meta-data. The downside of this approach is that the mark-up gets quickly unreadable if the data structures and the presentation diverge, which is very common.
The second approach avoids those limitations. For dynamic Web pages, i.e. when inserting RDFa at the template level, there are no real disadvantages. For static Web pages, a slight disadvantage is that in case of changes, you must update data at two locations, but still within the same file.
We provide a tool called RDF2RDFa that can turn any RDF/XML file into handy RDFa snippets for simple copy-and-paste.
For background information, please see: Hepp, Martin; García, Roberto; Radinger, Andreas: RDF2RDFa: Turning RDF into Snippets for Copy-and-Paste, in: Poster and Demo Proceedings of the 8th International Semantic Web Conference (ISWC 2009), Washington, DC, USA, October 25-29, 2009.
Step 2: Updating the XHTML/HTML page header
As a minimal solution, add a "xmlns" attribute with the value "http://www.w3.org/1999/xhtml" and a "version" attribute with the value "HTML+RDFa 1.0" to the <html> element of your document:
<xml><html xmlns="http://www.w3.org/1999/xhtml" version="HTML+RDFa 1.0" xml:lang="en"></xml>
This is enough for basic access to your rich meta-data.
Your data is, however, much more visible and useful if your page is compliant with the XHTML 1.0 strict specification. If you meet that requirement, you should instead update the page header as follows:
1. Change the DOCTYPE in the header to "XHTML+RDFa"
<xml> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> </xml>
2. Add a "xmlns" attribute with the value "http://www.w3.org/1999/xhtml" and a "version" attribute with the value "XHTML+RDFa 1.0" to the <html> element of your document:
<xml><html xmlns="http://www.w3.org/1999/xhtml" version="XHTML+RDFa 1.0" xml:lang="en"></xml>
3. Check that the <head> element includes the proper content type and encoding for HTML:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>Your page title blabla...</title>
For more information on this, see http://www.ebusiness-unibw.org/wiki/GoodRelationsAnnotator.
Step 3: Tell the World!
Now, notify the key Web of Linked Data crawlers to load and use your data. To do so, simply paste the URI of the page that contains the snippet (likely http://example.org/) into the respective fields of the following submission pages:
* a) Sindice: http://sindice.com/main/submit * b) Yahoo SearchMonkey: http://siteexplorer.search.yahoo.com/submit (this requires free registration with Yahoo)
Also, you should tell the URIBurner service of your new data. To do so, simply enter the following URI into your browser once you have published your updated page:
* http://linkeddata.uriburner.com/about/html/<your page>
Example: If your augmented Web page is at http://www.mmmeeja.com/, then invoke the following URI:
Option 2: Publishing RDF/XML (Separate File)
- Save the RDF/XML file under the filename
in the root directory of your Web server so that it becomes available as
- Add a link element pointing to this file to the header of your main Web page (or other pages, too):
<link rel="meta" type="application/rdf+xml" title="RDF/XML data for ***your company name***" href="http://www.example.org/semanticweb.rdf" />
- Notify Semantic Web search engines and crawlers of your data
To do so, simply paste the URI
into the respective fields of the following submission pages:
- a) http://pingthesemanticweb.com/
- b) http://sindice.com/main/submit
- c) http://swoogle.umbc.edu/index.php?option=com_swoogle_service&service=submit We are working on additional services for making your data known, including submission to Yahoo SearchMonkey and SWSE.
- Yahoo SearchMonkey
Yahoo SearchMonkey currently considers RDF data only if either submitted via the (proprietary) DataRSS feed format or if embedded inside XHTML pages via RDFa. In other words, pure RDF/XML files are currently not included in Yahoo SearchMonkey without some extra effort. As a solution, we have developed a conversion tool RDF2DataRSS which generates DataRSS feeds from any RDF/XML file. The result can then be submitted to Yahoo SearchMonkey directly.
The RDF2DataRSS tool will be released shortly. Please contact us if you have any questions in the meantime.
- Server Configuration
Make sure your server uses the proper media type (content type) "application/rdf+xml" when returning the semanticweb.rdf file. You can check this using either the "curl" tool on the command line or online services like
If that shows "Content-Type: application/rdf+xml", you are all set. If not, ask your hosting service to fix that. If you have sufficient privileges and if your site is hosted on an Apache server, you can also simply add the following lines to the .htaccess file (make sure you mind the dot when uploading the file!):
#Directive to ensure *.rdf files served as appropriate content type,
- if not present in main apache config
AddType application/rdf+xml .rdf
- The new draft "httpbis" RFC supports adding cache headers to a 303 response, in addition to the cache headers on the 200 responses so that users do not have to repeatedly
check whether the 303 response redirects to the same location. (Thanks to Peter Ansell!)
Publishing RDF/XML Data on MS IIS Platforms
- Ionics Isapi Rewrite Filter, http://iirf.codeplex.com/ for IIS 5.0 and IIS 6.0
- Microsoft URL Rewrite Module for IIS 7.0
- http://support.microsoft.com/kb/324064 (Thanks to Christophe Debruyne and Robert Meersman for the hint!)
- http://www.micronovae.com/ModRewrite/ModRewrite.html (Thanks to Sergio Fernández for the link!)
This document will be extended. In the meantime, we recommend the following document:
Cool URIs for the Semantic Web, W3C Interest Group Note 03 December 2008