Mercurial > hg > dbtune-rdf-services
view jamendo/urispace/jamendo_mapping.pl @ 27:d95e683fbd35 tip
Enable CORS on urispace redirects as well
author | Chris Cannam |
---|---|
date | Tue, 20 Feb 2018 14:52:02 +0000 |
parents | 8c3cb5fb7843 |
children |
line wrap: on
line source
:- module(jamendo_mapping,[]). /** * Jamendo mapping for 303 redirects */ :- use_module(mapping). sparql_end_point('http://dbtune.org/jamendo/sparql/'). html_renderer('http://dig.csail.mit.edu/2005/ajar/ajaw/tab.html?uri='). directory('http://dbtune.org/jamendo/all/'). namespace('http://dbtune.org/jamendo/'). /** * Redirecting doc */ mapping:see_other(requested_pattern([]),redirect_pattern(['http://moustaki.org/','jamendo/'])). /** * Redirecting end point */ mapping:see_other(requested_pattern([sparql]),redirect_pattern(['http://dbtune.org:2105/sparql/'])):-!. /** * Redirecting end point web interface */ mapping:see_other(requested_pattern([wsparql]),redirect_pattern(['http://dbtune.org:2105/'])):-!. /** * Redirecting resources whithin the namespace */ mapping:see_other_rdf(requested_pattern(T),redirect_pattern([SparqlEndPoint,'?query=describe%20%3C',NameSpace,Path,'%3E'])) :- T\=[all,_], sparql_end_point(SparqlEndPoint), namespace(NameSpace), concat_atom(T,'/',Path). mapping:see_other(requested_pattern(T),redirect_pattern([Renderer,NameSpace,Path])) :- T\=[all,_], html_renderer(Renderer), namespace(NameSpace), concat_atom(T,'/',Path). /** * directories */ directory_query(Concept, [SparqlEndPoint, '?query=construct { %3fx a ', Concept, '} where { %3fx a ', Concept, '.}' ]) :- sparql_end_point(SparqlEndPoint). mapping:see_other_rdf(requested_pattern([all,artist]), redirect_pattern(Query)) :- directory_query('%3Chttp://purl.org/ontology/mo/MusicArtist%3E', Query). mapping:see_other_rdf(requested_pattern([all,track]), redirect_pattern(Query)) :- directory_query('%3Chttp://purl.org/ontology/mo/Track%3E', Query). mapping:see_other_rdf(requested_pattern([all,record]), redirect_pattern(Query)) :- directory_query('%3Chttp://purl.org/ontology/mo/Record%3E', Query). mapping:see_other_rdf(requested_pattern([all,performance]), redirect_pattern(Query)) :- directory_query('%3Chttp://purl.org/ontology/mo/Performance%3E', Query). mapping:see_other_rdf(requested_pattern([all,signal]), redirect_pattern(Query)) :- directory_query('%3Chttp://purl.org/ontology/mo/Signal%3E', Query). mapping:see_other_rdf(requested_pattern([all,timeline]), redirect_pattern(Query)) :- directory_query('%3Chttp://purl.org/NET/c4dm/timeline.owl#TimeLine%3E', Query). mapping:see_other(requested_pattern([all,Concept]),redirect_pattern([Renderer,Directory,Concept])) :- html_renderer(Renderer), directory(Directory).