Can an inferred entity have the attributes of its type?


#1

I was having a conversation with Kasper in slack and asked about inferred entities from rules.

My questions was if entities with an inferred type can have the attributes of the inferred type. So I tried this example, but somehow it did not infer the type correctly. Did I mess up the syntax?

>>> tomen@viech-ubuntu:~/Applications/grakn-dist-1.2.0$ ./graql console -k test1
Grakn  Copyright (C) 2018  Grakn Labs Limited 
This is free software, and you are welcome to redistribute it 
under certain conditions; type 'license' for details.
>>> define node sub entity has nodeType; nodeType sub attribute datatype string;
{}
>>> define page sub node has name; name sub attribute datatype string;
{}
>>> commit
>>> define rule1 sub rule, when {$x has nodeType val "page";} then {$x isa page;};
{}
>>> commit
>>> insert $x isa node has nodeType "page";
$x id V16608 isa node; 
>>> insert $x isa node has nodeType "concept";
$x id V12392 isa node; 
>>> match $x has nodeType $y; get;
$x id V16608 isa node; $y val "page" isa nodeType; 
$y val "concept" isa nodeType; $x id V12392 isa node; 
>>> match $x isa page; get;
>>>