{"exception":null}


#1
insert

##################################################################
# Schema
##################################################################

word sub entity
    plays subtype
    plays supertype
    has name;

verb sub word;

pobj sub role;
prep sub role;
subtype sub role;
supertype sub role;

inheritance sub relation
    relates supertype
    relates subtype;

pair sub relation
    relates prep
    relates pobj
    has typ
    has name;

name sub resource datatype string;
typ sub resource datatype string;


##################################################################
# Data
##################################################################

$verb isa verb;

$play isa word, has name "play";
$run isa word, has name "run";

(supertype: $verb, subtype: $play) isa inheritance;
(supertype: $verb, subtype: $run) isa inheritance;

##################################################################
# Inference
##################################################################

isa inference-rule
    lhs {
        $verb isa verb;
        (supertype: $verb, subtype: $x) isa inheritance;
        (supertype: $verb, subtype: $y) isa inheritance;
    }
    rhs {
        (prep: $x, pobj: $y) isa pair;
    };

isa inference-rule
    lhs {
        $verb isa verb;
        (supertype: $verb, subtype: $x) isa inheritance;
        (supertype: $verb, subtype: $y) isa inheritance;
        $p (prep: $x, pobj: $y) isa pair;
    }
    rhs {
        $p has typ "yoshi";
    };



#2

match $a isa pair; offset 0; limit 300;

gives {“exception”:null}

in the UI.

in the shell all is ok:

>>> match $a isa pair; $a has typ $u;
$a id "40960" (prep: id "32808", pobj: id "32808") isa pair; $u value "yoshi" isa typ;
$a id "45096" (prep: id "32808", pobj: id "32896") isa pair; $u value "yoshi" isa typ;
$a id "45208" (prep: id "32896", pobj: id "32896") isa pair; $u value "yoshi" isa typ;
$a id "114896" (prep: id "32896", pobj: id "32808") isa pair; $u value "yoshi" isa typ;

#3

I found why but I found a weirdness too:

the problem of {"exception":null} in the UI was caused by an error (my error) in the schema:

word sub entity
    plays subtype
    plays supertype
    plays pobj <-------------------- was missing
    plays prep <-------------------- was missing
    has name; 

but it leads me to the weirdness:
I did not see the error because the error is not printed in shell :

[/U/d/d/testing]$ ./grakn-master/grakn-dist/target/grakn-dist-0.13.0-SNAPSHOT/bin/graql.sh -m -n -k marco
>>> match $a isa pair;
$a id "73840" (prep: id "32936", pobj: id "32936") isa pair;
$a id "41176" (prep: id "24720", pobj: id "32936") isa pair;
$a id "77936" (prep: id "32936", pobj: id "24720") isa pair;
$a id "49280" (prep: id "24720", pobj: id "24720") isa pair;

BUT I see the errors when using the -e flag:

A structural validation error has occurred. Please correct the [`4`] errors found.
The type [word] of role player [24720] is not allowed to play RoleType [pobj]
The type [word] of role player [32936] is not allowed to play RoleType [prep]
The type [word] of role player [24720] is not allowed to play RoleType [prep]
The type [word] of role player [32936] is not allowed to play RoleType [pobj]
$a id "82032" (prep: id "32936", pobj: id "32936") isa pair;
$a id "49368" (prep: id "32936", pobj: id "24720") isa pair;
$a id "53464" (prep: id "24720", pobj: id "32936") isa pair;
$a id "49288" (prep: id "24720", pobj: id "24720") isa pair;

So basically, two things to fix:

  1. some errors are not printed when using graql.sh in REPL mode, you have to use the -e flag to see them
  2. the UI, prints {"exception":null} instead of printing
The type [word] of role player [32936] is not allowed to play RoleType [prep]
The type [word] of role player [24720] is not allowed to play RoleType [prep]
The type [word] of role player [32936] is not allowed to play RoleType [pob```

#4

ok after sniffing the websocket I see it’s because when using -e, a commit is issued which triggers the errors.
I can replicate by issueing a commit by hand in REPL

>>> commit;
A structural validation error has occurred. Please correct the [`4`] errors found.
The type [word] of role player [32936] is not allowed to play RoleType [pobj]
The type [word] of role player [24720] is not allowed to play RoleType [prep]
The type [word] of role player [24720] is not allowed to play RoleType [pobj]
The type [word] of role player [32936] is not allowed to play RoleType [prep]
>>>

So basically, it teaches me that from now I will commit to identify possible errors I missed.
The UI is still to fix though


#5

also in the UI
match $p ($a, $b) isa pair; select $a; offset 0; limit 30;
fails
but
match $p ($a, $b) isa pair; offset 0; limit 30;
works


#6

Hi @johnwoo1,

thank you for your precious feedback!

In this PR I have addressed your issues with the UI: https://github.com/graknlabs/grakn/pull/1482,
all the bugs you mentioned in this thread should be fixed. Please let us know if you have new issues.

Marco