src/p4l/settings.py
changeset 95 594f79a5706b
parent 90 33a7b2a4af87
child 99 0d54489e8b26
equal deleted inserted replaced
94:fd2ba38ce4ad 95:594f79a5706b
   406 'filter' : """
   406 'filter' : """
   407 PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
   407 PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
   408 PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   408 PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   409 PREFIX owl:<http://www.w3.org/2002/07/owl#>
   409 PREFIX owl:<http://www.w3.org/2002/07/owl#>
   410 PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
   410 PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
   411 SELECT DISTINCT ?uri ?label
   411 SELECT DISTINCT ?uri ?label ?acro
   412 WHERE {
   412 WHERE {
   413     ?uri a skos:Concept.
   413     ?uri a skos:Concept.
   414     ?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Projects> .
   414     ?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Projects> .
   415     ?uri skos:prefLabel ?label.
   415     ?uri skos:prefLabel ?label.
   416     ?uri skos:prefLabel ?lab.
   416     ?uri skos:prefLabel ?lab.
       
   417     OPTIONAL { ?uri skos:altLabel ?acro }.
   417     FILTER regex (str(?lab), ?reg, 'i').
   418     FILTER regex (str(?lab), ?reg, 'i').
   418     BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place).
   419     BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place).
   419     BIND (STRLEN(STR(?lab)) AS ?len)
   420     BIND (STRLEN(STR(?lab)) AS ?len)
   420 }
   421 }
   421 ORDER BY ?place ?len ?lab
   422 ORDER BY ?place ?len ?lab
   423 'root' : """
   424 'root' : """
   424 PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
   425 PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
   425 PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   426 PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   426 PREFIX owl:<http://www.w3.org/2002/07/owl#>
   427 PREFIX owl:<http://www.w3.org/2002/07/owl#>
   427 PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
   428 PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
   428 SELECT DISTINCT ?uri ?label
   429 SELECT DISTINCT ?uri ?label ?acro
   429 WHERE {
   430 WHERE {
   430     ?uri a skos:Concept ;
   431     ?uri a skos:Concept ;
   431     skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Projects> ;    
   432     skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Projects> ;    
   432     skos:prefLabel ?label .
   433     skos:prefLabel ?label .
       
   434     OPTIONAL { ?uri skos:altLabel ?acro }
   433 }
   435 }
   434 ORDER BY ?label
   436 ORDER BY ?label
   435 """
   437 """
   436 }
   438 }
   437 SPARQL_ORGANIZATION_QUERIES = {
   439 SPARQL_ORGANIZATION_QUERIES = {
   438 'filter' : """
   440 'filter' : """
   439 PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
   441 PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
   440 PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   442 PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   441 PREFIX owl:<http://www.w3.org/2002/07/owl#>
   443 PREFIX owl:<http://www.w3.org/2002/07/owl#>
   442 PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
   444 PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
   443 SELECT DISTINCT ?uri ?label
   445 SELECT DISTINCT ?uri ?label ?acro
   444 WHERE {
   446 WHERE {
   445     ?uri a skos:Concept.
   447     ?uri a skos:Concept.
   446     ?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Organizations> .
   448     ?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Organizations> .
   447     ?uri skos:prefLabel ?label.
   449     ?uri skos:prefLabel ?label.
   448     ?uri skos:prefLabel ?lab.
   450     ?uri skos:prefLabel ?lab.
       
   451     OPTIONAL { ?uri skos:altLabel ?acro }.
   449     FILTER regex (str(?lab), ?reg, 'i').
   452     FILTER regex (str(?lab), ?reg, 'i').
   450     BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place).
   453     BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place).
   451     BIND (STRLEN(STR(?lab)) AS ?len)
   454     BIND (STRLEN(STR(?lab)) AS ?len)
   452 }
   455 }
   453 ORDER BY ?place ?len ?lab
   456 ORDER BY ?place ?len ?lab
   455 'root' : """
   458 'root' : """
   456 PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
   459 PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
   457 PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   460 PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   458 PREFIX owl:<http://www.w3.org/2002/07/owl#>
   461 PREFIX owl:<http://www.w3.org/2002/07/owl#>
   459 PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
   462 PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
   460 SELECT DISTINCT ?uri ?label
   463 SELECT DISTINCT ?uri ?label ?acro
   461 WHERE {
   464 WHERE {
   462     ?uri a skos:Concept ;
   465     ?uri a skos:Concept ;
   463     skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Organizations> ;    
   466     skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Organizations> ;    
   464     skos:prefLabel ?label .
   467     skos:prefLabel ?label .
       
   468     OPTIONAL { ?uri skos:altLabel ?acro }
   465 }
   469 }
   466 ORDER BY ?label
   470 ORDER BY ?label
   467 """
   471 """
   468 }
   472 }
   469 SPARQL_TYPE_QUERIES = {
   473 SPARQL_TYPE_QUERIES = {