Mercurial > hg > dbtune-rdf-services
view cmn/urispace/cmn_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 | b6fb37c8b8d3 |
children |
line wrap: on
line source
:- module(cmn_mapping,[]). /** * Cmn mapping for 303 redirects */ :- use_module(mapping). sparql_end_point('http://dbtune.org/cmn/sparql/'). html_renderer('http://dig.csail.mit.edu/2005/ajar/ajaw/tab.html?uri='). directory('http://dbtune.org/cmn/all/'). namespace('http://dbtune.org/cmn/'). /** * 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,composer]), redirect_pattern(Query)) :- directory_query('%3Chttp://purl.org/ontology/mo/Composer%3E', Query). mapping:see_other(requested_pattern([all,Concept]),redirect_pattern([Renderer,Directory,Concept])) :- html_renderer(Renderer), directory(Directory).