| author | ymh <ymh.work@gmail.com> |
| Sat, 21 Sep 2013 23:49:04 +0200 | |
| changeset 114 | 93b45b4f423c |
| parent 113 | c05567404888 |
| child 117 | 0a4e7d6ebe80 |
| 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', |
|
| 48 | 136 |
'django_extensions', |
| 0 | 137 |
'south', |
| 16 | 138 |
'rest_framework', |
|
113
c05567404888
First version of indexation. Replace the list view by a search view
ymh <ymh.work@gmail.com>
parents:
99
diff
changeset
|
139 |
'haystack', |
| 0 | 140 |
'p4l' |
141 |
) |
|
142 |
||
| 39 | 143 |
TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + ( |
144 |
'django.core.context_processors.i18n', |
|
| 74 | 145 |
'django.core.context_processors.request', |
| 39 | 146 |
) |
147 |
||
| 0 | 148 |
# A sample logging configuration. The only tangible logging |
149 |
# performed by this configuration is to send an email to |
|
150 |
# the site admins on every HTTP 500 error when DEBUG=False. |
|
151 |
# See http://docs.djangoproject.com/en/dev/topics/logging for |
|
152 |
# more details on how to customize your logging configuration. |
|
153 |
LOGGING = { |
|
154 |
'version': 1, |
|
155 |
'disable_existing_loggers': False, |
|
156 |
'filters': { |
|
157 |
'require_debug_false': { |
|
158 |
'()': 'django.utils.log.RequireDebugFalse' |
|
159 |
} |
|
160 |
}, |
|
161 |
'handlers': { |
|
162 |
'mail_admins': { |
|
163 |
'level': 'ERROR', |
|
164 |
'filters': ['require_debug_false'], |
|
165 |
'class': 'django.utils.log.AdminEmailHandler' |
|
166 |
} |
|
167 |
}, |
|
168 |
'loggers': { |
|
169 |
'django.request': { |
|
170 |
'handlers': ['mail_admins'], |
|
171 |
'level': 'ERROR', |
|
172 |
'propagate': True, |
|
173 |
}, |
|
174 |
} |
|
175 |
} |
|
176 |
||
|
114
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
177 |
NB_RECORDS_BY_PAGE = 20 |
|
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
178 |
|
|
113
c05567404888
First version of indexation. Replace the list view by a search view
ymh <ymh.work@gmail.com>
parents:
99
diff
changeset
|
179 |
HAYSTACK_CONNECTIONS = { |
|
c05567404888
First version of indexation. Replace the list view by a search view
ymh <ymh.work@gmail.com>
parents:
99
diff
changeset
|
180 |
'default': { |
|
c05567404888
First version of indexation. Replace the list view by a search view
ymh <ymh.work@gmail.com>
parents:
99
diff
changeset
|
181 |
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', |
|
c05567404888
First version of indexation. Replace the list view by a search view
ymh <ymh.work@gmail.com>
parents:
99
diff
changeset
|
182 |
'URL': '', |
|
c05567404888
First version of indexation. Replace the list view by a search view
ymh <ymh.work@gmail.com>
parents:
99
diff
changeset
|
183 |
'INDEX_NAME': 'p4l', |
|
c05567404888
First version of indexation. Replace the list view by a search view
ymh <ymh.work@gmail.com>
parents:
99
diff
changeset
|
184 |
}, |
|
c05567404888
First version of indexation. Replace the list view by a search view
ymh <ymh.work@gmail.com>
parents:
99
diff
changeset
|
185 |
} |
|
c05567404888
First version of indexation. Replace the list view by a search view
ymh <ymh.work@gmail.com>
parents:
99
diff
changeset
|
186 |
|
|
114
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
187 |
HAYSTACK_SIGNAL_PROCESSOR = 'p4l.search.signals.P4lSignalProcessor' |
|
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
188 |
HAYSTACK_SEARCH_RESULTS_PER_PAGE = NB_RECORDS_BY_PAGE |
|
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
189 |
|
|
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
190 |
CACHES = { |
|
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
191 |
'default' : { |
|
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
192 |
'BACKEND': 'django.core.cache.backends.dummy.DummyCache', |
|
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
193 |
}, |
|
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
194 |
'indexation': { |
|
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
195 |
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', |
|
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
196 |
'LOCATION': 'p4l-indexation', |
|
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
197 |
'TIMEOUT': 300, |
|
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
198 |
} |
|
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
199 |
} |
|
113
c05567404888
First version of indexation. Replace the list view by a search view
ymh <ymh.work@gmail.com>
parents:
99
diff
changeset
|
200 |
|
|
c05567404888
First version of indexation. Replace the list view by a search view
ymh <ymh.work@gmail.com>
parents:
99
diff
changeset
|
201 |
|
| 9 | 202 |
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
|
203 |
SPARQL_SUBJECT_QUERIES = { |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
204 |
"filter" : """ |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
205 |
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
|
206 |
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
|
207 |
PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
208 |
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
|
209 |
SELECT DISTINCT ?uri ?label |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
210 |
WHERE { |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
211 |
?uri a skos:Concept. |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
212 |
?uri skos:inScheme <http://skos.um.es/unescothes/CS000> . |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
213 |
?uri skos:prefLabel ?label. |
| 60 | 214 |
FILTER (lang(?label) = %s). |
|
43
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
215 |
?uri skos:prefLabel ?lab. |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
216 |
FILTER regex (str(?lab), ?reg, 'i'). |
| 60 | 217 |
FILTER (lang (?lab) = %s). |
|
43
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
218 |
BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place). |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
219 |
BIND (STRLEN(STR(?lab)) AS ?len) |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
220 |
} |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
221 |
ORDER BY ?place ?len ?lab |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
222 |
""", |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
223 |
"root" : """ |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
224 |
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
|
225 |
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
|
226 |
PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
227 |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
| 90 | 228 |
SELECT DISTINCT ?uri ?label ?type |
|
43
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
229 |
WHERE { |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
230 |
?uri a skos:Collection ; |
| 90 | 231 |
skos:inScheme <http://skos.um.es/unescothes/CS000> ; |
232 |
skos:prefLabel|rdfs:label ?label ; |
|
233 |
rdf:type ?type ; |
|
| 60 | 234 |
FILTER (lang(?label) = %s). |
| 90 | 235 |
FILTER NOT EXISTS { [skos:member ?uri] }. |
|
43
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
236 |
} |
| 86 | 237 |
ORDER BY ?label |
|
43
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
238 |
""", |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
239 |
"childs" : """ |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
240 |
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
|
241 |
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
|
242 |
PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
243 |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
| 90 | 244 |
SELECT DISTINCT ?uri ?label ?type |
|
43
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
245 |
WHERE { |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
246 |
?uri skos:inScheme <http://skos.um.es/unescothes/CS000> . |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
247 |
{ ?uri a ?type |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
248 |
FILTER (?type = skos:Collection || ?type = skos:Concept) }. |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
249 |
?root skos:narrower|skos:member ?uri. |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
250 |
?uri skos:prefLabel|rdfs:label ?label. |
| 60 | 251 |
FILTER (lang(?label) = %s). |
|
43
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
252 |
} |
| 86 | 253 |
ORDER BY ?label |
|
43
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
254 |
""", |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
255 |
"child-count" : """ |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
256 |
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
|
257 |
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
|
258 |
PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
259 |
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
|
260 |
SELECT (COUNT(?uri) as ?nb) |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
261 |
WHERE { |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
262 |
?uri skos:inScheme <http://skos.um.es/unescothes/CS000> . |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
263 |
?root skos:narrower|skos:member ?uri. |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
264 |
} |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
265 |
""" |
|
829d9d4111da
semantic tree browser works and queries in settings dict
cavaliet
parents:
39
diff
changeset
|
266 |
} |
|
45
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
267 |
SPARQL_THEME_QUERIES = { |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
268 |
'filter' : """ |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
269 |
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
|
270 |
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
|
271 |
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
|
272 |
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
|
273 |
SELECT DISTINCT ?uri ?label |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
274 |
WHERE { |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
275 |
?uri a skos:Concept. |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
276 |
?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
|
277 |
?uri skos:prefLabel ?label. |
| 60 | 278 |
FILTER (lang(?label) = %s). |
|
45
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
279 |
?uri skos:prefLabel ?lab. |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
280 |
FILTER regex (str(?lab), ?reg, 'i'). |
| 60 | 281 |
FILTER (lang (?lab) = %s). |
|
45
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
282 |
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
|
283 |
BIND (STRLEN(STR(?lab)) AS ?len) |
|
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 |
ORDER BY ?place ?len ?lab |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
286 |
""", |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
287 |
'root' : """ |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
288 |
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
|
289 |
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
|
290 |
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
|
291 |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
| 90 | 292 |
SELECT DISTINCT ?uri ?label ?type |
|
45
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
293 |
WHERE { |
| 84 | 294 |
?uri a skos:Collection ; |
|
45
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
295 |
skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Themes> ; |
| 90 | 296 |
skos:prefLabel|rdfs:label ?label ; |
297 |
rdf:type ?type ; |
|
| 60 | 298 |
FILTER (lang(?label) = %s). |
| 84 | 299 |
FILTER NOT EXISTS { [skos:member ?uri] } |
|
45
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
300 |
} |
| 86 | 301 |
ORDER BY ?label |
|
45
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
302 |
""", |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
303 |
'childs' : """ |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
304 |
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
|
305 |
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
|
306 |
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
|
307 |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
| 90 | 308 |
SELECT DISTINCT ?uri ?label ?type |
|
45
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
309 |
WHERE { |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
310 |
?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
|
311 |
{ ?uri a ?type |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
312 |
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
|
313 |
?root skos:narrower|skos:member ?uri. |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
314 |
?uri skos:prefLabel|rdfs:label ?label. |
| 60 | 315 |
FILTER (lang(?label) = %s). |
|
45
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
316 |
} |
| 86 | 317 |
ORDER BY ?label |
|
45
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
318 |
""", |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
319 |
'child-count' : """ |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
320 |
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
|
321 |
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
|
322 |
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
|
323 |
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
|
324 |
SELECT (COUNT(?uri) as ?nb) |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
325 |
WHERE { |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
326 |
?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
|
327 |
?root skos:narrower|skos:member ?uri. |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
328 |
} |
|
9dd14a51a2bb
add template for translations used in angular. add sparql request for themes
cavaliet
parents:
43
diff
changeset
|
329 |
""" |
| 61 | 330 |
} |
331 |
SPARQL_COUNTRY_QUERIES = { |
|
332 |
'filter' : """ |
|
333 |
PREFIX skos:<http://www.w3.org/2004/02/skos/core#> |
|
334 |
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> |
|
335 |
PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
336 |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
|
337 |
SELECT DISTINCT ?uri ?label |
|
338 |
WHERE { |
|
339 |
?uri a skos:Concept. |
|
340 |
?uri skos:inScheme <http://skos.um.es/unescothes/CS000/Countries> . |
|
341 |
?uri skos:prefLabel ?label. |
|
342 |
FILTER (lang(?label) = %s). |
|
343 |
?uri skos:prefLabel ?lab. |
|
344 |
FILTER regex (str(?lab), ?reg, 'i'). |
|
345 |
FILTER (lang (?lab) = %s). |
|
346 |
BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place). |
|
347 |
BIND (STRLEN(STR(?lab)) AS ?len) |
|
348 |
} |
|
349 |
ORDER BY ?place ?len ?lab |
|
350 |
""", |
|
351 |
'root' : """ |
|
352 |
PREFIX skos:<http://www.w3.org/2004/02/skos/core#> |
|
353 |
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> |
|
354 |
PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
355 |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
|
356 |
SELECT DISTINCT ?uri ?label |
|
357 |
WHERE { |
|
358 |
?uri a skos:Concept ; |
|
359 |
skos:inScheme <http://skos.um.es/unescothes/CS000/Countries> ; |
|
360 |
skos:prefLabel ?label . |
|
361 |
FILTER (lang(?label) = %s). |
|
362 |
FILTER NOT EXISTS { [skos:narrower ?uri] } |
|
363 |
} |
|
| 86 | 364 |
ORDER BY ?label |
| 61 | 365 |
""", |
366 |
'childs' : """ |
|
367 |
PREFIX skos:<http://www.w3.org/2004/02/skos/core#> |
|
368 |
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> |
|
369 |
PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
370 |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
|
371 |
SELECT DISTINCT ?uri ?label |
|
372 |
WHERE { |
|
373 |
?uri skos:inScheme <http://skos.um.es/unescothes/CS000/Countries> . |
|
374 |
{ ?uri a ?type |
|
375 |
FILTER (?type = skos:Collection || ?type = skos:Concept) }. |
|
376 |
?root skos:narrower|skos:member ?uri. |
|
377 |
?uri skos:prefLabel|rdfs:label ?label. |
|
378 |
FILTER (lang(?label) = %s). |
|
379 |
} |
|
| 86 | 380 |
ORDER BY ?label |
| 61 | 381 |
""", |
382 |
'child-count' : """ |
|
383 |
PREFIX skos:<http://www.w3.org/2004/02/skos/core#> |
|
384 |
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> |
|
385 |
PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
386 |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
|
387 |
SELECT (COUNT(?uri) as ?nb) |
|
388 |
WHERE { |
|
389 |
?uri skos:inScheme <http://skos.um.es/unescothes/CS000/Countries> . |
|
390 |
?root skos:narrower|skos:member ?uri. |
|
391 |
} |
|
392 |
""" |
|
393 |
} |
|
394 |
SPARQL_LANGUAGE_QUERIES = { |
|
395 |
'filter' : """ |
|
396 |
PREFIX skos:<http://www.w3.org/2004/02/skos/core#> |
|
397 |
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> |
|
398 |
PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
399 |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
|
400 |
SELECT DISTINCT ?uri ?label |
|
401 |
WHERE { |
|
402 |
?uri a skos:Concept. |
|
403 |
?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Languages> . |
|
404 |
?uri skos:prefLabel ?label. |
|
405 |
FILTER (lang(?label) = %s). |
|
406 |
?uri skos:prefLabel ?lab. |
|
407 |
FILTER regex (str(?lab), ?reg, 'i'). |
|
408 |
FILTER (lang (?lab) = %s). |
|
409 |
BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place). |
|
410 |
BIND (STRLEN(STR(?lab)) AS ?len) |
|
411 |
} |
|
412 |
ORDER BY ?place ?len ?lab |
|
413 |
""", |
|
414 |
'root' : """ |
|
415 |
PREFIX skos:<http://www.w3.org/2004/02/skos/core#> |
|
416 |
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> |
|
417 |
PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
418 |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
|
419 |
SELECT DISTINCT ?uri ?label |
|
420 |
WHERE { |
|
421 |
?uri a skos:Concept ; |
|
422 |
skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Languages> ; |
|
423 |
skos:prefLabel ?label . |
|
424 |
FILTER (lang(?label) = %s). |
|
425 |
FILTER NOT EXISTS { [skos:narrower ?uri] } |
|
426 |
} |
|
| 86 | 427 |
ORDER BY ?label |
| 61 | 428 |
""" |
429 |
} |
|
430 |
SPARQL_PROJECT_QUERIES = { |
|
431 |
'filter' : """ |
|
432 |
PREFIX skos:<http://www.w3.org/2004/02/skos/core#> |
|
433 |
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> |
|
434 |
PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
435 |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
|
| 95 | 436 |
SELECT DISTINCT ?uri ?label ?acro |
| 61 | 437 |
WHERE { |
438 |
?uri a skos:Concept. |
|
439 |
?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Projects> . |
|
440 |
?uri skos:prefLabel ?label. |
|
441 |
?uri skos:prefLabel ?lab. |
|
| 95 | 442 |
OPTIONAL { ?uri skos:altLabel ?acro }. |
| 61 | 443 |
FILTER regex (str(?lab), ?reg, 'i'). |
444 |
BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place). |
|
445 |
BIND (STRLEN(STR(?lab)) AS ?len) |
|
446 |
} |
|
447 |
ORDER BY ?place ?len ?lab |
|
448 |
""", |
|
449 |
'root' : """ |
|
450 |
PREFIX skos:<http://www.w3.org/2004/02/skos/core#> |
|
451 |
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> |
|
452 |
PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
453 |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
|
| 95 | 454 |
SELECT DISTINCT ?uri ?label ?acro |
| 61 | 455 |
WHERE { |
456 |
?uri a skos:Concept ; |
|
457 |
skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Projects> ; |
|
458 |
skos:prefLabel ?label . |
|
| 95 | 459 |
OPTIONAL { ?uri skos:altLabel ?acro } |
| 61 | 460 |
} |
| 86 | 461 |
ORDER BY ?label |
| 61 | 462 |
""" |
463 |
} |
|
464 |
SPARQL_ORGANIZATION_QUERIES = { |
|
465 |
'filter' : """ |
|
466 |
PREFIX skos:<http://www.w3.org/2004/02/skos/core#> |
|
467 |
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> |
|
468 |
PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
469 |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
|
| 95 | 470 |
SELECT DISTINCT ?uri ?label ?acro |
| 61 | 471 |
WHERE { |
472 |
?uri a skos:Concept. |
|
473 |
?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Organizations> . |
|
474 |
?uri skos:prefLabel ?label. |
|
475 |
?uri skos:prefLabel ?lab. |
|
| 95 | 476 |
OPTIONAL { ?uri skos:altLabel ?acro }. |
| 61 | 477 |
FILTER regex (str(?lab), ?reg, 'i'). |
478 |
BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place). |
|
479 |
BIND (STRLEN(STR(?lab)) AS ?len) |
|
480 |
} |
|
481 |
ORDER BY ?place ?len ?lab |
|
482 |
""", |
|
483 |
'root' : """ |
|
484 |
PREFIX skos:<http://www.w3.org/2004/02/skos/core#> |
|
485 |
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> |
|
486 |
PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
487 |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
|
| 95 | 488 |
SELECT DISTINCT ?uri ?label ?acro |
| 61 | 489 |
WHERE { |
490 |
?uri a skos:Concept ; |
|
491 |
skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Organizations> ; |
|
492 |
skos:prefLabel ?label . |
|
| 95 | 493 |
OPTIONAL { ?uri skos:altLabel ?acro } |
| 61 | 494 |
} |
| 86 | 495 |
ORDER BY ?label |
| 61 | 496 |
""" |
497 |
} |
|
|
62
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
498 |
SPARQL_TYPE_QUERIES = { |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
499 |
'filter' : """ |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
500 |
PREFIX skos:<http://www.w3.org/2004/02/skos/core#> |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
501 |
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
502 |
PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
503 |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
504 |
SELECT DISTINCT ?uri ?label |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
505 |
WHERE { |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
506 |
?uri a skos:Concept. |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
507 |
?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/DocumentType> . |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
508 |
?uri skos:prefLabel ?label. |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
509 |
FILTER (lang(?label) = %s). |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
510 |
?uri skos:prefLabel ?lab. |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
511 |
FILTER regex (str(?lab), ?reg, 'i'). |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
512 |
FILTER (lang (?lab) = %s). |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
513 |
BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place). |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
514 |
BIND (STRLEN(STR(?lab)) AS ?len) |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
515 |
} |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
516 |
ORDER BY ?place ?len ?lab |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
517 |
""", |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
518 |
'root' : """ |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
519 |
PREFIX skos:<http://www.w3.org/2004/02/skos/core#> |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
520 |
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
521 |
PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
522 |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
523 |
SELECT DISTINCT ?uri ?label |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
524 |
WHERE { |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
525 |
?uri a skos:Concept ; |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
526 |
skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/DocumentType> ; |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
527 |
skos:prefLabel ?label . |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
528 |
FILTER (lang(?label) = %s). |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
529 |
FILTER NOT EXISTS { [skos:narrower ?uri] } |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
530 |
} |
| 86 | 531 |
ORDER BY ?label |
|
62
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
532 |
""" |
|
8433e12362e0
angular for simple sparql and checkbox. Languages updated
cavaliet
parents:
61
diff
changeset
|
533 |
} |
| 99 | 534 |
SPARQL_AUDIENCE_QUERIES = { |
535 |
"filter" : "", |
|
536 |
"root" : "", |
|
537 |
"childs" : "", |
|
538 |
"child-count" : "" |
|
539 |
} |
|
| 1 | 540 |
|
|
114
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
541 |
RDF_SCHEMES = { |
|
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
542 |
'organization': 'http://www.iiep.unesco.org/plan4learning/scheme/Organizations', |
|
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
543 |
'audience': '', |
|
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
544 |
'language': 'http://www.iiep.unesco.org/plan4learning/scheme/Languages', |
|
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
545 |
'type': 'http://www.iiep.unesco.org/plan4learning/scheme/DocumentType', |
|
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
546 |
'subject': 'http://skos.um.es/unescothes/CS000', |
|
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
547 |
'theme': 'http://www.iiep.unesco.org/plan4learning/scheme/Themes', |
|
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
548 |
'country': 'http://skos.um.es/unescothes/CS000/Countries', |
|
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
549 |
'project': 'http://www.iiep.unesco.org/plan4learning/scheme/Projects' |
|
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
550 |
} |
|
93b45b4f423c
add corporate authors and small adjustments
ymh <ymh.work@gmail.com>
parents:
113
diff
changeset
|
551 |
|
| 16 | 552 |
REST_FRAMEWORK = { |
553 |
# Use hyperlinked styles by default. |
|
554 |
# Only used if the `serializer_class` attribute is not set on a view. |
|
555 |
'DEFAULT_MODEL_SERIALIZER_CLASS': |
|
556 |
'rest_framework.serializers.HyperlinkedModelSerializer', |
|
557 |
||
558 |
# Use Django's standard `django.contrib.auth` permissions, |
|
559 |
# or allow read-only access for unauthenticated users. |
|
560 |
'DEFAULT_PERMISSION_CLASSES': [ |
|
561 |
'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly' |
|
562 |
], |
|
563 |
||
564 |
'PAGINATE_BY': 20, |
|
565 |
'PAGINATE_BY_PARAM': 'page_size' |
|
566 |
} |
|
567 |
||
| 83 | 568 |
LANGUAGES_LIST = [ |
569 |
(u"French","fr"), |
|
570 |
(u"English","en"), |
|
571 |
(u"Spanish; Castilian","es"), |
|
572 |
(u"",""), |
|
573 |
(u"Abkhaz","ab"), |
|
| 70 | 574 |
(u"Afar","aa"), |
575 |
(u"Afrikaans","af"), |
|
576 |
(u"Akan","ak"), |
|
577 |
(u"Albanian","sq"), |
|
578 |
(u"Amharic","am"), |
|
579 |
(u"Arabic","ar"), |
|
580 |
(u"Aragonese","an"), |
|
581 |
(u"Armenian","hy"), |
|
582 |
(u"Assamese","as"), |
|
583 |
(u"Avaric","av"), |
|
584 |
(u"Avestan","ae"), |
|
585 |
(u"Aymara","ay"), |
|
586 |
(u"Azerbaijani","az"), |
|
587 |
(u"Bambara","bm"), |
|
588 |
(u"Bashkir","ba"), |
|
589 |
(u"Basque","eu"), |
|
590 |
(u"Belarusian","be"), |
|
591 |
(u"Bengali; Bangla","bn"), |
|
592 |
(u"Bihari","bh"), |
|
593 |
(u"Bislama","bi"), |
|
594 |
(u"Bosnian","bs"), |
|
595 |
(u"Breton","br"), |
|
596 |
(u"Bulgarian","bg"), |
|
597 |
(u"Burmese","my"), |
|
598 |
(u"Catalan","ca"), |
|
599 |
(u"Chamorro","ch"), |
|
600 |
(u"Chechen","ce"), |
|
601 |
(u"Chichewa; Chewa; Nyanja","ny"), |
|
602 |
(u"Chinese","zh"), |
|
603 |
(u"Chuvash","cv"), |
|
604 |
(u"Cornish","kw"), |
|
605 |
(u"Corsican","co"), |
|
606 |
(u"Cree","cr"), |
|
607 |
(u"Croatian","hr"), |
|
608 |
(u"Czech","cs"), |
|
609 |
(u"Danish","da"), |
|
610 |
(u"Divehi; Dhivehi; Maldivian;","dv"), |
|
611 |
(u"Dutch","nl"), |
|
612 |
(u"Dzongkha","dz"), |
|
613 |
(u"English","en"), |
|
614 |
(u"Esperanto","eo"), |
|
615 |
(u"Estonian","et"), |
|
616 |
(u"Ewe","ee"), |
|
617 |
(u"Faroese","fo"), |
|
618 |
(u"Fijian","fj"), |
|
619 |
(u"Finnish","fi"), |
|
620 |
(u"French","fr"), |
|
621 |
(u"Fula; Fulah; Pulaar; Pular","ff"), |
|
622 |
(u"Galician","gl"), |
|
623 |
(u"Ganda","lg"), |
|
624 |
(u"Georgian","ka"), |
|
625 |
(u"German","de"), |
|
626 |
(u"Greek Modern","el"), |
|
627 |
(u"Guarani","gn"), |
|
628 |
(u"Gujarati","gu"), |
|
629 |
(u"Haitian; Haitian Creole","ht"), |
|
630 |
(u"Hausa","ha"), |
|
631 |
(u"Hebrew","he"), |
|
632 |
(u"Herero","hz"), |
|
633 |
(u"Hindi","hi"), |
|
634 |
(u"Hiri Motu","ho"), |
|
635 |
(u"Hungarian","hu"), |
|
636 |
(u"Icelandic","is"), |
|
637 |
(u"Ido","io"), |
|
638 |
(u"Igbo","ig"), |
|
639 |
(u"Indonesian","id"), |
|
640 |
(u"Interlingua","ia"), |
|
641 |
(u"Interlingue","ie"), |
|
642 |
(u"Inuktitut","iu"), |
|
643 |
(u"Inupiaq","ik"), |
|
644 |
(u"Irish","ga"), |
|
645 |
(u"Italian","it"), |
|
646 |
(u"Japanese","ja"), |
|
647 |
(u"Javanese","jv"), |
|
648 |
(u"Kalaallisut; Greenlandic","kl"), |
|
649 |
(u"Kannada","kn"), |
|
650 |
(u"Kanuri","kr"), |
|
651 |
(u"Kashmiri","ks"), |
|
652 |
(u"Kazakh","kk"), |
|
653 |
(u"Khmer","km"), |
|
654 |
(u"Kikuyu; Gikuyu","ki"), |
|
655 |
(u"Kinyarwanda","rw"), |
|
656 |
(u"Kirundi","rn"), |
|
657 |
(u"Komi","kv"), |
|
658 |
(u"Kongo","kg"), |
|
659 |
(u"Korean","ko"), |
|
660 |
(u"Kurdish","ku"), |
|
661 |
(u"Kwanyama; Kuanyama","kj"), |
|
662 |
(u"Kyrgyz","ky"), |
|
663 |
(u"Lao","lo"), |
|
664 |
(u"Latin","la"), |
|
665 |
(u"Latvian","lv"), |
|
666 |
(u"Limburgish; Limburgan; Limburger","li"), |
|
667 |
(u"Lingala","ln"), |
|
668 |
(u"Lithuanian","lt"), |
|
669 |
(u"Luba-Katanga","lu"), |
|
670 |
(u"Luxembourgish; Letzeburgesch","lb"), |
|
671 |
(u"Macedonian","mk"), |
|
672 |
(u"Malagasy","mg"), |
|
673 |
(u"Malay","ms"), |
|
674 |
(u"Malayalam","ml"), |
|
675 |
(u"Maltese","mt"), |
|
676 |
(u"Manx","gv"), |
|
677 |
(u"Marathi","mr"), |
|
678 |
(u"Marshallese","mh"), |
|
679 |
(u"Mongolian","mn"), |
|
680 |
(u"Maori","mi"), |
|
681 |
(u"Nauru","na"), |
|
682 |
(u"Navajo; Navaho","nv"), |
|
683 |
(u"Ndonga","ng"), |
|
684 |
(u"Nepali","ne"), |
|
685 |
(u"North Ndebele","nd"), |
|
686 |
(u"Northern Sami","se"), |
|
687 |
(u"Norwegian","no"), |
|
688 |
(u"Norwegian Bokmal","nb"), |
|
689 |
(u"Norwegian Nynorsk","nn"), |
|
690 |
(u"Nuosu","ii"), |
|
691 |
(u"Occitan","oc"), |
|
692 |
(u"Ojibwe; Ojibwa","oj"), |
|
693 |
(u"Church Slavic; Church Slavonic","cu"), |
|
694 |
(u"Oriya","or"), |
|
695 |
(u"Oromo","om"), |
|
696 |
(u"Ossetian; Ossetic","os"), |
|
697 |
(u"Panjabi; Punjabi","pa"), |
|
698 |
(u"Pashto; Pushto","ps"), |
|
699 |
(u"Persian","fa"), |
|
700 |
(u"Polish","pl"), |
|
701 |
(u"Portuguese","pt"), |
|
702 |
(u"Pali","pi"), |
|
703 |
(u"Quechua","qu"), |
|
704 |
(u"Romanian; Moldavian","ro"), |
|
705 |
(u"Romansh","rm"), |
|
706 |
(u"Russian","ru"), |
|
707 |
(u"Samoan","sm"), |
|
708 |
(u"Sango","sg"), |
|
709 |
(u"Sanskrit (Samskrta),sa"), |
|
710 |
(u"Sardinian","sc"), |
|
711 |
(u"Scottish Gaelic; Gaelic","gd"), |
|
712 |
(u"Serbian","sr"), |
|
713 |
(u"Shona","sn"), |
|
714 |
(u"Sindhi","sd"), |
|
715 |
(u"Sinhala; Sinhalese","si"), |
|
716 |
(u"Slovak","sk"), |
|
717 |
(u"Slovene","sl"), |
|
718 |
(u"Somali","so"), |
|
719 |
(u"South Azerbaijani","az"), |
|
720 |
(u"South Ndebele","nr"), |
|
721 |
(u"Southern Sotho","st"), |
|
722 |
(u"Spanish; Castilian","es"), |
|
723 |
(u"Sundanese","su"), |
|
724 |
(u"Swahili","sw"), |
|
725 |
(u"Swati","ss"), |
|
726 |
(u"Swedish","sv"), |
|
727 |
(u"Tagalog","tl"), |
|
728 |
(u"Tahitian","ty"), |
|
729 |
(u"Tajik","tg"), |
|
730 |
(u"Tamil","ta"), |
|
731 |
(u"Tatar","tt"), |
|
732 |
(u"Telugu","te"), |
|
733 |
(u"Thai","th"), |
|
734 |
(u"Tibetan","bo"), |
|
735 |
(u"Tigrinya","ti"), |
|
736 |
(u"Tonga","to"), |
|
737 |
(u"Tsonga","ts"), |
|
738 |
(u"Tswana","tn"), |
|
739 |
(u"Turkish","tr"), |
|
740 |
(u"Turkmen","tk"), |
|
741 |
(u"Twi","tw"), |
|
742 |
(u"Ukrainian","uk"), |
|
743 |
(u"Urdu","ur"), |
|
744 |
(u"Uyghur; Uighur","ug"), |
|
745 |
(u"Uzbek","uz"), |
|
746 |
(u"Venda","ve"), |
|
747 |
(u"Vietnamese","vi"), |
|
748 |
(u"Volapuk","vo"), |
|
749 |
(u"Walloon","wa"), |
|
750 |
(u"Welsh","cy"), |
|
751 |
(u"Western Frisian","fy"), |
|
752 |
(u"Wolof","wo"), |
|
753 |
(u"Xhosa","xh"), |
|
754 |
(u"Yiddish","yi"), |
|
755 |
(u"Yoruba","yo"), |
|
756 |
(u"Zhuang; Chuang","za"), |
|
757 |
(u"Zulu","zu")] |
|
758 |
||
| 0 | 759 |
from config import * # @UnusedWildImport |
760 |
||
761 |
if not "SRC_BASE_URL" in locals(): |
|
| 24 | 762 |
SRC_BASE_URL = BASE_URL + __name__.split('.')[0] + '/' |
763 |
if not "LOGIN_URL" in locals(): |
|
764 |
LOGIN_URL = SRC_BASE_URL + 'auth/login/' |
|
765 |
if not "LOGOUT_URL" in locals(): |
|
766 |
LOGOUT_URL = SRC_BASE_URL + 'auth/disconnect/' |
|
767 |
if not "LOGIN_REDIRECT_URL" in locals(): |
|
768 |
LOGIN_REDIRECT_URL = SRC_BASE_URL |
|
769 |
if not "LOGOUT_REDIRECT_URL" in locals(): |
|
770 |
LOGOUT_REDIRECT_URL = SRC_BASE_URL + 'auth/login' |