I am trying to load data to the schema by Python client but I am facing a Syntex error in one of the relationship tempelate.
below is the error:
TypeDBClientException: [TQL03] TypeQL Error: There is a syntax error at line 1:
match $histology isa cancer, has cancer-id “CA-TCGA-4C-A93U”; $involve isa sample, has sample-id “TCGA-4C-A93U-01”;insert $neoplasm(histology: $histology, involve: $involve) isa neoplasm;$neoplasm has person-neoplasm-statusTUMOR FREE;$neoplasm has neoplasm-histology-typeThyroid Papillary Carcinoma - Classical/usual;$neoplasm has neoadjuvant-therapy-type-administered-prior-to-resection-textNo;
^
mismatched input ‘insert’ expecting {‘;’, ‘,’}
Could you try wrapping the attribute values in quotes?
I think the space in one of them is what triggered the syntax error.
match $histology isa cancer, has cancer-id “CA-TCGA-4C-A93U”;
$involve isa sample, has sample-id “TCGA-4C-A93U-01”;
insert $neoplasm(histology: $histology, involve: $involve) isa neoplasm;
$neoplasm has person-neoplasm-status "TUMOR FREE";
$neoplasm has neoplasm-histology-type "Thyroid Papillary Carcinoma - Classical/usual";
$neoplasm has neoadjuvant-therapy-type-administered-prior-to-resection-text "No";
I’m having same problem. @krishnan@mamngri This isn’t a problem of quotes. The attribute values he is directly loading from a json/csv file I think. The problem is happening because of the python-client taking all queries as a string [Send multiple queries in a single method call (detection of query start and end) · Issue #263 · vaticle/typedb-client-python · GitHub]
In a relationship, if I send each query separately via the python-client data loader, then it says"it is missing the relation tuple describing the role players." so you’ve to club the queries and the python-client throws an error there.