RockOntology is a website that shows a visual representation of the rock taxonomy. All the informations are retrieved online with sparql queries over www.dbpedia.org.
The web server server.py
is both a static web server that provides the main page of the application and a REST endpoint.
The rest endpoint exposes the following interface:
- GET /query/genre/info?genre=genre_name returns the informations about the genre genre_name
{
"data":{
"origin":"year of origin",
"info":"textual description"
}
}
- GET /query/artist/info?artist=artist_name returns informations about the artist artist_name
{
"data":{
"abstract": "textual description of artist_name"
}
}
- GET /query/genre/artists?genre=genre_name returns all the artists involved in genre genre_name
{
"data":[
"artist1",
"artist2",
"..."
]
}
- GET /query/genre/groups?genre=genre_name returns all the groups involved in genre genre_name
{
"data":[
"group1",
"group2",
"..."
]
}
- GET /query/genre/subgenres?genre=genre_name returns all the subgenres of the genre genre_name
{
"data":[
"subgenre1",
"subgenre2",
"..."
]
}
- GET /query/genre/fusiongenres?genre=genre_name returns all the fusiongenres of the genre genre_name
{
"data":[
"fusiongenre1",
"fusiongenre2",
"..."
]
}
In the folder /queries there are templates of SPARQL queries. Each template is mapped to a request. When the web server receives a request it loads and compiles the related template and executes the SPARQL query using Apache Jena SPARQL engine. The result is collected in JSON format and it is forwarded to the client.