30
31
32:- module(cp_parms,
33 [
34 ]). 35:- use_module(library(settings)). 36:- use_module(library(semweb/rdf_db)). 37:- use_module(library(http/html_write)). 38:- use_module(library(http/http_hook)).
54 57
58:- multifile
59 user:file_search_path/2. 60
62user:file_search_path(rdfql, cliopatria(rdfql)).
63user:file_search_path(cpack, cliopatria(cpack)).
64
66user:file_search_path(web, web).
67
69user:file_search_path(config_https, cp_application('config-enabled/https')).
70
72user:file_search_path(cpacks, cliopatria('.')).
73
74user:file_search_path(library, cpacks(lib)).
75user:file_search_path(rdf, cpacks(rdf)).
76user:file_search_path(entailment, cpacks(entailment)).
77user:file_search_path(components, cpacks(components)).
78user:file_search_path(applications, cpacks(applications)).
79user:file_search_path(api, cpacks(api)).
80user:file_search_path(user, cpacks(user)).
81user:file_search_path(config_available, cpacks('config-available')).
82user:file_search_path(skin, cpacks(skin)).
83user:file_search_path(web, cpacks(web)).
84user:file_search_path(css, web(css)).
85user:file_search_path(icons, web(icons)).
86user:file_search_path(yui, web('yui/2.7.0')).
87user:file_search_path(js, web(js)).
88user:file_search_path(html, web(html)).
89user:file_search_path(help, web(help)).
90user:file_search_path(tutorial, web(tutorial)).
91user:file_search_path(flint, web('FlintSparqlEditor/sparql')).
92user:file_search_path(yasqe, web('yasqe/dist')).
93user:file_search_path(yasr, web('yasr/dist')).
94
95
96 99
100http:location(cliopatria, root(.), []).
101http:location(web, cliopatria(web), []).
102http:location(sesame, root(servlets), []).
103http:location(sparql, root(sparql), []).
104http:location(rdf_browser, cliopatria(browse), []).
105http:location(flint, cliopatria(flint), []).
106http:location(api, cliopatria(api), []).
107http:location(json, api(json), []).
108http:location(yasgui, cliopatria(yasgui), []).
109http:location(yasqe, cliopatria(yasqe), []).
110http:location(yasr, cliopatria(yasr), []).
111
112 115
118
119:- multifile
120 error:has_type/2,
121 settings:eval_default/3,
122 settings:convert_text/3,
123 http_settings:input_item/5. 124
125error:has_type(uri, X) :- 126 atom(X). 127
128 129settings:eval_default(URI, uri, URI) :-
130 atom(URI), !.
131settings:eval_default(NS:Local, uri, URI) :-
132 rdf_global_id(NS:Local, URI).
133
134settings:convert_text(uri, Text, URI) :- !,
135 ( sub_atom(Text, B, _, A, :),
136 sub_atom(Text, 0, B, _, NS),
137 sub_atom(Text, _, A, 0, Local),
138 identifier(NS),
139 identifier(Local)
140 -> rdf_global_id(NS:Local, URI)
141 ; URI = Text
142 ).
151identifier(Text) :-
152 atom_codes(Text, Codes),
153 identifier_codes(Codes).
154
155identifier_codes([]).
156identifier_codes([H|T]) :-
157 identifier_code(H),
158 identifier_codes(T).
159
160identifier_code(C) :-
161 code_type(C, csym).
162
163 164http_settings:input_item(uri, Value, Name) -->
165 html(input([name(Name), size(40), value(Value)])).
166
167
168 171
172:- setting(http:port, any, env('PORT', 3020),
173 'Port the http server listens to or interface:port'). 174:- setting(http:workers, between(1, 20), env('PROLOG_HTTP_WORKERS', 5),
175 'Number of server threads'). 176:- setting(http:worker_options, list(any), [],
177 'Additional options to pass to the HTTP server'). 178:- setting(http:max_idle_time, nonneg, 3600,
179 'Session timeout. If 0, session never times out'). 180:- setting(http:server_url, atom, 'http://localhost:'+setting(http:port),
181 'Url of the server itself'). 182:- if(\+current_setting(http:prefix)). 183:- setting(http:prefix, atom, '',
184 'Prefix to rebase the server'). 185:- endif. 186
187
188 191
192:- setting(cliopatria:user_data, atom, 'users.db',
193 'File holding account information'). 194:- setting(cliopatria:enable_self_register, boolean, false,
195 'Set to true to allow users to self register'). 196:- setting(cliopatria:default_entailment, atom, rdfs,
197 'Default entailment rules applied'). 198:- setting(cliopatria:optimise_query, boolean, true,
199 'Optimise queries before execution'). 200:- setting(cliopatria:rdf_db_namespaces, boolean, true,
201 'Allow registered namespaces in queries'). 202:- setting(cliopatria:persistent_store, atom, '',
203 'Directory for persistent copy of in-memory RDF'). 204:- setting(cliopatria:pre_index_tokens, boolean, false,
205 'Build the fulltext token index while loading'). 206:- setting(cliopatria:pre_index_stems, boolean, false,
207 'Build the fulltext stem index while loading'). 208
209
210 213
214:- setting(sparql:max_clients, nonneg, 100,
215 'Maximum number of concurrent requests'). 216:- setting(sparql:stack_size, nonneg, 1000,
217 'Size of the global stack in mega-bytes'). 218
219 222
223:- setting(cpa_browse:resource_format, atom, nslabel,
224 'Default resource_format passed to rdf_link//2').
ClioPatria parameters
This file contains the locations of file-directories and web-directories in addition to settings that can be managed by the end-user. It should not be necessary to modify this file:
priority(N)
, where N > 0. See http_absolute_location/3.run.pl
[.in] contains an example startup script. */