# Syntax of insert query of Relation

**URL:** https://forum.typedb.com/t/syntax-of-insert-query-of-relation/172
**Category:** TypeDB
**Tags:** typedb-client-api
**Created:** [11 August 2022 20:37 UTC](https://forum.typedb.com/t/syntax-of-insert-query-of-relation/172 "2022-08-11T20:37:28Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mamngri](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.typedb.com/mamngri/32/65_2.png) [@mamngri](https://forum.typedb.com/u/mamngri)
#### Post date: [11 August 2022 20:37 UTC](https://forum.typedb.com/t/syntax-of-insert-query-of-relation/172/1 "2022-08-11T20:37:28Z")

</div>

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 {‘;’, ‘,’}

---

<div class="post-metadata">

### Author: ![krishnan](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.typedb.com/krishnan/32/36_2.png) [@krishnan](https://forum.typedb.com/u/krishnan)
#### Post date: [15 August 2022 13:09 UTC](https://forum.typedb.com/t/syntax-of-insert-query-of-relation/172/2 "2022-08-15T13:09:42Z")

</div>

> [@mamngri](#):
>
> 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;

Could you try wrapping the attribute values in quotes?  
I think the space in one of them is what triggered the syntax error.

```auto
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";

```

---

<div class="post-metadata">

### Author: ![troubleshooting](https://avatars.discourse-cdn.com/v4/letter/t/c57346/32.png) [@troubleshooting](https://forum.typedb.com/u/troubleshooting)
#### Post date: [14 January 2023 13:27 UTC](https://forum.typedb.com/t/syntax-of-insert-query-of-relation/172/3 "2023-01-14T13:27:41Z")

</div>

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](https://github.com/vaticle/typedb-client-python/issues/263)]  
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.
