35
36:- module(cp_parms,
37 [
38 ]). 39:- use_module(library(settings)). 40:- use_module(library(semweb/rdf_db)). 41:- use_module(library(http/html_write)). 42:- use_module(library(http/http_hook)). 43
57
58 61
62:- multifile
63 user:file_search_path/2. 64
66user:file_search_path(rdfql, cliopatria(rdfql)).
67user:file_search_path(cpack, cliopatria(cpack)).
68
70user:file_search_path(web, web).
71
73user:file_search_path(config_https, cp_application('config-enabled/https')).
74
76user:file_search_path(cpacks, cliopatria('.')).
77
78user:file_search_path(library, cpacks(lib)).
79user:file_search_path(rdf, cpacks(rdf)).
80user:file_search_path(entailment, cpacks(entailment)).
81user:file_search_path(components, cpacks(components)).
82user:file_search_path(applications, cpacks(applications)).
83user:file_search_path(api, cpacks(api)).
84user:file_search_path(user, cpacks(user)).
85user:file_search_path(config_available, cpacks('config-available')).
86user:file_search_path(skin, cpacks(skin)).
87user:file_search_path(web, cpacks(web)).
88user:file_search_path(css, web(css)).
89user:file_search_path(icons, web(icons)).
90user:file_search_path(yui, web('yui/2.7.0')).
91user:file_search_path(js, web(js)).
92user:file_search_path(html, web(html)).
93user:file_search_path(help, web(help)).
94user:file_search_path(tutorial, web(tutorial)).
95user:file_search_path(flint, web('FlintSparqlEditor/sparql')).
96user:file_search_path(yasqe, web('yasqe/dist')).
97user:file_search_path(yasr, web('yasr/dist')).
98
99
100 103
104http:location(cliopatria, root(.), []).
105http:location(web, cliopatria(web), []).
106http:location(sesame, root(servlets), []).
107http:location(sparql, root(sparql), []).
108http:location(rdf_browser, cliopatria(browse), []).
109http:location(flint, cliopatria(flint), []).
110http:location(api, cliopatria(api), []).
111http:location(json, api(json), []).
112http:location(yasgui, cliopatria(yasgui), []).
113http:location(yasqe, cliopatria(yasqe), []).
114http:location(yasr, cliopatria(yasr), []).
115
116 119
122
123:- multifile
124 error:has_type/2,
125 settings:eval_default/3,
126 settings:convert_text/3,
127 http_settings:input_item/5. 128
129error:has_type(uri, X) :- 130 atom(X). 131
132 133settings:eval_default(URI, uri, URI) :-
134 atom(URI),
135 !.
136settings:eval_default(NS:Local, uri, URI) :-
137 rdf_global_id(NS:Local, URI).
138
139settings:convert_text(uri, Text, URI) :-
140 !,
141 ( sub_atom(Text, B, _, A, :),
142 sub_atom(Text, 0, B, _, NS),
143 sub_atom(Text, _, A, 0, Local),
144 identifier(NS),
145 identifier(Local)
146 -> rdf_global_id(NS:Local, URI)
147 ; URI = Text
148 ).
149
156
157identifier(Text) :-
158 atom_codes(Text, Codes),
159 identifier_codes(Codes).
160
161identifier_codes([]).
162identifier_codes([H|T]) :-
163 identifier_code(H),
164 identifier_codes(T).
165
166identifier_code(C) :-
167 code_type(C, csym).
168
169 170http_settings:input_item(uri, Value, Name) -->
171 html(input([name(Name), size(40), value(Value)])).
172
173
174 177
178:- setting(http:port, any, env('PORT', 3020),
179 'Port the http server listens to or interface:port'). 180:- setting(http:workers, between(1, 20), env('PROLOG_HTTP_WORKERS', 5),
181 'Number of server threads'). 182:- setting(http:worker_options, list(any), [],
183 'Additional options to pass to the HTTP server'). 184:- setting(http:max_idle_time, nonneg, 3600,
185 'Session timeout. If 0, session never times out'). 186:- setting(http:server_url, atom, 'http://localhost:'+setting(http:port),
187 'Url of the server itself'). 188:- if(\+current_setting(http:prefix)). 189:- setting(http:prefix, atom, '',
190 'Prefix to rebase the server'). 191:- endif. 192
193
194 197
198:- setting(cliopatria:user_data, atom, 'users.db',
199 'File holding account information'). 200:- setting(cliopatria:enable_self_register, boolean, false,
201 'Set to true to allow users to self register'). 202:- setting(cliopatria:default_entailment, atom, rdfs,
203 'Default entailment rules applied'). 204:- setting(cliopatria:optimise_query, boolean, true,
205 'Optimise queries before execution'). 206:- setting(cliopatria:rdf_db_namespaces, boolean, true,
207 'Allow registered namespaces in queries'). 208:- setting(cliopatria:persistent_store, atom, '',
209 'Directory for persistent copy of in-memory RDF'). 210:- setting(cliopatria:pre_index_tokens, boolean, false,
211 'Build the fulltext token index while loading'). 212:- setting(cliopatria:pre_index_stems, boolean, false,
213 'Build the fulltext stem index while loading'). 214
215
216 219
220:- setting(sparql:max_clients, nonneg, 100,
221 'Maximum number of concurrent requests'). 222:- setting(sparql:stack_size, nonneg, 1000,
223 'Size of the global stack in mega-bytes'). 224
225 228
229:- setting(cpa_browse:resource_format, atom, nslabel,
230 'Default resource_format passed to rdf_link//2').