Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions typeql-reference/modules/ROOT/pages/statements/has.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ match $person isa person;
insert $person has name "Alice";
----

If the value is a variable instead of a literal, you must use `==`.

[,typeql]
----
#!test[write]
#{{
match
$person isa person;
#}}
match let $name_value = "Alice";
insert $person has name == $name_value;
----


Comment on lines 53 to 76
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could use an explanation for why. Smth to the effect of insert $x has T $t; is equivalent to insert $t isa T; $x has $t; vs insert $_temp isa T; $_temp == $val; $x has $_temp; in the correct version.

== Deleting attribute ownership

The `has` keyword is used to remove an attribute from its owner.
Expand Down