452 skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Organizations> ; |
452 skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Organizations> ; |
453 skos:prefLabel ?label . |
453 skos:prefLabel ?label . |
454 } |
454 } |
455 """ |
455 """ |
456 } |
456 } |
|
457 SPARQL_TYPE_QUERIES = { |
|
458 'filter' : """ |
|
459 PREFIX skos:<http://www.w3.org/2004/02/skos/core#> |
|
460 PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> |
|
461 PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
462 PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
|
463 SELECT DISTINCT ?uri ?label |
|
464 WHERE { |
|
465 ?uri a skos:Concept. |
|
466 ?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/DocumentType> . |
|
467 ?uri skos:prefLabel ?label. |
|
468 FILTER (lang(?label) = %s). |
|
469 ?uri skos:prefLabel ?lab. |
|
470 FILTER regex (str(?lab), ?reg, 'i'). |
|
471 FILTER (lang (?lab) = %s). |
|
472 BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place). |
|
473 BIND (STRLEN(STR(?lab)) AS ?len) |
|
474 } |
|
475 ORDER BY ?place ?len ?lab |
|
476 """, |
|
477 'root' : """ |
|
478 PREFIX skos:<http://www.w3.org/2004/02/skos/core#> |
|
479 PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> |
|
480 PREFIX owl:<http://www.w3.org/2002/07/owl#> |
|
481 PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> |
|
482 SELECT DISTINCT ?uri ?label |
|
483 WHERE { |
|
484 ?uri a skos:Concept ; |
|
485 skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/DocumentType> ; |
|
486 skos:prefLabel ?label . |
|
487 FILTER (lang(?label) = %s). |
|
488 FILTER NOT EXISTS { [skos:narrower ?uri] } |
|
489 } |
|
490 """ |
|
491 } |
457 |
492 |
458 |
493 |
459 REST_FRAMEWORK = { |
494 REST_FRAMEWORK = { |
460 # Use hyperlinked styles by default. |
495 # Use hyperlinked styles by default. |
461 # Only used if the `serializer_class` attribute is not set on a view. |
496 # Only used if the `serializer_class` attribute is not set on a view. |