StatusCode.UNKNOWN, Got unsupported type for list: keywords

Hello,
It’s been a while since posting here (which is a great thing!)

Was working on adding some new data into the db that was defined in schema like this:
keywords: [string] @index(exact) @count .

The actual data looks like this:
‘keywords’: [(‘keywordsA’, 0.3798365520363444), (‘keywordB’, 0.09841987381766581), (‘keywordC’, 0.08103834093333195)…etc ]

Attempting to commit this data I got this message back :

<_Rendezvous of RPC that terminated with (StatusCode.UNKNOWN, Got unsupported type for list: keywords)

How would I go about creating schema for this type of data?

I’ve tried doing some things like: keywords: [string, float] @index(exact) @count .**

Br,
Alan

Hi AYEG,

Welcome back.

Data must be enclosed in quotation marks - literal string. See the JSON example below.

You can’t do that. A predicate must have only one type.

JSON


{
  "set": [
   {
      "keywords": ["(‘keywordsA’, 0.3798365520363444)", "(‘keywordB’, 0.09841987381766581)", "(‘keywordC’, 0.08103834093333195)" ]
   }
  ]
}

RDF



{
  set
   {
      _:A <keywords> "(‘keywordsA’, 0.3798365520363444)" .
      _:A <keywords> "(‘keywordB’, 0.09841987381766581)" .
      _:A <keywords> "(‘keywordC’, 0.08103834093333195)" .
   }
}

Result

{
  "data": {
    "car": [
      {
        "uid": "0xf",
        "keywords": [
          "(‘keywordC’, 0.08103834093333195)",
          "(‘keywordsA’, 0.3798365520363444)",
          "(‘keywordB’, 0.09841987381766581)"
        ]
      },
      {
        "uid": "0x10",
        "keywords": [
          "(‘keywordC’, 0.08103834093333195)",
          "(‘keywordsA’, 0.3798365520363444)",
          "(‘keywordB’, 0.09841987381766581)"
        ]
      },
      {
        "uid": "0x11",
        "keywords": [
          "(‘keywordC’, 0.08103834093333195)",
          "(‘keywordsA’, 0.3798365520363444)",
          "(‘keywordB’, 0.09841987381766581)"
        ]
      }
    ]
  }

Got it thanks. think I’ll leave out the numeric value for now to keep it simple, but this is good to know, I can always include it like that if needed