Re: Jena RDF via Velocity experience in Simile?

Hi Dan,

Both the Simile and Swad-e portals work has successfully used Velocity 
to provide a portal interface on to RDF/Jena data. We've compared notes 
a bit and might do more.

The key design choice is how you expose the RDF/Jena via the velocity 
context.

In the case of the swad-e work we chose to provide an additional layer 
of wrapper objects rather than put the Jena objects raw into the 
Velocity context. This allows us to simplify the Velocity scripts by 
providing convenience functions on the wrapper objects. For example, it 
allows us to identify resources and properties via qname strings in the 
scripts - not good for large scale programming but very convenient for 
quick scripting. The wrappers can also do additional cache management 
for when the data is coming straight out of a database. Some of our 
wrapper API is specific to faceted browsing, some of it is generic RDF 
access.

One thing that worked well for us was to wrap up the rendering itself as 
a manager object to allow late binding of templates, see [1].

In terms of pros cons ... We did an initial version using JSP's and the 
jstl library. We switched to velocity primarily because we wanted to be 
able to treat the templates/scripts as first class objects (e.g. load 
extra templates from across the web). This would be possible in JSP's 
but fiddly whereas it is very easy with Velocity. Having changed for 
that reason we did then find the scripting typically more compact and 
easier to develop in Velocity. Jstl gives a reasonable expression syntax 
for bean access but doesn't (or didn't) support general method calls 
which we found limiting. Velocity has more flexibility in the expression 
language which we found just general enough to do what we wanted.

Since its part of Swad-e the portal code will be open source (Jena-style 
BSD license) if that's of any use.

Dave

[1] http://esw.w3.org/mt/esw/archives/000053.html

Dan Brickley wrote:

> 
> 
> I understand folk here might have some experience
> exposing (read/write?) access to RDF/Jena in the
> Velocity (http://jakarta.apache.org/velocity/) environment.
> 
> Some folks are trying to work with FOAF RDF in a
> Java (bean-oriented) context and I'd like to be able to
> point them at prior work using Velocity. If anyone here
> has experience with this, notes on pros/cons etc., I'd be
> very grateful for pointers or summary...
> 
> thanks for any advice,
> 
> Dan
> 

Received on Wednesday, 5 May 2004 04:09:44 UTC