Getting Error while uploading data from gql file into Grakn KG


#1

Hi

I have been trying to create a Grakn KG on an Ubuntu OS(16.04). I have 2 gql files, one contains Grakn Schema and other contains Data. I am able to create Grakn Schema from the gql file, however, when i am trying to upload data afterwards(from data gql file), i am receiving below error.

Exception in thread “main” java.nio.charset.MalformedInputException: Input length = 1
at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:339)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at java.io.BufferedReader.fill(BufferedReader.java:161)
at java.io.BufferedReader.readLine(BufferedReader.java:324)
at java.io.BufferedReader.readLine(BufferedReader.java:389)
at java.nio.file.Files.readAllLines(Files.java:3205)
at ai.grakn.graql.shell.GraqlShell.loadQuery(GraqlShell.java:100)
at ai.grakn.graql.shell.GraqlConsole.loadQueries(GraqlConsole.java:141)
at ai.grakn.graql.shell.GraqlConsole.start(GraqlConsole.java:121)
at ai.grakn.engine.bootup.Graql.run(Graql.java:81)
at ai.grakn.engine.bootup.Graql.main(Graql.java:64)

Here are the commands i am using on shell prompt:

./graql console -k “mykeyspace” -f ./examples/mykeyspace_schema.gql
./graql console -k “mykeyspace” -f ./examples/mykeyspace_data.gql

Can you please have a look and share any resolution.


#2

Just to add, i am using Grakn’s latest version i.e. 1.4


#3

As we wait for a resolution on the subject issue, I found a Workaround to the problem,and hereby sharing it for the greater good.

  1. Use Graql Console and access the keyspace where you want to upload the data
    For e.g: $ ./graql console -k “mykeyspace”

  2. Enter “edit” on the console prompt. It will open a default editor based on the OS you are on. For instance, for Ubuntu, vim is the default editor.

  3. Copy all the data from “gql” file and PASTE it in “vim” editor, and save the data.

  4. Write “commit;” on graql console.

That’s all. Graql Console will execute the data present in vim editor and records will be inserted into Grakn KG.


#4

Hi @omshanti, thank you for reporting. Given the stacktrace your provided and the solution you found, it is clear that the issue probably resides in some character or symbol escaping contained in your data file. Would it be possible for you to share with us the schema and data files, if they do not contain any private data?

So that we can investigate better the issue, thank you!