| author | cavaliet |
| Fri, 06 Sep 2013 14:23:56 +0200 | |
| changeset 45 | 9dd14a51a2bb |
| parent 43 | 829d9d4111da |
| child 48 | e2ccb0093452 |
| permissions | -rw-r--r-- |
| 0 | 1 |
# Django settings for p4l project. |
| 39 | 2 |
from django.conf import global_settings |
| 0 | 3 |
|
4 |
DEBUG = True |
|
5 |
TEMPLATE_DEBUG = DEBUG |
|
6 |
||
7 |
ADMINS = ( |
|
8 |
# ('Your Name', 'your_email@example.com'), |
|
9 |
) |
|
10 |
||
11 |
MANAGERS = ADMINS |
|
12 |
||
13 |
DATABASES = { |
|
14 |
'default': { |
|
15 |
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. |
|
16 |
'NAME': '', # Or path to database file if using sqlite3. |
|
17 |
# The following settings are not used with sqlite3: |
|
18 |
'USER': '', |
|
19 |
'PASSWORD': '', |
|
20 |
'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. |
|
21 |
'PORT': '', # Set to empty string for default. |
|
22 |
} |
|
23 |
} |
|
24 |
||
25 |
# Hosts/domain names that are valid for this site; required if DEBUG is False |
|
26 |
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts |
|
27 |
ALLOWED_HOSTS = [] |
|
28 |
||
29 |
# Local time zone for this installation. Choices can be found here: |
|
30 |
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
|
31 |
# although not all choices may be available on all operating systems. |
|
32 |
# In a Windows environment this must be set to your system time zone. |
|
33 |
TIME_ZONE = 'America/Chicago' |
|
34 |
||
35 |
# Language code for this installation. All choices can be found here: |
|
36 |
# http://www.i18nguy.com/unicode/language-identifiers.html |
|
37 |
LANGUAGE_CODE = 'en-us' |
|
38 |
||
39 |
ugettext = lambda s: s |
|
40 |
||
41 |
LANGUAGES = ( |
|
42 |
('fr', ugettext('French')), |
|
43 |
('en', ugettext('English')), |
|
| 39 | 44 |
('es', ugettext('Spanish')), |
| 0 | 45 |
) |
46 |
||
47 |
||
48 |
SITE_ID = 1 |
|
49 |
||
50 |
# If you set this to False, Django will make some optimizations so as not |
|
51 |
# to load the internationalization machinery. |
|
52 |
USE_I18N = True |
|
53 |
||
54 |
# If you set this to False, Django will not format dates, numbers and |
|
55 |
# calendars according to the current locale. |
|
56 |
USE_L10N = True |
|
57 |
||
58 |
# If you set this to False, Django will not use timezone-aware datetimes. |
|
59 |
USE_TZ = True |
|
60 |
||
61 |
# Absolute filesystem path to the directory that will hold user-uploaded files. |
|
62 |
# Example: "/var/www/example.com/media/" |
|
63 |
MEDIA_ROOT = '' |
|
64 |
||
65 |
# URL that handles the media served from MEDIA_ROOT. Make sure to use a |
|
66 |
# trailing slash. |
|
67 |
# Examples: "http://example.com/media/", "http://media.example.com/" |
|
68 |
MEDIA_URL = '' |
|
69 |
||
70 |
# Absolute path to the directory static files should be collected to. |
|
71 |
# Don't put anything in this directory yourself; store your static files |
|
72 |
# in apps' "static/" subdirectories and in STATICFILES_DIRS. |
|
73 |
# Example: "/var/www/example.com/static/" |
|
74 |
STATIC_ROOT = '' |
|
75 |
||
76 |
# URL prefix for static files. |
|
77 |
# Example: "http://example.com/static/", "http://static.example.com/" |
|
78 |
STATIC_URL = '/static/' |
|
79 |
||
80 |
# Additional locations of static files |
|
81 |
STATICFILES_DIRS = ( |
|
82 |
# Put strings here, like "/home/html/static" or "C:/www/django/static". |
|
83 |
# Always use forward slashes, even on Windows. |
|
84 |
# Don't forget to use absolute paths, not relative paths. |
|
85 |
) |
|
86 |
||
87 |
# List of finder classes that know how to find static files in |
|
88 |
# various locations. |
|
89 |
STATICFILES_FINDERS = ( |
|
90 |
'django.contrib.staticfiles.finders.FileSystemFinder', |
|
91 |
'django.contrib.staticfiles.finders.AppDirectoriesFinder', |
|
92 |
# 'django.contrib.staticfiles.finders.DefaultStorageFinder', |
|
93 |
) |
|
94 |
||
95 |
# List of callables that know how to import templates from various sources. |
|
96 |
TEMPLATE_LOADERS = ( |
|
97 |
'django.template.loaders.filesystem.Loader', |
|
98 |
'django.template.loaders.app_directories.Loader', |
|
99 |
# 'django.template.loaders.eggs.Loader', |
|
100 |
) |
|
101 |
||
102 |
MIDDLEWARE_CLASSES = ( |
|
103 |
'django.middleware.common.CommonMiddleware', |
|
104 |
'django.contrib.sessions.middleware.SessionMiddleware', |
|
| 39 | 105 |
'django.middleware.locale.LocaleMiddleware', |
| 0 | 106 |
'django.middleware.csrf.CsrfViewMiddleware', |
107 |
'django.contrib.auth.middleware.AuthenticationMiddleware', |
|
108 |
'django.contrib.messages.middleware.MessageMiddleware', |
|
109 |
# Uncomment the next line for simple clickjacking protection: |
|
110 |
# 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
|
111 |
) |
|
112 |
||
113 |
ROOT_URLCONF = 'p4l.urls' |
|
114 |
||
115 |
AUTH_USER_MODEL = 'p4l.User' |
|
116 |
INITIAL_CUSTOM_USER_MIGRATION = "0001_initial" |
|
117 |
||
118 |
||
119 |
# Python dotted path to the WSGI application used by Django's runserver. |
|
120 |
WSGI_APPLICATION = 'p4l.wsgi.application' |
|
121 |
||
122 |
TEMPLATE_DIRS = ( |
|
123 |
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
|
124 |
# Always use forward slashes, even on Windows. |
|
125 |
# Don't forget to use absolute paths, not relative paths. |
|
126 |
) |
|
127 |
||
128 |
INSTALLED_APPS = ( |
|
129 |
'django.contrib.auth', |
|
130 |
'django.contrib.contenttypes', |
|
131 |
'django.contrib.sessions', |
|
132 |
'django.contrib.sites', |
|
133 |
'django.contrib.messages', |
|
134 |
'django.contrib.staticfiles', |
|
135 |
'django.contrib.admin', |
|
136 |
'south', |
|
| 16 | 137 |
'rest_framework', |
| 0 | 138 |
'p4l' |
139 |
) |
|
140 |
||
| 39 | 141 |
TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + ( |
142 |
'django.core.context_processors.i18n', |
|
143 |
) |
|
144 |
||
| 0 | 145 |
# A sample logging configuration. The only tangible logging |
146 |
# performed by this configuration is to send an email to |
|
147 |
# the site admins on every HTTP 500 error when DEBUG=False. |
|
148 |
# See http://docs.djangoproject.com/en/dev/topics/logging for |
|
149 |
# more details on how to customize your logging configuration. |
|
150 |
LOGGING = { |
|
151 |
'version': 1, |
|
152 |
'disable_existing_loggers': False, |
|
153 |
'filters': { |
|
154 |
'require_debug_false': { |
|
155 |
'()': 'django.utils.log.RequireDebugFalse' |
|
156 |
} |
|
157 |
}, |
|
158 |
'handlers': { |
|
159 |
'mail_admins': { |
|
160 |
'level': 'ERROR', |
|
161 |
'filters': ['require_debug_false'], |
|
162 |
'class': 'django.utils.log.AdminEmailHandler' |
|
163 |
} |
|
164 |
}, |
|
165 |
'loggers': { |
|
166 |
'django.request': { |
|
167 |
'handlers': ['mail_admins'], |
|
168 |
'level': 'ERROR', |
|
169 |
'propagate': True, |
|
170 |
}, |
|
171 |
} |
|
172 |
} |
|
173 |
||
| 1 | 174 |
NB_RECORDS_BY_PAGE = 20 |
| 9 | 175 |
SPARQL_QUERY_ENDPOINT = "http://localhost:8080/openrdf-sesame/repositories/plan4learning" |
|
43
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
176 |
SPARQL_SUBJECT_QUERIES = { |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
177 |
"filter" : """ |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
178 |
PREFIX skos:<http://www.w3.org/2004/02/skos/core#> |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
179 |
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
180 |
PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
181 |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
182 |
SELECT DISTINCT ?uri ?label |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
183 |
WHERE { |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
184 |
?uri a skos:Concept. |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
185 |
?uri skos:inScheme <http://skos.um.es/unescothes/CS000> . |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
186 |
?uri skos:prefLabel ?label. |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
187 |
FILTER (lang(?label) = ?language). |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
188 |
?uri skos:prefLabel ?lab. |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
189 |
FILTER regex (str(?lab), ?reg, 'i'). |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
190 |
FILTER (lang (?lab) = ?language). |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
191 |
BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place). |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
192 |
BIND (STRLEN(STR(?lab)) AS ?len) |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
193 |
} |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
194 |
ORDER BY ?place ?len ?lab |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
195 |
""", |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
196 |
"root" : """ |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
197 |
PREFIX skos:<http://www.w3.org/2004/02/skos/core#> |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
198 |
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
199 |
PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
200 |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
201 |
SELECT DISTINCT ?uri ?label |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
202 |
WHERE { |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
203 |
?uri a skos:Collection ; |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
204 |
skos:inScheme <http://skos.um.es/unescothes/CS000> ; |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
205 |
skos:prefLabel|rdfs:label ?label . |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
206 |
FILTER (lang(?label) = ?language). |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
207 |
FILTER NOT EXISTS { [skos:member ?uri] } |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
208 |
} |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
209 |
""", |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
210 |
"childs" : """ |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
211 |
PREFIX skos:<http://www.w3.org/2004/02/skos/core#> |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
212 |
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
213 |
PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
214 |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
215 |
SELECT DISTINCT ?uri ?label |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
216 |
WHERE { |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
217 |
?uri skos:inScheme <http://skos.um.es/unescothes/CS000> . |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
218 |
{ ?uri a ?type |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
219 |
FILTER (?type = skos:Collection || ?type = skos:Concept) }. |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
220 |
?root skos:narrower|skos:member ?uri. |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
221 |
?uri skos:prefLabel|rdfs:label ?label. |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
222 |
FILTER (lang(?label) = ?language). |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
223 |
} |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
224 |
""", |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
225 |
"child-count" : """ |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
226 |
PREFIX skos:<http://www.w3.org/2004/02/skos/core#> |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
227 |
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
228 |
PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
229 |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
230 |
SELECT (COUNT(?uri) as ?nb) |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
231 |
WHERE { |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
232 |
?uri skos:inScheme <http://skos.um.es/unescothes/CS000> . |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
233 |
?root skos:narrower|skos:member ?uri. |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
234 |
} |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
235 |
""" |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
236 |
} |
|
45
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
237 |
SPARQL_THEME_QUERIES = { |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
238 |
'filter' : """ |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
239 |
PREFIX skos:<http://www.w3.org/2004/02/skos/core#> |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
240 |
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
241 |
PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
242 |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
243 |
SELECT DISTINCT ?uri ?label |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
244 |
WHERE { |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
245 |
?uri a skos:Concept. |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
246 |
?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Themes> . |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
247 |
?uri skos:prefLabel ?label. |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
248 |
FILTER (lang(?label) = ?language). |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
249 |
?uri skos:prefLabel ?lab. |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
250 |
FILTER regex (str(?lab), ?reg, 'i'). |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
251 |
FILTER (lang (?lab) = ?language). |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
252 |
BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place). |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
253 |
BIND (STRLEN(STR(?lab)) AS ?len) |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
254 |
} |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
255 |
ORDER BY ?place ?len ?lab |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
256 |
""", |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
257 |
'root' : """ |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
258 |
PREFIX skos:<http://www.w3.org/2004/02/skos/core#> |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
259 |
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
260 |
PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
261 |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
262 |
SELECT DISTINCT ?uri ?label |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
263 |
WHERE { |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
264 |
?uri a skos:Concept ; |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
265 |
skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Themes> ; |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
266 |
skos:prefLabel ?label . |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
267 |
FILTER (lang(?label) = ?language). |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
268 |
FILTER NOT EXISTS { [skos:narrower ?uri] } |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
269 |
} |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
270 |
""", |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
271 |
'childs' : """ |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
272 |
PREFIX skos:<http://www.w3.org/2004/02/skos/core#> |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
273 |
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
274 |
PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
275 |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
276 |
SELECT DISTINCT ?uri ?label |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
277 |
WHERE { |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
278 |
?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Themes> . |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
279 |
{ ?uri a ?type |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
280 |
FILTER (?type = skos:Collection || ?type = skos:Concept) }. |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
281 |
?root skos:narrower|skos:member ?uri. |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
282 |
?uri skos:prefLabel|rdfs:label ?label. |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
283 |
FILTER (lang(?label) = ?language). |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
284 |
} |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
285 |
""", |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
286 |
'child-count' : """ |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
287 |
PREFIX skos:<http://www.w3.org/2004/02/skos/core#> |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
288 |
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
289 |
PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
290 |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
291 |
SELECT (COUNT(?uri) as ?nb) |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
292 |
WHERE { |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
293 |
?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Themes> . |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
294 |
?root skos:narrower|skos:member ?uri. |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
295 |
} |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
296 |
""" |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
297 |
} |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
298 |
|
| 1 | 299 |
|
| 16 | 300 |
REST_FRAMEWORK = { |
301 |
# Use hyperlinked styles by default. |
|
302 |
# Only used if the `serializer_class` attribute is not set on a view. |
|
303 |
'DEFAULT_MODEL_SERIALIZER_CLASS': |
|
304 |
'rest_framework.serializers.HyperlinkedModelSerializer', |
|
305 |
||
306 |
# Use Django's standard `django.contrib.auth` permissions, |
|
307 |
# or allow read-only access for unauthenticated users. |
|
308 |
'DEFAULT_PERMISSION_CLASSES': [ |
|
309 |
'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly' |
|
310 |
], |
|
311 |
||
312 |
'PAGINATE_BY': 20, |
|
313 |
'PAGINATE_BY_PARAM': 'page_size' |
|
314 |
} |
|
315 |
||
| 0 | 316 |
from config import * # @UnusedWildImport |
317 |
||
318 |
if not "SRC_BASE_URL" in locals(): |
|
| 24 | 319 |
SRC_BASE_URL = BASE_URL + __name__.split('.')[0] + '/' |
320 |
if not "LOGIN_URL" in locals(): |
|
321 |
LOGIN_URL = SRC_BASE_URL + 'auth/login/' |
|
322 |
if not "LOGOUT_URL" in locals(): |
|
323 |
LOGOUT_URL = SRC_BASE_URL + 'auth/disconnect/' |
|
324 |
if not "LOGIN_REDIRECT_URL" in locals(): |
|
325 |
LOGIN_REDIRECT_URL = SRC_BASE_URL |
|
326 |
if not "LOGOUT_REDIRECT_URL" in locals(): |
|
327 |
LOGOUT_REDIRECT_URL = SRC_BASE_URL + 'auth/login' |