-
Couldn't load subscription status.
- Fork 73
Fix Academy errors #999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 3.x-development
Are you sure you want to change the base?
Fix Academy errors #999
Conversation
| 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; |
There was a problem hiding this comment.
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>; | ||
| ---- |
There was a problem hiding this comment.
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.
| 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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See these TODOs
|
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? |
There was a problem hiding this comment.
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.
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.