Chris@14
|
1 :- module(classical_mapping,[]).
|
Chris@14
|
2
|
Chris@14
|
3 /**
|
Chris@14
|
4 * Classical mapping for 303 redirects
|
Chris@14
|
5 */
|
Chris@14
|
6
|
Chris@14
|
7 :- use_module(mapping).
|
Chris@14
|
8
|
Chris@14
|
9 sparql_end_point('http://dbtune.org/classical/sparql/').
|
Chris@16
|
10 html_renderer('http://dig.csail.mit.edu/2005/ajar/ajaw/tab.html?uri=').
|
Chris@14
|
11 directory('http://dbtune.org/classical/all/').
|
Chris@14
|
12 namespace('http://dbtune.org/classical/').
|
Chris@14
|
13
|
Chris@14
|
14 /**
|
Chris@14
|
15 * Redirecting resources whithin the namespace
|
Chris@14
|
16 */
|
Chris@14
|
17
|
Chris@14
|
18 mapping:see_other_rdf(requested_pattern(T),redirect_pattern([SparqlEndPoint,'?query=describe%20%3C',NameSpace,Path,'%3E'])) :-
|
Chris@14
|
19 T\=[all,_],
|
Chris@14
|
20 sparql_end_point(SparqlEndPoint),
|
Chris@14
|
21 namespace(NameSpace),
|
Chris@14
|
22 concat_atom(T,'/',Path).
|
Chris@14
|
23 mapping:see_other(requested_pattern(T),redirect_pattern([Renderer,NameSpace,Path])) :-
|
Chris@14
|
24 T\=[all,_],
|
Chris@14
|
25 html_renderer(Renderer),
|
Chris@14
|
26 namespace(NameSpace),
|
Chris@14
|
27 concat_atom(T,'/',Path).
|
Chris@14
|
28
|
Chris@14
|
29
|
Chris@14
|
30 /**
|
Chris@14
|
31 * directories
|
Chris@14
|
32 */
|
Chris@14
|
33 directory_query(Concept,
|
Chris@14
|
34 [SparqlEndPoint,
|
Chris@14
|
35 '?query=construct { %3fx a ', Concept,
|
Chris@14
|
36 '} where { %3fx a ', Concept, '.}'
|
Chris@14
|
37 ]) :-
|
Chris@14
|
38 sparql_end_point(SparqlEndPoint).
|
Chris@14
|
39
|
Chris@17
|
40 mapping:see_other_rdf(requested_pattern([all,composer]), redirect_pattern(Query)) :-
|
Chris@14
|
41 directory_query('%3Chttp://dbtune.org/classical/resource/type/Composer%3E', Query).
|
Chris@14
|
42
|
Chris@17
|
43 mapping:see_other_rdf(requested_pattern([all,composition]), redirect_pattern(Query)) :-
|
Chris@17
|
44 directory_query('%3Chttp://purl.org/ontology/mo/Composition%3E', Query).
|
Chris@17
|
45
|
Chris@17
|
46 mapping:see_other_rdf(requested_pattern([all,work]), redirect_pattern(Query)) :-
|
Chris@17
|
47 directory_query('%3Chttp://purl.org/ontology/mo/MusicalWork%3E', Query).
|
Chris@17
|
48
|
Chris@17
|
49 mapping:see_other_rdf(requested_pattern([all,conductor]), redirect_pattern(Query)) :-
|
Chris@17
|
50 directory_query('%3Chttp://dbtune.org/classical/resource/type/Conductor%3E', Query).
|
Chris@17
|
51
|
Chris@14
|
52 mapping:see_other(requested_pattern([all,Concept]),redirect_pattern([Renderer,Directory,Concept])) :-
|
Chris@14
|
53 html_renderer(Renderer),
|
Chris@14
|
54 directory(Directory).
|