T
TypeDB2mo ago
kenho811

< Unclear Error message when

< Unclear Error message when instantiating an abstract entity >
4 Replies
kenho811
kenho811OP2mo ago
I have these lines
entity source @abstract, plays attribution:source, owns source-name, owns source-title, owns source-published-at, owns source-published-at-epoch;
entity website-source sub source, owns url;
entity source @abstract, plays attribution:source, owns source-name, owns source-title, owns source-published-at, owns source-published-at-epoch;
entity website-source sub source, owns url;
When I try to instantiate a source entity (by mistake),
[INF11] Type-inference was unable to find compatible types for the pair of variables 'src' & 'source' across a constraint. Types were:

- src: []

- source: [source]

[QUA1] Type inference error while compiling query annotations.

[QEX8] Error analysing query.

Near 1:13

-----

--> insert $src isa source, has url 'abc.com', has source-name 'abc', has source-title 'hahaha';

^

-----

[TSV11] Query failed.


[HSR16] Transaction error.
[INF11] Type-inference was unable to find compatible types for the pair of variables 'src' & 'source' across a constraint. Types were:

- src: []

- source: [source]

[QUA1] Type inference error while compiling query annotations.

[QEX8] Error analysing query.

Near 1:13

-----

--> insert $src isa source, has url 'abc.com', has source-name 'abc', has source-title 'hahaha';

^

-----

[TSV11] Query failed.


[HSR16] Transaction error.
The error message does not say what constraint it is which caused the failure. I verified that it is the @abstract constrain which failed it. But I feel it would be useful if the error message indicates that?
No description
krishnan
krishnan2mo ago
Good point. We could add the constraint to the error message. $src isa source 1:13 does actually point insert $src [HERE]isa source, but that does need manual counting Maybe the ^ in the error message would be better off as an underline between two
--> insert $src isa source, has url 'abc.com', has source-name 'abc', has source-title 'hahaha';
-->. ^----------^
--> insert $src isa source, has url 'abc.com', has source-name 'abc', has source-title 'hahaha';
-->. ^----------^
Joshua
Joshua2mo ago
Isn't type inference a bit difficult because it failing in place X could have been caused elsewhere originally at place Y @krishnan ? i wonder why 1:13 isn't further to the rigth with the ^?
krishnan
krishnan2mo ago
I think we get an even more vague error message in those cases

Did you find this page helpful?