Mercurial > hg > dbtune-rdf-services
diff classical/urispace/classical_mapping.pl @ 14:91b5145fff34
Classical dataset
author | Chris Cannam |
---|---|
date | Tue, 07 Nov 2017 11:22:37 +0000 |
parents | |
children | ab3e3ac0119f |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/classical/urispace/classical_mapping.pl Tue Nov 07 11:22:37 2017 +0000 @@ -0,0 +1,44 @@ +:- module(classical_mapping,[]). + +/** + * Classical mapping for 303 redirects + */ + +:- use_module(mapping). + +sparql_end_point('http://dbtune.org/classical/sparql/'). +directory('http://dbtune.org/classical/all/'). +namespace('http://dbtune.org/classical/'). + +/** + * 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://dbtune.org/classical/resource/type/Composer%3E', Query). + +mapping:see_other(requested_pattern([all,Concept]),redirect_pattern([Renderer,Directory,Concept])) :- + html_renderer(Renderer), + directory(Directory).