Keith Alexander experiments with using eRDF markup to populate HTML templates:
I was writing a php template, marking it up with eRDF, and I realised that what I was doing was describing variables with triples – which is essentially what I would be doing to write a SPARQL query to retrieve data for the template.
So the core of the idea is: using semantic markup in a template to generate queries, retrieve data and populate the template.
I have started to implement the idea, using eRDF for the semantic markup, SPARQL as the query language I generate to, and Smarty as the templating language. (I use the ARC RDF PHP classes for parsing the eRDF into triples, and for running the SPARQL queries).
Keith has blogged this in much more detail here, including code and template samples.
This is quite a clever idea. Let’s assume you have a web application driven by data from an RDF triple store. You generate HTML pages by querying the triple store and inserting the bits and pieces into an HTML template. Now if you add eRDF or RDFa annotations to the HTML template, in a way that reflects the original RDF data, then by definition the annotations completely specify what data you need to populate the page. And the template itself therefore must be sufficient to extract all the required triples from the store. No coding needed!
So, generalising the approach and glossing over many details: Just take a big ball of RDF data (dump or behind a SPARQL endpoint), and throw a bunch of HTML templates with embedded annotations at it, and you get a dynamic web site without writing any code. And the web site will have complete semantic annotations.
That’s an example of what becomes possible after you’ve payed the RDF tax.
Keith points out that this is similar to what Fresnel is designed to do, but I have to say that I find this template-based approach more appealing.