GoodRelations is a standardized vocabulary for product, price, and company data that can (1) be embedded into existing static and dynamic Web pages and that (2) can be processed by other computers. This increases the visibility of your products and services in the latest generation of search engines, recommender systems, and other novel applications.
Martin Hepp
martin.hepp at ebusiness-unibw.org
Wed Jun 15 21:44:49 CEST 2011
Hi all: I just found out that the Google Rich Snippets Testing tool rejects all RDFa markup for products if the data contains foaf:page (a link to the HTML page) with a value that is NOT from within the domain name space of the actual file location. Example: If you have the following markup in the page available from http://www.domain.com/example.html, then a) an empty foaf:page value will work <div typeof="gr:Offering" about="#offering" > <div property="gr:name" content="ACME Anvil" xml:lang="en"></div> <div rel="foaf:page" resource=""></div> b) foaf:page with the actual page URI will work <div typeof="gr:Offering" about="#offering" > <div property="gr:name" content="ACME Anvil" xml:lang="en"></div> <div rel="foaf:page" resource="http://www.domain.com/example.html"></div> c) foaf:page with a URI from the same domain name space as the actual page URI will also work: <div typeof="gr:Offering" about="#offering" > <div property="gr:name" content="ACME Anvil" xml:lang="en"></div> <div rel="foaf:page" resource="http://www.domain.com/canonical/example.html"></div> BUT: c) foaf:page with a URI from another domain name space than the actual page URI will NOT work: <div typeof="gr:Offering" about="#offering" > <div property="gr:name" content="ACME Anvil" xml:lang="en"></div> <div rel="foaf:page" resource="http://www.some_other_domain.com/example.html"></div> Unfortunately, the testing tool gives the very uninformative error message "Insufficient data to generate the preview. ... Warning: In order to generate a preview, either price or review or availability needs to be present." It is natural that Google does not like foaf:page pointers to external domain name spaces, but this unexpected behavior costed me almost a day. So watch out! Option b) is the recommended practice, because it works in any scenario, but it requires that you know the URI of the final publishing destination at markup-time (or the template has access to the deep URI as a variable). Option a) is handier, because the URI of the current page will be automatically used as the value for foaf:page, but it fails, if the document sets the base URI of all product item pages to the main shop page, e.g. via <base href="http://shop.com/home/" /> because then all offers would point to the same base page and deep links would be lost. Best wishes Martin Hepp