Import pull request #15 : Requete sur les themes + libellés de 2 champs V00.06
authorymh <ymh.work@gmail.com>
Mon, 16 Dec 2013 12:39:52 +0100
changeset 163 c875b5418740
parent 162 5fe64e9de88b
child 164 4f77196ffde1
Import pull request #15 : Requete sur les themes + libellés de 2 champs
src/p4l/__init__.py
src/p4l/locale/en/LC_MESSAGES/django.mo
src/p4l/locale/en/LC_MESSAGES/django.po
src/p4l/locale/fr/LC_MESSAGES/django.mo
src/p4l/locale/fr/LC_MESSAGES/django.po
src/p4l/settings.py
--- a/src/p4l/__init__.py	Wed Dec 04 10:41:38 2013 +0100
+++ b/src/p4l/__init__.py	Mon Dec 16 12:39:52 2013 +0100
@@ -31,7 +31,7 @@
 # knowledge of the CeCILL-B license and that you accept its terms.
 #
 
-VERSION = (0, 5, 0, "final", 0)
+VERSION = (0, 6, 0, "final", 0)
 
 
 def get_version(version=VERSION):
Binary file src/p4l/locale/en/LC_MESSAGES/django.mo has changed
--- a/src/p4l/locale/en/LC_MESSAGES/django.po	Wed Dec 04 10:41:38 2013 +0100
+++ b/src/p4l/locale/en/LC_MESSAGES/django.po	Mon Dec 16 12:39:52 2013 +0100
@@ -191,11 +191,11 @@
 
 #: templates/p4l/record_view.html:32
 msgid "added titles"
-msgstr "Contents title"
+msgstr "Added titles"
 
 #: templates/p4l/record_view.html:36
 msgid "titles main document"
-msgstr "In"
+msgstr "In (title main document)"
 
 #: templates/p4l/record_view.html:40
 msgid "authors"
Binary file src/p4l/locale/fr/LC_MESSAGES/django.mo has changed
--- a/src/p4l/locale/fr/LC_MESSAGES/django.po	Wed Dec 04 10:41:38 2013 +0100
+++ b/src/p4l/locale/fr/LC_MESSAGES/django.po	Mon Dec 16 12:39:52 2013 +0100
@@ -194,11 +194,11 @@
 
 #: templates/p4l/record_view.html:32
 msgid "added titles"
-msgstr "Contient"
+msgstr "Contient (added titles)"
 
 #: templates/p4l/record_view.html:36
 msgid "titles main document"
-msgstr "In"
+msgstr "In (titre doc. principal)"
 
 #: templates/p4l/record_view.html:40
 msgid "authors"
--- a/src/p4l/settings.py	Wed Dec 04 10:41:38 2013 +0100
+++ b/src/p4l/settings.py	Mon Dec 16 12:39:52 2013 +0100
@@ -384,11 +384,13 @@
                 "WHERE {{ "
                     "?uri a skos:Concept. "
                     "?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Themes> . "
-                    "?uri skos:prefLabel ?label. "
-                    "FILTER (lang(?label) = {lang}). "
-                    "?uri skos:prefLabel ?lab. "
+                    "?uri skos:prefLabel ?prefLabel. "
+                    "?uri skos:notation ?notation. "
+                    "FILTER (lang(?prefLabel) = {lang}). "
+                    "BIND(CONCAT(?notation, ' - ', ?prefLabel) AS ?label). "
+                    "?uri skos:prefLabel|skos:altLabel ?lab. "
                     "FILTER regex (str(?lab), ?reg, 'i'). "
-                    "FILTER (lang (?lab) = {lang}). "
+                    "FILTER (lang (?lab) = {lang} || lang(?lab) = ''). "
                     "BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place). "
                     "BIND (STRLEN(STR(?lab)) AS ?len) "
                 "}} "
@@ -403,10 +405,12 @@
                 "WHERE {{ "
                     "?uri a skos:Collection ; "
                          "skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Themes> ; "    
-                         "skos:prefLabel|rdfs:label ?label ; "
-                         "rdf:type ?type . "
-                    "FILTER (lang(?label) = {lang}). " 
-                    "FILTER NOT EXISTS {{ [skos:member ?uri] }} "
+                         "skos:prefLabel ?prefLabel ; "
+                         "skos:notation ?notation ; "
+                         "rdf:type ?type . "                       
+                    "FILTER (lang(?prefLabel) = {lang}). " 
+                    "FILTER NOT EXISTS {{ [skos:member ?uri] }}. "
+                    "BIND(CONCAT(?notation, ' - ', ?prefLabel) AS ?label)"
                 "}} "
                 "ORDER BY str(?label)"
             ),
@@ -421,8 +425,10 @@
                   "{{ ?uri a ?type "
                     "FILTER (?type = skos:Collection || ?type = skos:Concept) }}. "
                   "?root skos:narrower|skos:member ?uri. "
-                  "?uri skos:prefLabel|rdfs:label ?label. "
-                  "FILTER (lang(?label) = {lang}). "
+                  "?uri skos:prefLabel ?prefLabel. "
+                  "?uri skos:notation ?notation ; "
+                      "FILTER (lang(?prefLabel) = {lang}). "
+                  "BIND(CONCAT(?notation, ' - ', ?prefLabel) AS ?label)"
                 "}} "
                 "ORDER BY str(?label)"
             ),