Swirrl / cubiql

CubiQL: A GraphQL service for querying multidimensional Linked Data Cubes
Eclipse Public License 1.0
41 stars 2 forks source link

CubiQL fails when using Lithuanian characters #159

Open agustingp opened 5 years ago

agustingp commented 5 years ago

I have a dataset with one dimension having data using Lithuanian characters (e.g. Ä, š). table2QB converts the dataset well, but when querying with cubiQL an Internal Error Server is caused. Specifically when querying the dimensions labels and values as follows: { cubiql { dataset_avarageernings { dimensions { uri label } } } } However, the following query works, but dimensions only retrieve the enums values.

{ cubiql { dataset_avarageernings { title observations (dimensions: { measure_type: AVERAGE_EARNINGS_MONTHLY_EUR }) { page(first: 1000) { observation { measure_type municipality average_earnings_monthly_eur iso } } } } } }

If I remove the dimension containing this type of characters everything works well, indicating that is a problem of encoding.

Part of he error recorded in the logs file is copy-pasted next:

query=%7Bcubiql%20%7Bdataset_avarageernings%20%7B%0A%20%20dimensions%7B%0A%20%20%20%20uri%0A%20%20%7D%0A%7D%0A%7D%0A%7D%0A%0A)@fce6a39"], :url-for #object[clojure.lang.Delay 0x257a6041 {:status :pending, :val nil}], :io.pedestal.interceptor.chain/execution-id 2, :servlet-config #object[org.eclipse.jetty.servlet.ServletHolder$Config 0x3ae7462d "org.eclipse.jetty.servlet.ServletHolder$Config@3ae7462d"], :async? #object[io.pedestal.http.impl.servlet_interceptor$servlet_async_QMARK_ 0x1855d906 "io.pedestal.http.impl.servlet_interceptor$servlet_async_QMARK_@1855d906"]}, :line 252} clojure.lang.ExceptionInfo: java.lang.NullPointerException in Interceptor :com.walmartlabs.lacinia.pedestal/query-executor - at clojure.core$ex_info.invokeStatic(core.clj:4739) ~[cubiql-0.7.0-SNAPSHOT-standalone.jar:?] at clojure.core$ex_info.invoke(core.clj:4739) ~[cubiql-0.7.0-SNAPSHOT-standalone.jar:?] at io.pedestal.interceptor.chain$throwable__GT_ex_info.invokeStatic(chain.clj:35) ~[cubiql-0.7.0-SNAPSHOT-standalone.jar:?] at io.pedestal.interceptor.chain$throwable__GT_ex_info.invoke(chain.clj:32) ~[cubiql-0.7.0-SNAPSHOT-standalone.jar:?] at io.pedestal.interceptor.chain$try_f.invokeStatic(chain.clj:57) ~[cubiql-0.7.0-SNAPSHOT-standalone.jar:?] at io.pedestal.interceptor.chain$try_f.invoke(chain.clj:44) ~[cubiql-0.7.0-SNAPSHOT-standalone.jar:?] at io.pedestal.interceptor.chain$process_all_with_binding.invokeStatic(chain.clj:171) ~[cubiql-0.7.0-SNAPSHOT-standalone.jar:?] at io.pedestal.interceptor.chain$process_all_with_binding.invoke(chain.clj:146) ~[cubiql-0.7.0-SNAPSHOT-standalone.jar:?] lithuania.zip

Is there any possible easy solution for this?

I attach the .ttl files used.

lkitching commented 5 years ago

@agustingp - Which version are you using? I tried running the query you gave: { cubiql { dataset_avarageernings { dimensions { uri label } } } } against the provided data with the latest version on master and receive this response:


{
  "data": {
    "cubiql": {
      "dataset_avarageernings": {
        "dimensions": [
          {
            "uri": "http://www.opengovintelligence.eu/statistics/lithuania/def/dimension/time_period",
            "label": "Time_period"
          },
          {
            "uri": "http://www.opengovintelligence.eu/statistics/lithuania/def/dimension/iso",
            "label": "ISO"
          },
          {
            "uri": "http://www.opengovintelligence.eu/statistics/lithuania/def/dimension/county",
            "label": "County"
          },
          {
            "uri": "http://www.opengovintelligence.eu/statistics/lithuania/def/dimension/type",
            "label": "Type"
          },
          {
            "uri": "http://www.opengovintelligence.eu/statistics/lithuania/def/dimension/municipality",
            "label": "Municipality"
          },
          {
            "uri": "http://purl.org/linked-data/cube#measureType",
            "label": null
          },
          {
            "uri": "http://www.opengovintelligence.eu/statistics/lithuania/def/dimension/country",
            "label": "Country"
          }
        ]
      }
    }
  }
}```