Topic: Exporting Data

I am a school librarian who has been asked to catalog almost 1000 classical, jazz and rock LPs.  In the book world, I reach out to the Library of Congress for copy cataloging to import into my library database, using the MARC format.  I was looking for something similar for music, and discovered this site.

Is it possible to export a record in a tagged format for importing into a database?  My life would be so much easier if it is.

Thanks!

Re: Exporting Data

We've got several different interfaces for getting data out of MusicBrainz, so I'm sure there's a way to get the data you want (though I can't guarantee it won't need massaging to be in the right format, of course!).

The two main ways are via the XML Web Service and by way of a database dump (and setting up your own copy of our database/the server).

First, the XML Web Service -- this will be more user-friendly, if it can serve your needs. The documentation for the XML Web Service is at http://musicbrainz.org/doc/XML_Web_Service/Version_2 -- depending on your technical expertise that could range from helpful to incomprehensible. If you can read XML schemas, http://svn.musicbrainz.org/mmd-schema/t … md-2.0.rng is the one our webservice follows. If none of this made any sense, perhaps just looking at a piece of example output will help: http://musicbrainz.org/ws/2/release/445 … level-rels (note, however, that that's a particularly large amount of ?inc parameters for a particularly well-linked release -- so that result's a lot larger than what you'd usually be seeing, and a lot of what's included there is optional).

The other option for getting data out of MusicBrainz is to set up a copy of the database that runs the site itself! Full dumps of the database are regularly exported and uploaded to ftp://ftp.musicbrainz.org/pub/musicbrai … ullexport/ where you can download them. The code for the server is available from https://github.com/metabrainz/musicbrainz-server, which provides the mechanism to import the database and run a complete copy of what you see on musicbrainz.org. For a lighter-weight option, there's https://github.com/lalinsky/mbslave (which is designed for setting up only the database, not running a complete copy of the site). With this option you have complete access to the data, of course, but you'll probably need to know SQL (and possibly other languages for postprocessing) to get at it and format it as you please. You can also use the data dumps directly, though it's far from recommended (SQL is a lot better at managing that data!); once you unpack all the compressed files there's one file per database table, tab-separated values.

I don't know if you have any sort of specification of what information you want and in what precise format, but hopefully these methods can at least approximate what you need! If you need help with the web service or setting up a server, me and the other developers (plus a variety of other knowledgeable people) hang out in IRC and are available for questions most times of day and night (we're all fairly geographically distributed) -- we're on irc.freenode.net, channels #musicbrainz and #musicbrainz-devel -- which you can get to in your web browser from http://webchat.freenode.net/?channels=m … usicbrainz if you don't have an IRC client installed.

Or, of course, you can ask here.

Re: Exporting Data

I have extensive knowledge of HTML, so XML doesn't look completely foreign.  However, it isn't clear to me just how I use this to extract data.  Assuming I construct a string of commands to find an album and retrieve tagged data, how do I submit this to MusicBrainz?  It seems the most basic of questions, but I'm stumped.

Re: Exporting Data

Hm; I think I may have misunderstood your initial question somewhat. Reading it, I thought what you wanted was to get data from MusicBrainz and enter it into your library's database. Your last question seems to be the other direction -- you have some data, and you'd like to enter it into MusicBrainz.

Unfortunately it doesn't work the same both ways in that regard -- while it's possible to get data *from* MusicBrainz using the API, submitting it to be entered into the edit queue isn't quite as straightforward; for that you currently still need to use the main web interface (for most types of data, anyway -- a few things, such as ISRCs and barcodes, can be submitted through the web service). There do exist some frameworks for performing edits on MusicBrainz, which automatically go through the process you'd go through as a person using a web browser in order to submit edits. Everything goes through the moderation process, of course, no matter the source.

If my initial reading was correct (perhaps you're hoping to go both ways?), processing the XML into whatever format you need it to be for importing to your library database is probably a task for a general programming language; if you know what format it needs to be in I can at least point you the right way, but I don't know what library database software you're using, or what it needs in order to import data from an external source :)

So, I guess I'm hoping you can clarify your needs -- I'm guessing that we don't have something already-built to do exactly what you need, but it might not be too difficult a task depending on the specifics.