Re: RSS 1.0 with Jena
Danny Ayers <[email protected]>
| Newsgroups | gmane.network.syndication.rss.devel |
|---|---|
| Message-ID | <[email protected]> |
I haven't got any usable code available, but have spent a fair bit of time with RSS + Jena. A while ago I set up an RSS aggregator, the approach (if I remember correctly) was something like this: 1. a Jena model is given the list of channel URIs (as rss:channel instances) 2. a URI is chosen 3. an external HTTP client gets the RSS 4. the RSS is fed through an XSLT stylesheet * 5. the result is loaded into the Jena Model 6. a statement is added to the model giving the current time as a property of that rss:channel (along with any useful headers from the HTTP client) 7. the rss:channel with the next oldest update time is chosen, goto 3. * in 4 I used an XSLT stylesheet to convert RSS x.x to RSS 1.0. Morten Frederikson's done a good XSLT, see: http://purl.org/net/syndication/subscribe/feed-rss1.0.xsl (also, for channels: http://purl.org/net/syndication/subscribe/list-ocs0.5.xsl) For display you can either select data from the model programmatically (a bit like DOM) or using RDQL queries. (for a 3-pane style view I did the former, with the results going into a JTree-based component on the left and a Swing HTML editor kit thingy area on the right). If I was to do this again with Jena now, I'd probably use the Rome RSS toolkit + Apache Commons HTTP Client for the feed front end rather than XSLT, it /should/ be more versatile and robust with dodgy feeds. The model can be file or RDBMS-backed (I just used file in prototypes, though had planned to mode to a HSQL base to allow zero-config use). For RSS 1.0 generation, you can simply build up a Jena model to represent the feed adding statements as appropriate, either programmatically or through RDQL inserts (I haven't tried the latter). The biggest problem is with serializing the data in such a way that it appears in the syntax that some aggregators expect. I didn't manage to do this with Jena 1.6 but I believe the serializers in Jena 2 are a lot more versatile and things like the default namespace can be set (some aggregators don't even understand namespaces, so the rss: prefix has to go). Ian Davis has recently been looking at strategies for 'normalising' RDF/XML to fit with rigid XML syntaxes, see: http://internetalchemy.org/2004/10/constraining-rdfxml I think there's also potential for using XSLT for this kind of filtering, it should be very straightforward if the source format is predictable, like out of a standard RDF/XML serializer. Cheers, Danny. On Wed, 13 Oct 2004 01:51:34 -0000, alexandre_martini <alexandre_martini-/E1597aS9LRfJ/[email protected]> wrote: > > > Hi, > > Does anybody have developed anything addressing RSS using Jena? > (http://sourceforge.net/projects/jena) > > Thanks! > > > Yahoo! Groups Links > > > > > -- http://dannyayers.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/rss-dev/ <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/