Difference between revisions of "LinkedBrainz/RDFa"

From MusicBrainz Wiki
Jump to navigationJump to search
Line 9: Line 9:
   
 
sudo apt-get install raptor-utils
 
sudo apt-get install raptor-utils
  +
  +
Then you can use rapper. Assuming you are familiar with the [http://www.w3.org/2007/02/turtle/primer/ turtle RDF syntax], you can view the RDF model on a page using
  +
  +
rapper -i rdfa -o turtle MUSICBRAIN_URL
   
 
Another option is to use the web interface at [http://check.rdfa.info/ check.rdfa.info]. However, MusicBrainz's restrictive robots.txt is obeyed by that interface so you must copy and paste the HTML source using the direct input option. The copy-and-paste workflow is quite annoying, but no software or libraries need to be installed.
 
Another option is to use the web interface at [http://check.rdfa.info/ check.rdfa.info]. However, MusicBrainz's restrictive robots.txt is obeyed by that interface so you must copy and paste the HTML source using the direct input option. The copy-and-paste workflow is quite annoying, but no software or libraries need to be installed.

Revision as of 14:59, 14 September 2010

Attention.png Warning - this applies post Beta3 releases and will not work even on http://test.musicbrainz.org/ - it is currently working on http://mbz.catfishsmooth.net/--Kurtjx 19:44, 13 September 2010 (UTC)

RDFa is a W3C recommendation for embedding RDF data in HTML. The insertion of RDFa into MusicBrainz is part of the LinkedBrainz project and is intended to follow the NGS to RDF mappings.

Consuming RDFa

There are several ways to consume RDFa present in MusicBrainz pages.

Using the rapper command line tool is perhaps the easiest way to get a feel for the model embedded in the MusicBrainz RDFa. On Ubuntu/Debian systems you can install with

  sudo apt-get install raptor-utils

Then you can use rapper. Assuming you are familiar with the turtle RDF syntax, you can view the RDF model on a page using

  rapper -i rdfa -o turtle MUSICBRAIN_URL

Another option is to use the web interface at check.rdfa.info. However, MusicBrainz's restrictive robots.txt is obeyed by that interface so you must copy and paste the HTML source using the direct input option. The copy-and-paste workflow is quite annoying, but no software or libraries need to be installed.

A rather comprehensive list of libraries in various programming languages for consuming RDFa at the RDFa.info wiki.


Notes about pagination

Information about entities in the MusicBrainz website are generally spread across several tabs (tabination). Long lists of results (e.g. if an artist has several hundred releases) are spread across several pages (pagination). The RDFa in MusicBrainz adheres to this same tabination/pagination scheme.