Skip to content

String escaping behaviour creates invalid queries and limits possible strings #106

Open
@adammitchelldev

Description

@adammitchelldev

Description

Strings are not escaped when converting Java TypeQL to a query string, despite requiring escape characters in order for the query string to be valid.

It also appears that the required escape characters are inserted, rather than being removed during parsing of the query, and that this was an oversight during a bugfix for asymmetrical escaping behaviour in an older version of TypeQLpre 1.0).

The behaviour is not standard, can cause users to accidentally break their queries (when programmatically generating them) and prevents users from inserting any string.

Environment

  1. OS (where TypeQL server runs): any
  2. TypeQL version (and platform): any
  3. TypeQL client: any (most notable in client-java)
  4. Other environment details:

Reproducible Steps

Steps to create the smallest reproducible scenario:
1.

// Gives us an invalid TypeQL query
System.out.println(TypeQL.insert(TypeQL.var("x").isa("person").has("name", "b\"o\"b")).toString());

Expected Output

insert $x isa person, has name "b\"o\"b";

Actual Output

insert $x isa person, has name "b"o"b";

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions