Getting Error while uploading data from gql file into Grakn KG



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(
at sun.nio.cs.StreamDecoder.implRead(
at java.nio.file.Files.readAllLines(
at ai.grakn.engine.bootup.Graql.main(

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.


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


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.


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!