typedb/typedb-docs

Document subsequent use of `define`

Closed this issue · 0 comments

Problem to Solve

In TypeDB, we can evolve a schema after it's written for the first time. However, the semantics of what you can and can't do with define when a schema already exists aren't well documented.

For example, when we take an existing schema:

define 
    first-name sub attribute, value string;
    
    person sub entity, owns first-name;

and add a last-name

define
    last-name sub attribute, value string;
    
    person sub entity, owns last-name;

Semantically, it seems like we're redefining person and that person should not include what it was previously defined to own (i.e. first-name).

Current Workaround

Trial and error.

Proposed Solution

Document the possibilities and impossibilities of define.