History:RDF: Difference between revisions

From MusicBrainz Wiki
Jump to navigationJump to search
(changed ClientLibrary to ["libmusicbrainz"] and TechnicalFAQ to ["Products"] (Imported from MoinMoin))
mNo edit summary
 
(10 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Status|This web service format has been removed! For details of the current webservice please see [[XML Web Service]].}}{{HistoryHeader}}
==What is RDF?==


==What is RDF?==
[[Image:Attention.png]] This web service format has been deprecated! For details please see [[Web Service|WebService]].


'''RDF''' ('''R'''esource '''D'''escription '''F'''ramework) is a [http://www.w3.org/RDF/ 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).
'''RDF''' ('''R'''esource '''D'''escription '''F'''ramework) is a [http://www.w3.org/RDF/ 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).
Line 7: Line 7:
==How does Music Brainz use RDF?==
==How does Music Brainz use RDF?==


There are two different '''views''' on the [[Metadata|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|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 [[MusicBrainz Tagger|MusicBrainzTagger]] and the next generation [[Picard Tagger|PicardTagger]]. They lookup the [[Metadata|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|MetaData]] (see the [[Client HOWTO|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]]).
There are two different '''views''' on the [[Metadata|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|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 [[MusicBrainz Tagger]] and the next generation [[MusicBrainz Picard]] tagger. They lookup the [[Metadata|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|MetaData]] (see the [[Client HOWTO|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 [http://musicbrainz.org/MM/index.html 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 [[Advanced Relationships|AdvancedRelationships]] lacks some features and is very buggy at the moment so it will surely be changed a lot.
The format used to describe the data is called '''[[MusicBrainz]] Metadata Initiative'''. The [http://musicbrainz.org/MM/index.html 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 [[Advanced Relationships|AdvancedRelationships]] lacks some features and is very buggy at the moment so it will surely be changed a lot.
Line 16: Line 16:


If you browse through the artists in MB and click on the [http://musicbrainz.org/track/57ee036f-6b2c-4725-9b9e-f6151ff3c18b.html 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:
If you browse through the artists in MB and click on the [http://musicbrainz.org/track/57ee036f-6b2c-4725-9b9e-f6151ff3c18b.html 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:
* The artist resource: [http://musicbrainz.org/mm-2.1/artist/ http://musicbrainz.org/mm-2.1/artist/]<Artist MB Id>
* The artist resource: <nowiki>http://musicbrainz.org/mm-2.1/artist/</nowiki><code><Artist MBID></code> ([http://musicbrainz.org/mm-2.1/artist/00a9f935-ba93-4fc8-a33a-993abe9c936b example])
* The album resource: [http://musicbrainz.org/mm-2.1/album/ http://musicbrainz.org/mm-2.1/album/]<Album MB Id>
* The album resource: <nowiki>http://musicbrainz.org/mm-2.1/album/</nowiki><code><Album MBID></code> ([http://musicbrainz.org/mm-2.1/album/dc60e2bd-7fbc-4586-acac-a99acff7e6a3 example])
* The track resource: [http://musicbrainz.org/mm-2.1/track/ http://musicbrainz.org/mm-2.1/track/]<Track MB Id>
* The track resource: <nowiki>http://musicbrainz.org/mm-2.1/track/</nowiki><code><Track MBID></code> ([http://musicbrainz.org/mm-2.1/track/57ee036f-6b2c-4725-9b9e-f6151ff3c18b example])


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 http://musicbrainz.org/mm-2.1/track/57ee036f-6b2c-4725-9b9e-f6151ff3c18b/4]).
Note: you can extend the results of these queries by adding the '''depth''' parameter at the end of the URL after a slash, <nowiki>http://musicbrainz.org/mm-2.1/track/</nowiki><code><Track MBID></code>'''/4''' ([http://musicbrainz.org/mm-2.1/track/57ee036f-6b2c-4725-9b9e-f6151ff3c18b/4 example]).


Other resources that can be accessed via GET:
Other resources that can be accessed via GET:
* Information about TRM Ids: [http://musicbrainz.org/mm-2.1/trmid/ http://musicbrainz.org/mm-2.1/trmid/]<TRM Id>
* Artist relationships: <nowiki>http://musicbrainz.org/mm-2.1/artistrel/</nowiki><code><Artist MBID></code> ([http://musicbrainz.org/mm-2.1/artistrel/00a9f935-ba93-4fc8-a33a-993abe9c936b example])
* Artist relationships: [http://musicbrainz.org/mm-2.1/artistrel/ http://musicbrainz.org/mm-2.1/artistrel/]<Artist MB Id>
* Album relationships: <nowiki>http://musicbrainz.org/mm-2.1/albumrel/</nowiki><code><Album MBID></code> ([http://musicbrainz.org/mm-2.1/albumrel/dc60e2bd-7fbc-4586-acac-a99acff7e6a3 example])
* Album relationships: [http://musicbrainz.org/mm-2.1/albumrel/ http://musicbrainz.org/mm-2.1/albumrel/]<Album MB Id>
* Track relationships: <nowiki>http://musicbrainz.org/mm-2.1/trackrel/</nowiki><code><Track MBID></code> ([http://musicbrainz.org/mm-2.1/trackrel/57ee036f-6b2c-4725-9b9e-f6151ff3c18b example])
* Track relationships: [http://musicbrainz.org/mm-2.1/trackrel/ http://musicbrainz.org/mm-2.1/trackrel/]<Track MB Id>


Other queries can be performed by sending RDF requests to the server, POSTing them at the URL [http://musicbrainz.org/cgi-bin/mq_2_1.pl http://musicbrainz.org/cgi-bin/mq_2_1.pl]. These are (only the names of them) :
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 http://musicbrainz.org/cgi-bin/mq_2_1.pl]. These are (only the names of them):
* GetCDInfo
* GetCDInfo
* TrackInfoFromTRMId
* TrackInfoFromTRMId
Line 41: Line 40:
* 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.

==Future Development==

Instead of extending the RDF export, it is more realistic that it will be replaced by a [[XML Web Service|XMLWebService]] in the future.

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

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

Latest revision as of 18:48, 25 October 2011

Status: This web service format has been removed! For details of the current webservice please see XML Web Service.
Status: This Page is Glorious History!

The content of this page either is bit-rotted, or has lost its reason to exist due to some new features having been implemented in MusicBrainz, or maybe just described something that never made it in (or made it in a different way), or possibly is meant to store information and memories about our Glorious Past. We still keep this page to honor the brave editors who, during the prehistoric times (prehistoric for you, newcomer!), struggled hard to build a better present and dreamed of an even better future. We also keep it for archival purposes because possibly it still contains crazy thoughts and ideas that may be reused someday. If you're not into looking at either the past or the future, you should just disregard entirely this page content and look for an up to date documentation page elsewhere.

What is RDF?

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 MusicBrainz Tagger and the next generation MusicBrainz Picard tagger. 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:

  • The artist resource: http://musicbrainz.org/mm-2.1/artist/<Artist MBID> (example)
  • The album resource: http://musicbrainz.org/mm-2.1/album/<Album MBID> (example)
  • The track resource: http://musicbrainz.org/mm-2.1/track/<Track MBID> (example)

Note: you can extend the results of these queries by adding the depth parameter at the end of the URL after a slash, http://musicbrainz.org/mm-2.1/track/<Track MBID>/4 (example).

Other resources that can be accessed via GET:

  • Artist relationships: http://musicbrainz.org/mm-2.1/artistrel/<Artist MBID> (example)
  • Album relationships: http://musicbrainz.org/mm-2.1/albumrel/<Album MBID> (example)
  • Track relationships: http://musicbrainz.org/mm-2.1/trackrel/<Track MBID> (example)

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.