 | Level: Intermediate Rob Crowther (robert@crowther.info), Web developer, Freelance
20 May 2008 With Yahoo's recent announcement that they will implement support of
Semantic Web standards in their search engine, the benefits that the Semantic Web
has for your site have never been clearer. In addition to the existing benefits such as your structured content giving you a free, open-ended API, you now get the opportunity for increased search rankings, and more importantly, increased relevance because the search engine can better understand what the content of your site is about. In this tutorial you will learn to implement a simple social networking site using PHP and MySQL, which will implement Semantic Web standards such as hCard and Friend of a Friend (FOAF) as part of a semantic Uniform Resource Identifier (URI) scheme.
In this tutorial
In this tutorial you will learn practical details of how to implement a
semantic URI scheme, the conceptual structure of the pages of your Web site, and how to
apply microformats and RDFa to your markup to add semantic value to your Web pages. This tutorial shows you how to use Semantic Web technologies in the context of a very
simple social networking site, SemanticBook. SemanticBook represents your friends by a URI that you can use on any
other site, allowing your network of friends to be embedded into a wider network across
multiple sites. Given that FOAF is used, the user's data becomes portable, and is easily
extracted for use in other applications. For instance, SemanticBook allows you to easily
add your friend's contact details to an e-mail client such as Yahoo! Mail. You will
develop practical code to build semantic URI schemes, structure your HTML output to
allow the contact details of your users to be easily exported from their Web page, and
indicate the users relationships through Semantic Web standard formats.
Objectives - Review a quick introduction to the Semantic Web
- Implement a semantic URI scheme
- Represent the user's contact information with hCard
- Represent the user's network with FOAF
Prerequisites
The tutorial will focus on certain aspects of Apache configuration and the rendered HTML,
rather than the PHP and MySQL itself, so even if you only have a superficial
understanding of those two technologies, you can still follow along.
System requirements
You will need JavaScript enabled in your browser. You will need these tools to follow along with this tutorial:
- The main tool required is a text editor. One that has some support for HTML and XML
syntax is best.
-
PHP
—The author used Version 4.4.8 in this tutorial, but more recent versions work equally well.
-
Apache server
—Version 2.0.63.
-
MySQL
—I used Version 4.1.22, but anything
more recent is fine.
- Test your microformats with the Operator Add-On for Firefox.
Installing Apache PHP and MySQL explains how to get everything installed on Windows. See the SemanticBook application in action.
Duration
1 hour
Formats html, pdf
|  | |  |