Skip to content

Current Implementation of RelationInsertGenerator.playersMatch does not cast player tokens to corresponding conceptGenerator idValueType #10

@colt-jay

Description

@colt-jay

Context

I am trying to load in a relation table that looks like the following:

# tag.csv

label_name,text_id
blue,28974
flower,83682
might,263684
...

Quick and dirty sample schema:

# schema.gql

uid sub attribute,
    value long;

name sub attribute,
    value string;

text sub entity,
    key uid,
    plays tagged;

label sub entity,
    key name,
    plays tagger;

tag sub relation,
    relates tagger,
    relates tagged;
# processorConfig.json

"tagged": {
            "playerType": "text",
            "uniquePlayerId": "uid",
            "idValueType": "long",
            "roleType": "tagged",
            "required": true
          }

The label and text entity loaders have worked fine however upon attempting to migrate this tag.csv file I am seeing the following error:

java.util.concurrent.ExecutionException: grakn.client.exception.GraknClientException: UNKNOWN: grakn.core.kb.graql.exception.GraqlSemanticException: 
Value 203088375 is not compatible with attribute value type: java.lang.Long. 
Please check server logs for the stack trace.

Suspected Error

I suspected that the match query was not correctly casting the text_id to long and found that currently the token is passed through the cleanToken method here https://github.com/bayer-science-for-a-better-life/grami/blob/f98b2b4e33094eb33275bd7fb6d1cc3676edc51a/src/main/java/generator/RelationInsertGenerator.java#L148
but that there is no further cast statement that I can find.

I was curious why this didn't break on the entity insertion but it seems that you do cast the value in the EntityInsertGenerator here https://github.com/bayer-science-for-a-better-life/grami/blob/f98b2b4e33094eb33275bd7fb6d1cc3676edc51a/src/main/java/generator/GeneratorUtil.java#L64

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions