String

A UTF-8 character string type.

In expressions

Strings can be concatenated using the + operator.

"Hello," + " world!" == "Hello, world!"

Defining a string valued attribute

#!test[schema]
define
  attribute name value string;

Inserting a string valued attribute

#!test[write]
insert
  $_ isa name "John";

Unicode support

TypeDB supports unicode characters in strings, as well as providing a syntax for escaping unicode characters. The escape is \u{<code>} where <code> is the hex-encoded character-code.

#!test[read, count=1]
match
  let $x = "A\u{42}C \u{130ED}\u{13153}";
  let $y = "ABC 𓃭𓅓";
  $x == $y;