Ontology load error



I am trying to load Ontology into graph and I am getting below error

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.GraqlShell.loadQuery(GraqlShell.java:297)
at ai.grakn.graql.GraqlShell.loadQueries(GraqlShell.java:290)
at ai.grakn.graql.GraqlShell.runShell(GraqlShell.java:259)
at ai.grakn.graql.GraqlShell.main(GraqlShell.java:158)

can you pkease help me to fix this



Hi @randomph,

Can you please give us more details? Share a portion of your ontology and the command you using to load the ontology?




Hi Filipe,

Thank you for reply. I am trying to create simple Ontology:


company sub entity
has name
has location
has job;

name sub resource datatype string;
location sub resource datatype string;
job sub resource datatype string;

and i am using below command with actual Path in my system

.//bin/graql.sh -f ./ontology.gql -k grakn



I think it’s failing to find the actual ontology. In the command you use:

.//bin/graql.sh -f ./ontology.gql -k grakn

The -f ./ontology.gql part seems very odd to me. maybe try putting the absolute path to the ontology file? Or move the ontology file into the same directory you making thee above call from. It should be something like:

./bin/graql.sh -f ontology.gql -k grakn