History:RDF: Difference between revisions

From MusicBrainz Wiki
Jump to navigationJump to search
m (9 revision(s))
m (removed author(s))
Line 41: Line 41:
* SubmitTRMList
* SubmitTRMList


Please consult the [[libmusicbrainz]] [http://users.musicbrainz.org/~luks/docs/mb_client-2.1.2/queries_8h.html documentation] for detailed info.
Please consult the [[libmusicbrainz]] [http://users.musicbrainz.org/~luks/docs/mb_client-2.1.2/queries_8h.html documentation] for detailed info.

----- Original author: [[User:Shepard|Shepard]]


[[Category:To Be Reviewed]] [[Category:Terminology]]
[[Category:To Be Reviewed]] [[Category:Terminology]]

Revision as of 10:16, 19 March 2009

What is RDF?

Attention.png This web service format has been deprecated! For details please see WebService.

RDF (Resource Description Framework) is a W3C standard for describing resources. RDF itself defines how information about these resources are linked together in abstract models though there are also specifications on how to serialize these models to XML and other forms (N-Triples to name one).

How does Music Brainz use RDF?

There are two different views on the MetaData collected in the MusicBrainz data base. One is the website and the other one is the RDF export. Using the RDF export you can access the MetaData as XML serialized RDF which can easily be processed by programs (so they don't have to parse the web page :) ). Programs doing this at the moment are the MusicBrainzTagger and the next generation PicardTagger. They lookup the MetaData used for tagging files only through RDF. Both use libmusicbrainz written in C which you can also use to enhance your programs with MusicBrainz MetaData (see the ClientHOWTO for more info on how this works; if you're looking for alternatives to the C library take a look at the others developer resources in MusicBrainz Products).

The format used to describe the data is called MusicBrainz Metadata Initiative. The documentation about this is rather incomplete and outdated. There are changes made to the format from time to time but due to the flexibility of RDF the export stays downward compatible. Though there is no guarantee this stays the same in the future. The relatively new format AR 1.0 used to describe AdvancedRelationships lacks some features and is very buggy at the moment so it will surely be changed a lot.

How do I access the RDF data?

That depends on what you want to lookup. In general the RDF exports are accessed as XML streams via HTTP from the web server. Some can be accessed from URLs using the GET method, some require POSTing requests to a special URL.

If you browse through the artists in MB and click on the View Info links you can find some of the links used to address RDF resources about the entities in the MusicBrainz data base. Namely they are:

Note: you can extend the results of these queries by adding the depth parameter at the end of the URL after a slash (example: http://musicbrainz.org/mm-2.1/track/57ee036f-6b2c-4725-9b9e-f6151ff3c18b/4).

Other resources that can be accessed via GET:

Other queries can be performed by sending RDF requests to the server, POSTing them to the URL http://musicbrainz.org/cgi-bin/mq_2_1.pl. These are (only the names of them):

  • GetCDInfo
  • TrackInfoFromTRMId
  • QuickTrackInfoFromTrackId
  • FindArtist
  • FindAlbum
  • FindTrack
  • FindDistinctTRMID
  • FileInfoLookup
  • AuthenticateQuery
  • SubmitTrack
  • SubmitTRMList

Please consult the libmusicbrainz documentation for detailed info.