view classical/urispace/classical_mapping.pl @ 16:ab3e3ac0119f

Restore this (referenced but not actually used in practice?) assertion.
author Chris Cannam
date Tue, 07 Nov 2017 11:44:02 +0000
parents 91b5145fff34
children c14a90b92260
line wrap: on
line source
:- module(classical_mapping,[]).

/**
 * Classical mapping for 303 redirects
 */

:- use_module(mapping).

sparql_end_point('http://dbtune.org/classical/sparql/').
html_renderer('http://dig.csail.mit.edu/2005/ajar/ajaw/tab.html?uri=').
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).