Discussion Forum

TypeDB Quickstart not working

I am new to Typedb and am trying to work through the quickstart. When I try to load data.tql I receive the following error which may be trivial or not but I do not know the product well enough to solve this.

transaction social_network schema write
social_network::schema::write> source schema.tql
Concepts have been defined
social_network::schema::write> commit
Transaction changes committed
transaction social_network data write
social_network::data::write> source data.tql
[THW08] Invalid Thing Write: The thing type ‘person’ does not play the role type ‘friendship-list:listed’. Please check server logs for the stack trace.

Interesting - did you get these two files off the docs website? Perhaps we have an error! If you link them to us we can investigate!

Yes. I am working through the quickstart and downloaded the files as I went along. I am using the windows version of typedb.

Also. The instructions show data.gql but when it downloads it is data.tql

Ah yes sorry I broke it on Friday! Will fix it in a bit!

It’s still not working. When I import the data I get the following (snippet provided)

transaction social_network data write
social_network::data::write> source data.tql
{ $per-6-pos-7-com-1 iid 0x966e80117fffffffffffff55 isa comment; $per-4-pos-7-com-1 iid 0x966e80117fffffffffffff92 isa comment; $per-9-pos-6-com-1-com-1-rep iid 0xaa82800e7fffffffffffff35 (reply:content: iid 0x966e80117fffffffffffff72, reply:by: iid 0x966e80037ffffffffffffffa, reply:to: iid 0x966e80117fffffffffffff25) isa reply; $_627 “$per-7-pos-4-com-11-com-1-content” isa content; $_628 “$per-7-pos-4-com-11-com-1” isa identifier; $_629 “$per-7-pos-5-file” isa file; $_623 “$per-7-pos-4-com-10-content” isa content; $per-1-pos-4-tag-1 iid 0xaa82800b7ffffffffffffff1 (tagging:tagged: iid 0x966e80037fffffffffffffff, tagging:in: iid 0x966e80127ffffffffffffff8) isa tagging; $_624 “$per-7-pos-4-com-10” isa identifier; $_625 “$per-7-pos-4-com-11-content” isa content; $_626 “$per-7-pos-4-com-11” isa identifier; $_620 “$per-7-pos-4-com-9” isa identifier; $_621 “$per-7-pos-4-com-9-com-1-content” isa content; $_622 “$per-7-pos-4-com-9-com-1” isa identifier; $job-8 iid 0x966e800b7ffffffffffffffe isa profession; $job-1 iid 0x966e800b7ffffffffffffffd isa profession; $per-14-pos-7-com-11-com-1-rep iid 0xaa82800e7fffffffffffffdc (reply:content: iid 0x966e80117fffffffffffffb9, reply:by: iid 0x966e80037ffffffffffffffb, reply:to: iid 0x966e80117fffffffffffffbd) isa reply; $job-3 iid 0x966e800b7ffffffffffffff9 isa profession; $job-2 iid 0x966e800b7ffffffffffffffc isa profession; $job-5 iid 0x966e800b7ffffffffffffffb isa profession; $_609 “$per-7-pos-4-com-5-com-1-content” isa content; $job-4

If it try to view it in Workbase using: match $fri isa friendship; get; I get the following error:
Error: 13 INTERNAL: [GQL03] TypeQL Error: There is a syntax error at line 1: match $fri isa friendship; get; offset 0; limit 30; ^ no viable alternative at input ‘match $fri isa friendship; get;’ [GQL03] TypeQL Error: There is a syntax error at line 1: match $fri isa friendship; get; offset 0; limit 30; ^ no viable alternative at input ‘match $fri isa friendship; get;’ Please check server logs for the stack trace.

social_network

entities: 16

attributes: 0

relations: 14

If I view it with just: match $fri isa friendship; every node displays as a person node like:

It looks like the import is working. Make sure you commit.

do you have a client/server mismatch? what versions are each? I think your workbase is also out of date…

Also the workbase visulisation isn’t wrong, the friendships are the vertices between the people.

How can I have a client/server mismatch when they are both started from the same typedb.bat file and download? Also I downloaded latest versions as per the instructions so if I have wrong versions then there should be some message about which versions to use. I am using 2.2 and 2.12 which should be fine.
image

I understand that the vertices are the friendships but the nodes are showing 0X identifiers and in the quickstart they are showing names hence my comment that it still looks wrong.

Also see screenshot. Python code also gives error when run against this data.

Ok you’re right the Workbase screenshots are out of date! We’ll update them when we rewrite our documentation in the coming weeks :slight_smile:

Your python is failing becuase in the query you filter out all variables except pos (get $pos;), so you don’t get $fun back in your answer object