jenkins-bot has submitted this change and it was merged.

Change subject: Allow spaces in language list
......................................................................


Allow spaces in language list

Bug: T147729
Change-Id: I1abdd466076fd79ab4ff06eadfaa1b7d04695107
---
M 
blazegraph/src/main/java/org/wikidata/query/rdf/blazegraph/label/LabelService.java
M 
blazegraph/src/test/java/org/wikidata/query/rdf/blazegraph/label/LabelServiceUnitTest.java
2 files changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Smalyshev: Looks good to me, approved
  jenkins-bot: Verified



diff --git 
a/blazegraph/src/main/java/org/wikidata/query/rdf/blazegraph/label/LabelService.java
 
b/blazegraph/src/main/java/org/wikidata/query/rdf/blazegraph/label/LabelService.java
index 939ac94..6b6b773 100644
--- 
a/blazegraph/src/main/java/org/wikidata/query/rdf/blazegraph/label/LabelService.java
+++ 
b/blazegraph/src/main/java/org/wikidata/query/rdf/blazegraph/label/LabelService.java
@@ -159,11 +159,11 @@
             if (s.contains(",")) {
                 // we also allow comma lists for convenience
                 for (String ls: s.split(",")) {
-                    fallbacksMap.put(ls, cnt);
+                    fallbacksMap.put(ls.trim(), cnt);
                     ++cnt;
                 }
             } else {
-                fallbacksMap.put(s, cnt);
+                fallbacksMap.put(s.trim(), cnt);
             }
             ++cnt;
         }
diff --git 
a/blazegraph/src/test/java/org/wikidata/query/rdf/blazegraph/label/LabelServiceUnitTest.java
 
b/blazegraph/src/test/java/org/wikidata/query/rdf/blazegraph/label/LabelServiceUnitTest.java
index 0f09cef..176ee7d 100644
--- 
a/blazegraph/src/test/java/org/wikidata/query/rdf/blazegraph/label/LabelServiceUnitTest.java
+++ 
b/blazegraph/src/test/java/org/wikidata/query/rdf/blazegraph/label/LabelServiceUnitTest.java
@@ -91,7 +91,7 @@
         query.append("  ontology:dummy ontology:dummy ?s .\n");
         query.append("  {\n");
         query.append("    ?s ontology:dummy ?p .\n");
-        query.append("    SERVICE ontology:label { bd:serviceParam 
ontology:language \"en,de\" . }\n");
+        query.append("    SERVICE ontology:label { bd:serviceParam 
ontology:language \"en , de\" . }\n");
         query.append("  }\n");
         query.append("}\n");
         assertResult(query(query.toString()), binds("pLabel", "in en", "en"));

-- 
To view, visit https://gerrit.wikimedia.org/r/315852
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1abdd466076fd79ab4ff06eadfaa1b7d04695107
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/rdf
Gerrit-Branch: master
Gerrit-Owner: Smalyshev <smalys...@wikimedia.org>
Gerrit-Reviewer: Smalyshev <smalys...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to