Find dereferencable URIs for tracks in your personal music collection
By Yves on Wednesday 23 May 2007, 18:27 - Permalink
Things are moving fast, since my last post. Indeed, Frederick just put online the Musicbrainz RDF dump, with dereferencable URIs, SPARQL end-point, everything. Great job Fred!!
This data set will surely be a sort of hub
for music-related data on
the Semantic Web, as it gives URIs for a large number of
artists, tracks, albums, but also timelines, performances, recordings, etc.
Well, almost everything defined in the Music
Ontology.
I am happy to announce the first hack using this dataset:-) This is called
GNAT (for GNAT is
not a tagger
). It is just some lines of python code which, from an audio
file in your music collection, gives you the corresponding dereferencable
URI.
It also puts this URI into the ID3v2 Universal File Identifier (UFID) frame. I am not sure it is the right place to put such an information though, as it is an identifier of the manifestation, not the item iself. Maybe I should use the user-defined link frames in the ID3v2 header...
So it is actually the first step of the application mentioned here!
It is quite easy to use:
$ python trackuri.py 7-don\'t_look_back.mp3 - ID3 tags Artist: Artemis Title: Don't Look Back Album: Undone - Zitgist URI http://zitgist.com/music/track/2b78923b-c260-44c1-b333-2caa020df172
Then:
$ eyeD3 7-don\'t_look_back.mp3 7-don't_look_back.mp3 [ 3.23 MB ] -------------------------------------------------------------------------------- Time: 3:31 MPEG1, Layer III [ 128 kb/s @ 44100 Hz - Stereo ] -------------------------------------------------------------------------------- ID3 v2.4: title: Don't Look Back artist: Artemis album: Undone year: 2000 track: 7 genre: Trip-Hop (id 27) Unique File ID: [http://zitgist.com/music/] http://zitgist.com/music/track/2b78923b-c260-44c1-b333-2caa020df172 Comment: [Description: http] [Lang: ] //www.magnatune.com/artists/artemis Comment: [Description: ID3v1 Comment] [Lang: XXX] From www.magnatune.com
You can also output the corresponding RDF, in RDF/XML or N3:
$ python trackuri.py 1-i\'m_alive.mp3 xml
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:_3="http://purl.org/ontology/mo/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>
<rdf:Description
rdf:about=
"http://zitgist.com/music/track/67a1fab6-aea4-47f4-891d-6d42bb856a40">
<_3:availableAs rdf:resource=""/>
</rdf:Description>
</rdf:RDF>
$ python trackuri.py 1-i\'m_alive.mp3 n3 @prefix _3: <http://zitgist.com/music/track/67>. @prefix _4: <http://purl.org/ontology/mo/>. _3:a1fab6-aea4-47f4-891d-6d42bb856a40 _4:availableAs <>.
... even though I still have to put the good Item URI, instead of <>.
Get it!
You can download the code here, and it is GPL licensed.
The dependencies are:
- python-id3
- python-musicbrainz2
- RDFLib (
easy_install -U rdflib) - mutagen (
easy_install -U mutagen)
Comments
Nice blog! detecting dereferencable music url's is a great way to protect home video entertainment . Nice post..:D thanks You really help musical sites just like http://www.mvphomevideo.com
on the perfect new car you'll have to remember to are receiving a automobile which matches a call for. Even tho it's a families auto you want to find or maybe more of merely one consumer extravagant car or truck, you can acquire a large number of interesting products coming from Cars. Listed below are some of the more prominent Hyundai cars or trucks which will be introduced using suppliers concerning Hyundai autos when it comes to Mesa. Cars Elantra All of the Elantra download insanity workout is.
and resort the day after tomorrow to say thank you to me and my peers. He or she as well as Exercise several contacted france Embassy into Kabul that this Frenchwoman promptly was actually cause a healthcare facility to look through some kind of pressing appendectomy. It had been certainly a good dial that shook along the good friend .. Our alliance around Md relating to free from harm multinational trip around 40 abroad destinations offers snorkel is the prime together with preventive programs while met with high risk st scenario. Each individual united states individual custom claims according to possibility of cows driving on the road, car accident likely freeways, perils of motoring later in the day plus.