Rpc error: code = Unknown desc = while lexing _ at line 1 column 0: Invalid character after _. Expected :, found '�' exit status 1


(mehrdad mohammadiyan ) #1

Hi
Hi ,
i have many RDF node :
_:Ew4DiUFTjb < UrlName > "sepide" .
in a file
but when i mutate the line of file show this error :

12:16 PM


2019/09/14 12:06:39 rpc error: code = Unknown desc = while lexing  *at line 1 column 0: Invalid character after*  . Expected :, found '�'
exit status 1

my code :

    mu := &api.Mutation{
        CommitNow: true,
    }

    rdf_file, _ := ioutil.ReadFile("/home/mehrdad/Documents/PFOFILE-CO/profile-dgraph/Golang/rdf-following-7.txt")
    for _,line := range string(rdf_file) {
        // fmt.Printf(string(line))
        mu.SetNquads = []byte(string(line))
        _, err = dg.NewTxn().Mutate(ctx, mu)
        if err != nil {
            log.Fatal(err)
        }
    }

Can you help me ?!


(Animesh Chandra Pathak) #3

Try <UrlName>, no space after and before angular brackets. Also check your quote " is actually a quote character.