Can I create an Entity composed by an Entity?


#1

I’m very new using Grakn and I’m not understanding if I can create a structure which is close to the object oriented programming.

I give you an example:

  • table sub entity
    has book
    has pencil
    -book sub resource …
    pencil sub resource…

I want to have “book” and “pencil” as an ENTITIES and not resources, I could attach to “book” or “pencil” other features then.

Is this possible?

Thank,
DB.


#2
table sub entity
   plays owner;
book sub entity
   plays owned;
pencil sub entity
   plays owned;

ownership sub relation
   relates owner
   relates owned;
owner sub role;
owned sub role;

$table isa table;
$pencil isa pencil;
(owner: $table, owned: $pencil) isa ownership;