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

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

My Rust program is choking on the following query:

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:

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

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)

1 Like

That was it. Thank you!