The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

AudioFile::Identify::MusicBrainz::RDF

DESCRIPTION

MusicBrainz does all its RPC stuff by posting and returning RDF. Which is an odd approach, but it seems to work, so what the hell. The C client libraries take the same general approach as I'm using here - they parse incoming RDF with proper XML libraries, but the outgoing stuff is all boilerplate RDF taken from a file 'queries.h' in the distro.

Rather than generate outgoing RDF properly, we have generated this file from queries.h, converting it into somewhat ugly perl, and sticking a wrapper function at the bottom. queries.h contains the following text:

   MusicBrainz -- The Internet music metadatabase

   Copyright (C) 2000 Robert Kaye
   
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.
   
   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.
   
   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

This package implements one method.

rdf($name, $values)

Get the RDF boilerplate named '$name' from the file, and substitute in the vaules from $vaules, a hashref. For example:

  use AudioFile::Identify::MusicBrainz::RDF qw(rdf); # export the rdf function
  my $query = rdf("MBQ_GetTrackById", { 1 => "http://musicbrainz.url", DEPTH => '4' } );

The boilerplate stuff annoyingly uses numbered values. Look at the source of this file if you want to use any of the queries directly.

SEE ALSO

See also queries.h in the MusicBrainz client library. http://musicbrainz.org/products/client/download.html