views:

83

answers:

2

I'm backing up my Flickr pics locally using a Perl script and the Net::Flickr::Backup module. This pulls down the original picture, a thumbnail, and the associated metadata (title, tags etc) in a RDF-XML file.

I'd like to extract a subset of this metadata so I can generate a "poor man's Flickr" HTML page. This should display the thumbnail and a link to the larger version, along with selected metadata (title, tags, and the permissions set in Flickr).

I'd like to do this from the Unix command line, pointing it to a directory of files and getting a HTML document back.

What's the best way to extract specific data from an RDF-XML file? The support in Perl seems a bit sketchy. I'm willing to try Python or Ruby if that's easier to use for RDF spelunking.

+2  A: 

I'm not sure I understand your question , but you don't necessarily need a SPARQL engine to extract your metadata. If your RDF/XML always look the same, you can use a simple XSLT stylesheet to extract a specific content from your document.

Pierre
+2  A: 

If you have the RDF-XML then you can parse it using a XML CPAN modules like one of these:

However you may want to look at Net::Flickr::RDF because it looks like it covers your requirement.

/I3az/

draegtun
After reading up a bit about RDF I have a better understanding of the actual file. As a first pass, I think I'll simply pipe the file through rdfxml.py <http://infomesh.net/2003/rdfparser> and do some simple munging from the output. My primary goal at the moment is to get my pictures in a simple webpage so that I can copy the tags to my photo editing software.
gerikson