Skip to content

Conversation

@daffidwilde
Copy link

@daffidwilde daffidwilde commented Oct 21, 2025

Goal

I'm working through the Academy at the moment, and I have found a few errors or points where things could be clearer. This PR implements fixes for the syntax errors (TypeQL and AsciiDoc), typos, and clarity points I have found.

Implementation

I have tried to keep my changes minimal following the contribution guidelines. I will comment wherever I feel explanation or discussion is required. Where I cannot provide a solution but I feel a change is warranted, I have added a // TODO: comment.

Comment on lines 148 to +152
match
$book isa book, has isbn-13 "9780486282114";
$stock isa stock;
$frankenstein isa book, has $stock, has isbn "9780486282114";
insert
$book has stock 20;
$frankenstein has stock 20;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As is pointed out later in Data validation, the ebook entity does not own stock. Running this example as-is raises an error for this reason. So, I offer up this workaround; it's a little ugly but it runs.

Whether this behaviour is intended or whether it is an issue with the type inference engine is beyond me!

----
match not { <pattern> };
insert <pattern>;
----
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This missing delimiter is causing quite a considerable rendering problem on the site.

Comment on lines +62 to 65
update $book has stock 25;
----

The `update` clause will, for each statement written, set the new attribute to be the only attribute owned by the owner. In this example, for the specific paperback book, it sets the stock to 25, replacing any existing stock value.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dealer's choice whether to change the block or the descriptor, but they should match.

----
In this case, the query was invalid because TypeDB cannot infer the roles that `$us` and `$ga` should play, but there are many reasons a query can be invalid. Try running each of the following ones to see what happens.
In this case, the query was invalid because TypeDB cannot infer the roles that `$us` and `$ga` should play, but there are many reasons a query can be invalid. Try running (and committing) each of the following ones to see what happens.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second query runs and only raises an error when you try to commit it.


To run a Define query, make sure to use a *schema* session and *write* transaction. After running a Define query, you should see any committed changes to the schema reflected in the *type browser*. The examples and exercises featured in this lesson are annotated with one of the following instructions to indicate how they should be run.

// TODO: Fix the formatting here to follow the index of Chapter 4.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@flyingsilverfin
Copy link
Member

flyingsilverfin commented Oct 22, 2025

You have no idea how happy I am to see you go through academy and be kind enough to contribute fixes back! Keep em coming and I'll work them in when you un-draft this PR :D

Thanks!!

=== Using TypeDB Console
You can use xref:{page-version}@home::install/console-cli.adoc[TypeDB Console] (minimum version 3.5.0) to load the bookstore dataset from the `typedb-example` repository, published at https://github.com/typedb/typedb-examples/releases.

// TODO: Make this clearer. What address should one use? Is there a default username? How do you set these things up via the CLI?
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this one is unfounded, but this is the first step in the Academy. In the chapter index, it says the first step will be setting up a TypeDB server, but we don't actually do that here.

Is there a step missing? Even pointing back to the installation instructions might be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants