Chris@0: :- module(jamendo_mapping,[]). Chris@0: Chris@0: /** Chris@0: * Jamendo mapping for 303 redirects Chris@0: */ Chris@0: Chris@0: Chris@0: :- use_module(mapping). Chris@0: Chris@0: Chris@6: sparql_end_point('http://dbtune.org/jamendo/sparql/'). Chris@0: html_renderer('http://dig.csail.mit.edu/2005/ajar/ajaw/tab.html?uri='). Chris@0: directory('http://dbtune.org/jamendo/all/'). Chris@0: namespace('http://dbtune.org/jamendo/'). Chris@0: Chris@0: /** Chris@0: * Redirecting doc Chris@0: */ Chris@0: mapping:see_other(requested_pattern([]),redirect_pattern(['http://moustaki.org/','jamendo/'])). Chris@0: Chris@0: /** Chris@0: * Redirecting end point Chris@0: */ Chris@0: mapping:see_other(requested_pattern([sparql]),redirect_pattern(['http://dbtune.org:2105/sparql/'])):-!. Chris@0: Chris@0: /** Chris@0: * Redirecting end point web interface Chris@0: */ Chris@0: mapping:see_other(requested_pattern([wsparql]),redirect_pattern(['http://dbtune.org:2105/'])):-!. Chris@0: Chris@0: /** Chris@0: * Redirecting resources whithin the namespace Chris@0: */ Chris@0: Chris@0: mapping:see_other_rdf(requested_pattern(T),redirect_pattern([SparqlEndPoint,'?query=describe%20%3C',NameSpace,Path,'%3E'])) :- Chris@0: T\=[all,_], Chris@0: sparql_end_point(SparqlEndPoint), Chris@0: namespace(NameSpace), Chris@0: concat_atom(T,'/',Path). Chris@0: mapping:see_other(requested_pattern(T),redirect_pattern([Renderer,NameSpace,Path])) :- Chris@0: T\=[all,_], Chris@0: html_renderer(Renderer), Chris@0: namespace(NameSpace), Chris@0: concat_atom(T,'/',Path). Chris@0: Chris@0: Chris@0: /** Chris@0: * directories Chris@0: */ Chris@6: directory_query(Concept, Chris@6: [SparqlEndPoint, Chris@6: '?query=construct { %3fx a ', Concept, Chris@6: '} where { %3fx a ', Concept, '.}' Chris@6: ]) :- Chris@6: sparql_end_point(SparqlEndPoint). Chris@6: Chris@6: mapping:see_other_rdf(requested_pattern([all,artist]), redirect_pattern(Query)) :- Chris@6: directory_query('%3Chttp://purl.org/ontology/mo/MusicArtist%3E', Query). Chris@6: Chris@6: mapping:see_other_rdf(requested_pattern([all,track]), redirect_pattern(Query)) :- Chris@6: directory_query('%3Chttp://purl.org/ontology/mo/Track%3E', Query). Chris@6: Chris@6: mapping:see_other_rdf(requested_pattern([all,record]), redirect_pattern(Query)) :- Chris@6: directory_query('%3Chttp://purl.org/ontology/mo/Record%3E', Query). Chris@6: Chris@6: mapping:see_other_rdf(requested_pattern([all,performance]), redirect_pattern(Query)) :- Chris@6: directory_query('%3Chttp://purl.org/ontology/mo/Performance%3E', Query). Chris@6: Chris@6: mapping:see_other_rdf(requested_pattern([all,signal]), redirect_pattern(Query)) :- Chris@6: directory_query('%3Chttp://purl.org/ontology/mo/Signal%3E', Query). Chris@6: Chris@6: mapping:see_other_rdf(requested_pattern([all,timeline]), redirect_pattern(Query)) :- Chris@6: directory_query('%3Chttp://purl.org/NET/c4dm/timeline.owl#TimeLine%3E', Query). Chris@0: Chris@0: mapping:see_other(requested_pattern([all,Concept]),redirect_pattern([Renderer,Directory,Concept])) :- Chris@0: html_renderer(Renderer), Chris@0: directory(Directory).