# Mysterious syntax error in \`get\` clause of \`match\` expression

**URL:** https://forum.typedb.com/t/mysterious-syntax-error-in-get-clause-of-match-expression/678
**Category:** TypeQL
**Created:** [9 April 2025 00:34 UTC](https://forum.typedb.com/t/mysterious-syntax-error-in-get-clause-of-match-expression/678 "2025-04-09T00:34:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Jeff\_Brown](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.typedb.com/jeff_brown/32/138_2.png) [@Jeff\_Brown](https://forum.typedb.com/u/Jeff_Brown)
#### Post date: [9 April 2025 00:34 UTC](https://forum.typedb.com/t/mysterious-syntax-error-in-get-clause-of-match-expression/678/1 "2025-04-09T00:34:04Z")

</div>

(I believe that answering this question does not require understanding Rust.)

My Rust program is choking on the following query:

```auto
let query = format!(
    r#"match
        $container isa node, has id $container_id;
        $contained isa node, has id "{}";
        $rel isa contains (container: $container,
                           contained: $contained);
        get $container_id;"#,
    target_id
);

```

(The “{}” above is Rust’s way of letting me substitute `target_id` into the `match` expression.)

When I run it, I get the following error:

```auto
Error: Server(
[TQL0] [TQL03] TypeQL Error: There is a syntax error near 6:16:
    match
                $container isa node, has id $container_id;
                $contained isa node, has id "2";
                $rel isa contains (container: $container,
                                   contained: $contained);
--> get $container_id;
                    ^
Caused: Error in usage of TypeQL.
Caused: [TSV7] Query parsing failed.)

```

What’s wrong with that `get` clause? I’ve tried all four combinations involving get, fetch, $ and ?, all with the same result.

My entire program can be found here[1]. The passage above appears in `src/main`. The schema is at `schema.tql`.

Many thanks in advance.

[1] [GitHub - JeffreyBenjaminBrown/skg](https://github.com/JeffreyBenjaminBrown/skg)

---

<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: [9 April 2025 08:59 UTC](https://forum.typedb.com/t/mysterious-syntax-error-in-get-clause-of-match-expression/678/2 "2025-04-09T08:59:08Z")

</div>

Hi @Jeff_Brown ,  
I see `typedb-driver==3.0.5` in the `Cargo.toml`, so I’m assuming you’re on TypeDB 3.  
We’ve removed `get` and replaced it with `select` (as in the SQL operation since we’re projecting it down to a subset of the variables)

---

<div class="post-metadata">

### Author: ![Jeff\_Brown](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.typedb.com/jeff_brown/32/138_2.png) [@Jeff\_Brown](https://forum.typedb.com/u/Jeff_Brown)
#### Post date: [9 April 2025 15:05 UTC](https://forum.typedb.com/t/mysterious-syntax-error-in-get-clause-of-match-expression/678/3 "2025-04-09T15:05:09Z")

</div>

That was it. Thank you!
