Best way to store belongings?

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

  • What's the best way to store http://www.dublincore.org 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.

  • Answer:

    Cobble something together with http://search.cpan.org/~ilyam/Data-Dumper-2.121/Dumper.pm 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.

IshmaelGraves at Ask.Metafilter.Com Visit the source

Was this solution helpful to you?

Other answers

crunchburger

http://search.cpan.org/~ams/Storable-2.09/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.

nicwolff

# 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 ) );

nicwolff

http://www.ilrt.bris.ac.uk/discovery/2001/02/squish/ looks interesting, but worryingly old, and i guess you'd have found it yourself via google.

andrew cooke

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.

IshmaelGraves

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.