I am new at freebase , I just need to get the genre for a certain artist using MQ开发者_如何转开发L
Thanks
This will give you the first 100 musical artists with their name, genres, and Freebase IDs.
[{
"type":"/music/artist",
"id":null,
"name":null
"genre":[],
}]
To get the genres for a given artist, just specify the ID instead of leaving it blank. Note that an artist can have multiple genres, so you need to query it using array syntax. The default return property is the name. If you'd prefer the ID or ID and name, just specify that in the query using this syntax:
'genre':[{'id':null,'name':null}]
you could even get fancy and fetch the parent genres too using
'genre':[{'id':null,'name':null,'parent_genre':[]}]
although the genre hierarchy is pretty noisy and not too well curated.
[{ "type":"/music/artist", "id":null, "name":null "genre":[], }]
this should give you what you want.You should substitute the name of the artist or the id to get the result.
Since you are new ,you can look at the following as a start
https://github.com/narphorium/freebase-java-api
精彩评论