What's the best way to store Dublin Core metadata?
February 18, 2004 6:29 AM   Subscribe

What's the best way to store Dublin Core metadata?

I'm looking for something that will let me store a slew of Dublin Core records (the actual resources will be stored elsewhere and referenced by DC.Identifier). Mapping DC to a relational database seems to require all sorts of ridiculous contortions to handle repeatable elements, etc. It may still be the best way to do it, but I'd like to think there's something more elegant out there.

Encoding the DC in RDF/XML (according to the standard for XML encoding of qualified Dublin Core) and putting it into a native XML database seems like ridiculous overkill, given the unwieldiness of the DC-in-RDF standard. What I'm really looking for is some kind of dirt-simple object database, or even something that will let me store Perl lists/hashes persistently. Whatever I find needs to be accessible from Perl and, ideally, open-source or cheap.

I have googled this to death and inquired on the DC mailing list without a really satisfactory response.
posted by IshmaelGraves to Computers & Internet (6 answers total)
 
Cobble something together with Data::Dumper or one of the equivalents, perhaps? It really depends on what you're going to do with all that data: just store and retrieve by identifier? Search? Analyze patterns?

It could really be worth the trouble to shove the thing into a database if you want DMBS features, but just to persist the data, probably not.
posted by majick at 6:49 AM on February 18, 2004


Have you looked at Berkeley DB?
posted by crunchburger at 6:50 AM on February 18, 2004


Storable.pm is all you need. Just freeze() the DC records and put them in a hash indexed by their DC.Identifiers, then store() the hash in a file on disk. Or, if you don't want to read the whole DB back into memory at once, store() them each in seperate files named after checksums of the DC.Identifiers.
posted by nicwolff at 8:59 AM on February 18, 2004


# Oh, hell, it's easier to code than to explain:

use Storable;
use Digest::MD5 'md5_hex';

map store( get_DC_record($_), md5_hex( $_ ) ), @DC_Identifiers;

# then, to get a record back:

my $record = retrieve( md5_hex( $DC_Identifier ) );
posted by nicwolff at 9:11 AM on February 18, 2004


squish looks interesting, but worryingly old, and i guess you'd have found it yourself via google.
posted by andrew cooke at 10:39 AM on February 18, 2004


Response by poster: Thanks everyone. I was familiar with Berkeley DB as an RDBMS and the XML database available for it but didn't realize it could store native data structures; I will look into that. Storable.pm led me to IPC::Shareable (which uses Storable) which looks like it will be exactly what I need to keep a chunk of DC records in memory with a simple client-server setup. AskMefi rocks as usual.
posted by IshmaelGraves at 12:01 PM on February 18, 2004


« Older Eastern Wyoming in March   |   Best Web Writing Newer »
This thread is closed to new comments.