Mercurial > hg > dbtune-rdf-services
comparison classical/urispace/classical_mapping.pl @ 14:91b5145fff34
Classical dataset
author | Chris Cannam |
---|---|
date | Tue, 07 Nov 2017 11:22:37 +0000 |
parents | |
children | ab3e3ac0119f |
comparison
equal
deleted
inserted
replaced
13:a60c54830aaa | 14:91b5145fff34 |
---|---|
1 :- module(classical_mapping,[]). | |
2 | |
3 /** | |
4 * Classical mapping for 303 redirects | |
5 */ | |
6 | |
7 :- use_module(mapping). | |
8 | |
9 sparql_end_point('http://dbtune.org/classical/sparql/'). | |
10 directory('http://dbtune.org/classical/all/'). | |
11 namespace('http://dbtune.org/classical/'). | |
12 | |
13 /** | |
14 * Redirecting resources whithin the namespace | |
15 */ | |
16 | |
17 mapping:see_other_rdf(requested_pattern(T),redirect_pattern([SparqlEndPoint,'?query=describe%20%3C',NameSpace,Path,'%3E'])) :- | |
18 T\=[all,_], | |
19 sparql_end_point(SparqlEndPoint), | |
20 namespace(NameSpace), | |
21 concat_atom(T,'/',Path). | |
22 mapping:see_other(requested_pattern(T),redirect_pattern([Renderer,NameSpace,Path])) :- | |
23 T\=[all,_], | |
24 html_renderer(Renderer), | |
25 namespace(NameSpace), | |
26 concat_atom(T,'/',Path). | |
27 | |
28 | |
29 /** | |
30 * directories | |
31 */ | |
32 directory_query(Concept, | |
33 [SparqlEndPoint, | |
34 '?query=construct { %3fx a ', Concept, | |
35 '} where { %3fx a ', Concept, '.}' | |
36 ]) :- | |
37 sparql_end_point(SparqlEndPoint). | |
38 | |
39 mapping:see_other_rdf(requested_pattern([all,artist]), redirect_pattern(Query)) :- | |
40 directory_query('%3Chttp://dbtune.org/classical/resource/type/Composer%3E', Query). | |
41 | |
42 mapping:see_other(requested_pattern([all,Concept]),redirect_pattern([Renderer,Directory,Concept])) :- | |
43 html_renderer(Renderer), | |
44 directory(Directory). |