Semantic Web for Web Designers and Developers
From GetSemantic
Some have suggested that Semantic Web outreach is almost irrelevant to the day-to-day running of websites. To some extent, this criticism is justified because the Semantic Web idea or approach is multi-faceted. Below, we hope to answer questions you may have about how to implement Semantic Web technology on your site, the benefits and possible pitfalls that you may encounter in doing so. There are many ways in which you can help push the Semantic Web (which some of us at GetSemantic often parenthetically call the 'web of data').
[edit] What different ways can I add 'semantics' to my site?
Semantics has a number of different meanings - in one context, it is using the elements and attributes for their correct syntactical meaning and designing a web page in such a way to use elements semantically rather than by using 'presentational markup'. So, for instance, if you want to make a heading, you would use the relevant 'h' element and then use CSS to style that element, rather than using FONT elements. Using clear semantics in HTML is a good thing to do, and if you aren't doing it, you really ought to be.
There are plenty of good resources on writing semantic (X)HTML, including:
- microformats.org: POSH
- Semantics, HTML, XHTML, and Structure by Brainstorms and Raves
- HTML Mastery by Paul Haine website
- Transcending CSS by Andy Clarke website
But there is a deeper meaning than that which we are more interested in. Semantics is also a fairly bad choice of word to mean data on the web. This means marking up data specifically so that the data can be reused.
There are a number of ways to add explicit data to your HTML pages:
[edit] Microformats
Microformats are simple, non-namespaced data types that are being promoted through a particular microformat process. Microformats do not use RDF, although using GRDDL they can be easily converted to RDF. They do have some advantages, though. There are a wide variety of tools available to parse microformats in various languages (especially JavaScript). Microformats have also caught the imagination in a way that some of the more technical RDF standards haven't.
Because microformats use only semantic class names in HTML and XHTML, they are quite easy to adopt - adding microformats to a page template need only be as complex as adding some extra 'div' and 'span' elements.
- see microformats.org
[edit] eRDF
eRDF is a way of embedding RDF-based data in to web pages that uses the same kind of solutions as microformats - semantic (X)HTML and class names.
See the eRDF page on the wiki for more details on this approach, and examples.
[edit] RDFa
RDFa uses some custom attributes that are added to XHTML. RDFa is a more flexible format than eRDF, but since it uses new attributes, your pages may not validate after using RDFa.
See the RDFa page on the wiki for more details on this approach, and examples.
[edit] GRDDL
If you are already publishing data as (X)HTML, GRDDL allows you to describe a way to turn that in to RDF.
See GRDDL for more information.
[edit] External data
If you are publishing data that comes from a dynamic source, it may be worth considering making data available in a separate file - as XML, for instance, or RDF/XML. You can then add a link in a 'link' element in the 'head' of your HTML.
[edit] Follow someone else
Part of the reason that this wiki came in to existence is to try and formalize new RDF-based formats. The wiki is an open space to put up ideas and sample design patterns of things you have built so that we can come up with RDF formats, and syntaxes to store that data on web pages.
[edit] Roll your own
If you have a custom set of data, you can always come up with your own way of mapping it to RDF. This site can help you with that process. We do not encourage creation of new formats just for the sake of it - if you can fit your data in to the models offered by existing RDF-based schemas or in to microformats, we would encourage that. The great thing about all of these approaches is that they are compatible. You may be publishing a complex set of data that you need to roll your own format for, but if it contains, say, contact details or events, you can use microformats to include those along with the more complex RDF-based solutions.
[edit] What should web designers and developers cultivate to help build the Semantic Web?
Well, there are various habits that you can start today that can help build the Semantic Web:
- Use semantic markup rather than presentational markup.
- Consider switching to XHTML where possible.
- Widespread adoption of XHTML would make it a lot easier for Semantic Web toolmakers to simplify their software. Again, this is a virtue not a necessity.
- Use microformats where appropriate.
- Don't reinvent formats.
- If you are publishing data that maps easily to RDF, investigate whether eRDF or RDFa will do what you need.
- Don't be afraid to ask for help from the Semantic Web community - there are lots of us who are perfectly happy to point you in the right direction or make you GRDDL stylesheets or OWL ontologies if you ask. The technospeak is more due to our incompetence than any desire to 'lock you out' of the discussion.
[edit] Are clients receptive to the Semantic Web?
It depends on your client's business interests. With few exceptions, there can't be many businesses that would object to having, say, the hCard microformat on their sites so that potential customers browsing a site can get in contact with them easier.
There are some important things to be aware of:
- If you are publishing data on the web already, it is already possible for people to use it. Semantic Web technology is only about making it easier for people to use that data. The only way to prevent people from using data they find on the Web is to not publish it on the Web in the first place.
- Similarly, you are not required to put data up to make your site more 'semantic web' compliant. Businesses should only publish data that they are comfortable in publishing.
- Putting Semantic Web technology in place needn't be complicated - it can be as simple as adding microformats or eRDF. It may take all of a few minutes on a big web project. Even if nobody ever uses it, it is only a very small investment of time taken that could potentially have a huge payback.
- Businesses can benefit from the capabilities for easier data interchange offered by the Semantic Web - adopting Semantic Web technologies can make them more flexible, better able to co-ordinate data with their partner businesses and between departments (if it is a larger organisation), and adapt to changes in the types of data they deal with.
- Semantic Web technologies promise benefits in terms of reasoning and inferencing applications, and the ability to process business logic at a higher level of abstraction.
If you have tried to sell Microformats or the Semantic Web to your clients or employer, please do blog the experience (or post it on your personal user talk page) and link to it from this article.
You may like to read Tim Berners Lee's Business Model for the Semantic Web
[edit] How does Semantic Web technology affect style and CSS?
RDF is a language for data, and not directly related to style and CSS, but it can be embedded into HTML, which is.
eRDF is entirely CSS friendly - it uses standard html class and id attributes to semantically describe any visible data on the page.
RDFa is a little trickier because it also makes use of other attributes, such as @about, @role, and @property, which you cannot use as a styling hook in IE 6 <. Also, the RDFa-style class-names contain a colon (:), which needs to be escaped in CSS if you want to style it. eg:
.dc\:title { font-size: large;}
[edit] How does Semantic Web technology affect accessibility?
In an ideal world, the provision of data in Semantic Web ways should not affect usability and accessibility in a negative way. The use of semantic markup has many obvious accessibility benefits, for instance - using structured headings (h1...h6) allows screen readers to navigate through your page, while just using font tags (etc.) does not.
The technology further towards the Semantic Web attempts to be accessibility-agnostic, but there are some issues to consider.
The 'abbr' date-time pattern used in the microformats community has had some criticism due to the fact that an ISO 8601 date-time read to a screen-reader user is not desirable [1].
This seems to be a problem inherent in using (x)html as a data format (as microformats and RDF-in-HTML formats do): there are certain types of data, such as dates and times, that humans prefer to see formatted in one way, but machines can more easily process in another.
On the other hand, if Semantic Web technology and other semantic standards like microformats are adopted widely, there is the possibility that assistive technology could pick up on the more popular of them and parse the data specifically for them. This would make browsing the web a fair bit easier, because users of assistive technology would be able to simply specify "I'm looking for an e-mail address from this website, find it for me".

