Some bugs in query when try utf8 predicates

  1. prepare data
{
  set{
    <_:alice> <身高> "180"  .
    <_:tom> <喜欢> <_:alice> .
  }
} 

and it returns

"data": {
    "code": "Success",
    "message": "Done",
    "uids": {
      "alice": "0x1f21ed",
      "tom": "0x1f21ee"
    }
  }

then ,check the tom’s predicate

{
  tom_predicate(func: uid(0x1f21ee)){
    _predicate_
  }
}

it returns

"data": {
    "tom_predicate": [
      {
        "_predicate_": [
          "喜欢"
        ]
      }
    ]
  },

I want to use it in a query.

{
  tom_expand(func: uid(0x1f21ee)){
    expand(_all_){
      expand(_all_)
    }
  }
}

it returns

"data": {
    "tom_expand": [
      {
        "喜欢": [
          {
            "身高": "180"
          }
        ]
      }
    ]
  }

from now on ,It all works.

The true question is
I can’t write a query like this:

{
  alice_height(func: uid(0x1f21ed)){
  
    身高
  }
}

it returns an error

while lexing { alice_height(func: uid(0x1f21ed)){ 身高 } }: Unrecognized character in lexText: U+8EAB '身'

I can reproduce this. I believe that characteres of Hanzi(?) is no supported. There would be support for various languages and characters in Object string (Edge). I would recommend using predicates in english or even alphabetic fonetic (latin).

Tested in Ratel
Result: Could not alter schema: while lexing 身高: int .: Invalid schema. Unexpected 身

Thanks a lot.
I’m looking forward to the support for

:smiley::smiley::smiley:

2 Likes

depend on you now to support Chinese

hi ,micheldiz.
I find a way to use chinese in query.

it errors .
However ,if I write

{
  alice_height(func: uid(0x1f21ed)){
    <身高>
  }
}

It works.

1 Like

老哥你说啥~ 啊 哈
半天没反应过来…
:joy:

ref Special Characters in values

If your predicate has special characters, then you should wrap it with angular brackets while asking for it in the query. E.g. < first:name >

1 Like

So in that case I was wrong. I never used special characters before. So for me Chinese characters in predicates was not supported.

That’s good news for language like Japanese, Chinese, Russian, Indian, Arabic and so on.