-
Notifications
You must be signed in to change notification settings - Fork 9
Bookstore additions for tutorials #34
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
Bookstore additions for tutorials #34
Conversation
| relates order, | ||
| relates item, | ||
| owns quantity, | ||
| owns price; |
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.
Unused.
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.
Most of these are shortening by combining multiple constraints on the same variable into one statement and replacing match not { ... }; insert ... with put.
| # user | ||
| match $city isa city; $city has name "San Francisco"; insert $user isa user; $user has id "u0001"; $user has name "Kevin Morrison"; $user has birth-date 1995-10-29; (location: $city, located: $user) isa locating;end; | ||
| match $city isa city, has name "San Francisco"; insert $user isa user, has id "u0001", has name "Kevin Morrison", has birth-date 1995-10-29, has total-spending 263.08, has loyalty-tier 1; (location: $city, located: $user) isa locating;end; |
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.
Users gained two new attributes, total-spending and loyalty-tier.
| attribute start-timestamp, value datetime; | ||
| attribute end-timestamp, value datetime; | ||
| attribute status, value string @regex("^(paid|dispatched|delivered|returned|canceled)$"); | ||
| attribute status, value string @regex("^(invalid|pending|paid|dispatched|delivered|returned|canceled)$"); |
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.
you wanna swap this to @values(...) for proper 3.x usage?
What is the goal of this PR?
We add two more attributes to the bookstore schema to accommodate the new TypeDB tutorials.
What are the changes implemented in this PR?
user:total-spendingandloyalty-tier(limited to 0..5),orderstates:invalidandpending,putqueries in data loading where possible to improve readability,