Prof. Dr. Martin Hepp, Universität der Bundeswehr München, wrote a quickstart guide that shows how the established GoodRelations vocabulary can be used to embed rich data about shops, restaurants, and products into Web pages using RDFa.
If you add GoodRelations to your Web pages, you improve the visibility of your offers in the latest generation of search engines and recommender systems, and other novel applications.
Traditional Search Engine Optimization (SEO) tries to put you on top of all search results, but quite clearly, that can work only for one company. GoodRelations puts you on top of Web visibility for people who are looking for exactly your products or services.
Companies using GoodRelations include:
- BestBuy,
- Yahoo,
- O’Reilly,
- OpenLink Software,
and many more. Iit’s incredibly simple to use it:
- Customize and insert the patterns of additional HTML markup into your Web pages.
- Add links between the patterns.
- Modify the header information of the respective pages.
That’s it. You will be all set.
In the guide, you find ready-to-use snippets for adding rich meta-data about a company, a store, or a product / offer to existing Web pages.
Let’s get an eye.
Insert the additional HTML markup given below anywhere in the body section of the Web page describing your shop(s), restaurant(s), or store(s), and fill the following elements with your correct data:
- “Pizzeria La Mamma”: The name of the store or location.
- “Germany”: Your country.
- “Munich”: The city for the location.
- “85577″: The zip code for the location.
- “1234 Main Street”: The street and number for the location.
- “+33 408 970-6104″: A phone number, including the international prefix.
- “
“: The Web address (URL) of a logo or image.
- “48.08″ / “11.64″: The geo position of the store as longitude and latitude (Unknown? Find it here!).
- “08:00:00″ / “18:00:00″: The opening hours for Monday through Friday.
- “08:30:00″ / “14:00:00″: The opening hours for Saturday.
If you have multiple shops, but just one page, simply copy the snippet multiple times and replace all ocurrences of the three elements
- “#store”, “#mon_fri”, and “#sat”
inside the same snippet by
- “#store1″, “#mon_fri1″, and “#sat1″
- “#store2″, “#mon_fri2″, and “#sat2″
- “#store3″, “#mon_fri3″, and “#sat3″
etc.
Here is the code
<!– in RDFa 1.1, you can use the abbreviation: <div profile=”http://www.heppnetz.de/grprofile/”> –>
<div xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns:rdfs=“http://www.w3.org/2000/01/rdf-schema#”
xmlns=“http://www.w3.org/1999/xhtml” xmlns:foaf=“http://xmlns.com/foaf/0.1/” xmlns:gr=“http://purl.org/goodrelations/v1#”
xmlns:vcard=“http://www.w3.org/2006/vcard/ns#” xmlns:xsd=“http://www.w3.org/2001/XMLSchema#”>
<div about=“#store” typeof=“gr:LocationOfSalesOrServiceProvisioning”>
<div property=“rdfs:label” content=“Pizzeria La Mamma”></div>
<div rel=“vcard:adr”>
<div typeof=“vcard:Address”>
<div property=“vcard:country-name” content=“Germany”></div>
<div property=“vcard:locality” content=“Munich”></div>
<div property=“vcard:postal-code” content=“85577″></div>
<div property=“vcard:street-address” content=“1234 Main Street”></div>
</div>
</div>
<div property=“vcard:tel” content=“+33 408 970-6104″></div>
<div rel=“foaf:depiction” resource=“http://www.pizza-la-mamma.com/image_or_logo.png”></div>
<div rel=“vcard:geo”>
<div>
<div property=“vcard:latitude” content=“48.08″ datatype=“xsd:float”></div>
<div property=“vcard:longitude” content=“11.64″ datatype=“xsd:float”></div>
</div>
</div>
<div rel=“gr:hasOpeningHourSpecification”>
<div about=“#mon_fri” typeof=“gr:OpeningHoursSpecification”>
<div property=“gr:opens” content=“08:00:00″ datatype=“xsd:time”></div>
<div property=“gr:closes” content=“18:00:00″ datatype=“xsd:time”></div>
<div rel=“gr:hasOpeningHoursDayOfWeek” resource=“http://purl.org/goodrelations/v1#Friday”></div>
<div rel=“gr:hasOpeningHoursDayOfWeek” resource=“http://purl.org/goodrelations/v1#Thursday”></div>
<div rel=“gr:hasOpeningHoursDayOfWeek” resource=“http://purl.org/goodrelations/v1#Wednesday”></div>
<div rel=“gr:hasOpeningHoursDayOfWeek” resource=“http://purl.org/goodrelations/v1#Tuesday”></div>
<div rel=“gr:hasOpeningHoursDayOfWeek” resource=“http://purl.org/goodrelations/v1#Monday”></div>
</div>
</div>
<div rel=“gr:hasOpeningHourSpecification”>
<div about=“#sat” typeof=“gr:OpeningHoursSpecification”>
<div property=“gr:opens” content=“08:30:00″ datatype=“xsd:time”></div>
<div property=“gr:closes” content=“14:00:00″ datatype=“xsd:time”></div>
<div rel=“gr:hasOpeningHoursDayOfWeek” resource=“http://purl.org/goodrelations/v1#Saturday”></div>
</div>
</div>
<div rel=“foaf:page” resource=“”></div>
</div>
</div>
And in order to link the data, once you have added the structured data to the Web page markup, you have to link them so that search engines and recommender system can find them. Two types of links are important:
Links from offers / products to the company.
Links from the company to its stores / restaurants.
Linking from Offers / Products to the Company
1. Find out the final main Web address (URL) under which the page with the company markup will be available.
Examples:
http://www.hepps-bagels.com/
http://www.hepps-bagels.com/index.html
http://www.hepps-bagels.com/about.html
If there are multiple ways to access the page, use the shortest and most official one. Let’s assume it is
http://www.hepps-bagels.com/
in our example.
Now add “#company” to that address, which gives us
http://www.hepps-bagels.com/#company
as the identifier for the company data.
2. Insert the following additional line to the data markup for each product / offer page:
Instead of http://www.hepps-bagels.com/#company, use the correct URL determined in step 1.
This additional line must follow directly after the element
So the correct markup in our example would be<div about="#offering" typeof="gr:Offering"> <div rev="gr:hasBusinessFunction" resource="http://www.hepps-bagels.com/#company"></div> <div property="rdfs:label" content="Canon Rebel T2i (EOS 550D) $899" xml:lang="en"></div> ...…
Awesome!
Here is the complete GoodRelationsQuickstart
“: The Web address (URL) of a logo or image.
One Trackback
[...] Open Innovation « GoodRelationsQuickstart: use GoodRelations Vocabulary + RDFa in a Web page [...]