typedb/typedb-docs

'Subtype a relation' incorrectly says all inherited roles must be declared, and also omits non-inherited roles

Opened this issue · 1 comments

Description

There are two bugs in the docs on 'Subtype a relation':

  1. The field marked 'important' says that

All roles defined to relate to the parent relation must also be defined to relate to the child relation using the as keyword.

However this is incorrect - it is perfectly possible to declare a child relation without specifying each of the inherited roles relates (they are implicit), e.g.:

define
  
    game sub relation,
        relates player;

    cricketgame sub game;
  1. The docs omit to mention that a subtype may relate new roles that do not inherit from the supertype roles (i.e. do not require the 'as' keyword, e.g.
define

    game sub relation;

    cricketgame sub game,
        relates audience;

Location of Content

https://docs.vaticle.com/docs/schema/concepts#subtype-a-relation

Both provided examples are valid. I have checked.
While I do not feel that the current wording states otherwise or has mistakes in logic I think we can try to make it more precise and detailed.