src/p4l/settings.py
changeset 60 da37c87abbfb
parent 48 e2ccb0093452
child 61 305f9fcd409b
equal deleted inserted replaced
59:a0ef3043b1d2 60:da37c87abbfb
   183 SELECT DISTINCT ?uri ?label
   183 SELECT DISTINCT ?uri ?label
   184 WHERE {
   184 WHERE {
   185     ?uri a skos:Concept.
   185     ?uri a skos:Concept.
   186     ?uri skos:inScheme <http://skos.um.es/unescothes/CS000> .
   186     ?uri skos:inScheme <http://skos.um.es/unescothes/CS000> .
   187     ?uri skos:prefLabel ?label.
   187     ?uri skos:prefLabel ?label.
   188     FILTER (lang(?label) = ?language).
   188     FILTER (lang(?label) = %s).
   189     ?uri skos:prefLabel ?lab.
   189     ?uri skos:prefLabel ?lab.
   190     FILTER regex (str(?lab), ?reg, 'i').
   190     FILTER regex (str(?lab), ?reg, 'i').
   191     FILTER (lang (?lab) = ?language).
   191     FILTER (lang (?lab) = %s).
   192     BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place).
   192     BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place).
   193     BIND (STRLEN(STR(?lab)) AS ?len)
   193     BIND (STRLEN(STR(?lab)) AS ?len)
   194 }
   194 }
   195 ORDER BY ?place ?len ?lab
   195 ORDER BY ?place ?len ?lab
   196 """,
   196 """,
   202 SELECT DISTINCT ?uri ?label
   202 SELECT DISTINCT ?uri ?label
   203 WHERE {
   203 WHERE {
   204     ?uri a skos:Collection ;
   204     ?uri a skos:Collection ;
   205     skos:inScheme <http://skos.um.es/unescothes/CS000> ;    
   205     skos:inScheme <http://skos.um.es/unescothes/CS000> ;    
   206     skos:prefLabel|rdfs:label ?label .
   206     skos:prefLabel|rdfs:label ?label .
   207     FILTER (lang(?label) = ?language). 
   207     FILTER (lang(?label) = %s). 
   208     FILTER NOT EXISTS { [skos:member ?uri] }
   208     FILTER NOT EXISTS { [skos:member ?uri] }
   209 }
   209 }
   210 """,
   210 """,
   211 "childs" : """
   211 "childs" : """
   212 PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
   212 PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
   218   ?uri skos:inScheme <http://skos.um.es/unescothes/CS000> .
   218   ?uri skos:inScheme <http://skos.um.es/unescothes/CS000> .
   219   { ?uri a ?type
   219   { ?uri a ?type
   220     FILTER (?type = skos:Collection || ?type = skos:Concept) }.
   220     FILTER (?type = skos:Collection || ?type = skos:Concept) }.
   221   ?root skos:narrower|skos:member ?uri.
   221   ?root skos:narrower|skos:member ?uri.
   222   ?uri skos:prefLabel|rdfs:label ?label.
   222   ?uri skos:prefLabel|rdfs:label ?label.
   223   FILTER (lang(?label) = ?language).
   223   FILTER (lang(?label) = %s).
   224 }
   224 }
   225 """,
   225 """,
   226 "child-count" : """
   226 "child-count" : """
   227 PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
   227 PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
   228 PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   228 PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   244 SELECT DISTINCT ?uri ?label
   244 SELECT DISTINCT ?uri ?label
   245 WHERE {
   245 WHERE {
   246     ?uri a skos:Concept.
   246     ?uri a skos:Concept.
   247     ?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Themes> .
   247     ?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Themes> .
   248     ?uri skos:prefLabel ?label.
   248     ?uri skos:prefLabel ?label.
   249     FILTER (lang(?label) = ?language).
   249     FILTER (lang(?label) = %s).
   250     ?uri skos:prefLabel ?lab.
   250     ?uri skos:prefLabel ?lab.
   251     FILTER regex (str(?lab), ?reg, 'i').
   251     FILTER regex (str(?lab), ?reg, 'i').
   252     FILTER (lang (?lab) = ?language).
   252     FILTER (lang (?lab) = %s).
   253     BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place).
   253     BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place).
   254     BIND (STRLEN(STR(?lab)) AS ?len)
   254     BIND (STRLEN(STR(?lab)) AS ?len)
   255 }
   255 }
   256 ORDER BY ?place ?len ?lab
   256 ORDER BY ?place ?len ?lab
   257 """,
   257 """,
   263 SELECT DISTINCT ?uri ?label
   263 SELECT DISTINCT ?uri ?label
   264 WHERE {
   264 WHERE {
   265     ?uri a skos:Concept ;
   265     ?uri a skos:Concept ;
   266     skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Themes> ;    
   266     skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Themes> ;    
   267     skos:prefLabel ?label .
   267     skos:prefLabel ?label .
   268     FILTER (lang(?label) = ?language). 
   268     FILTER (lang(?label) = %s). 
   269     FILTER NOT EXISTS { [skos:narrower ?uri] }
   269     FILTER NOT EXISTS { [skos:narrower ?uri] }
   270 }
   270 }
   271 """,
   271 """,
   272 'childs' : """
   272 'childs' : """
   273 PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
   273 PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
   279   ?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Themes> .
   279   ?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Themes> .
   280   { ?uri a ?type
   280   { ?uri a ?type
   281     FILTER (?type = skos:Collection || ?type = skos:Concept) }.
   281     FILTER (?type = skos:Collection || ?type = skos:Concept) }.
   282   ?root skos:narrower|skos:member ?uri.
   282   ?root skos:narrower|skos:member ?uri.
   283   ?uri skos:prefLabel|rdfs:label ?label.
   283   ?uri skos:prefLabel|rdfs:label ?label.
   284   FILTER (lang(?label) = ?language).
   284   FILTER (lang(?label) = %s).
   285 }
   285 }
   286 """,
   286 """,
   287 'child-count' : """
   287 'child-count' : """
   288 PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
   288 PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
   289 PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   289 PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>