Skip to content

Get started refinements #966

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion home/modules/ROOT/pages/install-tools.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ all within a unified environment.

[cols-2]
--
.https://studio.typedb.com[Open TypeDB Studio]
.https://studio.typedb.com[Open TypeDB Studio,window=_blank]
[.clickable]
****
Launch TypeDB Studio directly from your web browser.
Expand Down
2 changes: 1 addition & 1 deletion manual/modules/ROOT/pages/tools/studio.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ all within a unified environment.

[cols-2]
--
.https://studio.typedb.com[Open TypeDB Studio]
.https://studio.typedb.com[Open TypeDB Studio,window=_blank]
[.clickable]
****
Launch TypeDB Studio directly from your web browser.
Expand Down
11 changes: 8 additions & 3 deletions new_core_concepts/modules/ROOT/pages/drivers/overview.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

== What are TypeDB drivers?

TypeDB drivers are client libraries that enable applications to communicate with TypeDB servers. They provide a programming language-specific interface for all database operations, from connection management to query execution.
TypeDB drivers are client libraries that enable applications to communicate with TypeDB servers. They provide a programming language-specific interface for all server operations, from connection management to query execution.

Key responsibilities of a TypeDB driver include:

Expand All @@ -17,6 +17,8 @@ Key responsibilities of a TypeDB driver include:
* **Error handling**: Converting server errors into language-specific exceptions
* **Resource management**: Properly managing network resources and memory

They also allow you to manage databases and users.

== Communication endpoints

TypeDB servers expose two different endpoints for client communication:
Expand Down Expand Up @@ -63,8 +65,11 @@ TypeDB Server

TypeDB's gRPC drivers are implemented as FFI (Foreign Function Interface) wrappers around a shared Rust driver core, enabling the core logic, validation, and error handling to be implemented once and exposed into each language with a thin wrapper.

This means that your driver may be platform (eg. OS and CPU architecture) specific, and make your application non-portable.
However, this is typically not a problem - Rust compiles per-platform or is distributed as source, Python applications are usually distributed as source, and the Java driver is specifically built to support major platforms to allow shipping built Java applications.
This means that your driver may be platform (eg. OS and CPU architecture) specific, and make your application non-portable. However, this is typically not a problem:

- Rust compiles per-platform or is distributed as source.
- Python applications are usually distributed as source.
- The Java driver is specifically built to support major platforms to allow shipping built Java applications.

== Basic driver workflow

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ After opening a driver with the correct configuration and credentials, you can o

TypeDB provides three distinct transaction types, each with specific capabilities:

[cols="3,2"]
[cols="1,3"]
|===
|Type |Capabilities

Expand All @@ -39,7 +39,7 @@ a|* Execute read queries +

=== ACID guarantees

TypeDB transactions provide ACID guarantees up to **snapshot isolation**. For more details, see the server xref::{page-version}@new_core_concepts/typedb/transactions.adoc[Transaction] documentation.
TypeDB transactions provide ACID guarantees up to **snapshot isolation**. For more details, see the server xref:{page-version}@new_core_concepts::typedb/transactions.adoc[Transaction] documentation.

== Transaction lifecycle

Expand Down
9 changes: 3 additions & 6 deletions new_home/modules/ROOT/pages/get_started/data.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ In the previous sections we've:
.. Created a database called `get_started`.
.. Defined the social network schema:
+
[%collapsible]
====
[,typeql]
----
#!test[schema]
include::{page-version}@new_home::page$get_started/schema.adoc[tag=full_define]
----
====

== Overview

Expand Down Expand Up @@ -174,10 +177,7 @@ Studio::
In order to insert a friendship, we need to refer to users that will play the role of friends in the friendship.
That's where variables come into play!

[Note]
-----
Recall that each friendship takes exactly two friends as specified in the schema; feel free to experiment though, and see what error messages TypeDB will give you when trying to insert triple friendships.
-----

[,typeql]
----
Expand All @@ -198,10 +198,7 @@ Console::
In order to insert a friendship, we need to refer to users that will play the role of friends in the friendship.
That's where variables come into play!

[Note]
-----
Recall that each friendship takes exactly two friends as specified in the schema; feel free to experiment though, and see what error messages TypeDB will give you when trying to insert triple friendships.
-----

Using a new `write` transaction, run:

Expand Down
4 changes: 2 additions & 2 deletions new_home/modules/ROOT/pages/get_started/overview.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ The following outline serves both as an example of the main things you'll do wit
and a quick outline of the following Get Started guide - if you just want to speed through right here you can, though we recommend following the full guide!

. xref:{page-version}@new_home::get_started/setup.adoc[]
.. Sign up & launch a free TypeDB instance on https://cloud.typedb.com[TypeDB Cloud account].
.. Follow the instructions from the cluster to open https://studio.typedb.com[TypeDB Studio].
.. Sign up & launch a free TypeDB instance on https://cloud.typedb.com[TypeDB Cloud account,window=_blank].
.. Follow the instructions from the cluster to open https://studio.typedb.com[TypeDB Studio,window=_blank].

. xref:{page-version}@new_home::get_started/schema.adoc[]
.. Create a database called `get_started`.
Expand Down
131 changes: 72 additions & 59 deletions new_home/modules/ROOT/pages/get_started/query-composition.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,42 @@ In the previous sections we've:
.. Created a database called `get_started`.
.. Defined the social network schema:
+
[%collapsible]
====
[,typeql]
----
#!test[schema]
include::{page-version}@new_home::page$get_started/schema.adoc[tag=full_define]
----
====
. xref:get_started/data.adoc[Loaded some data] using a insert and match-insert queries:
+

[%collapsible]
====
[,typeql]
----
#!test[write]
include::{page-version}@new_home::page$get_started/data.adoc[tag=insert2]
----
+

[,typeql]
----
#!test[write]
include::{page-version}@new_home::page$get_started/data.adoc[tag=insert3]
----
+

[,typeql]
----
#!test[write]
include::{page-version}@new_home::page$get_started/data.adoc[tag=insert5]
----
+

[,typeql]
----
#!test[write, count=1]
include::{page-version}@new_home::page$get_started/data.adoc[tag=match-insert1]
----
====

== Overview

Expand Down Expand Up @@ -150,27 +156,28 @@ reduce $num-friends = count groupby $user, $username;
# end::reduce2[]

tag::reduce2_result[]
------------------------------
$num-friends | 1
$user | isa user, iid 0x1e00000000000000000004
$username | isa username "echo"
------------------
$num-friends | 1
$user | isa user, iid 0x1e00000000000000000000
$username | isa username "alice"
------------------
$num-friends | 1
$user | isa user, iid 0x1e00000000000000000005
$username | isa username "fizzbuzz"
------------------
$num-friends | 1
$user | isa user, iid 0x1e00000000000000000001
$username | isa username "bob"
------------------
$num-friends | 2
$user | isa user, iid 0x1e00000000000000000003
$username | isa username "delta"
------------------
$num-friends | 1
$user | isa user, iid 0x1e00000000000000000001
$username | isa username "bob"
$user | isa user, iid 0x1e00000000000000000000
$username | isa username "alice"
------------------
$num-friends | 1
$user | isa user, iid 0x1e00000000000000000004
$username | isa username "echo"
------------------

# end::reduce2_result[]
----
////
Expand Down Expand Up @@ -290,8 +297,8 @@ limit 1;
# tag::pipeline1_result[]
------------------
$num-friends | 2
$user | isa user, iid 0x1e00000000000000000006
$username | isa username delta
$user | isa user, iid 0x1e00000000000000000003
$username | isa username "delta"
------------------
# end::pipeline1_result[]
----
Expand Down Expand Up @@ -369,19 +376,19 @@ not { friendship ($user, $other-user); };

# tag::pipeline2_result[]
---------------------
$other-user | isa user, iid 0x1e00000000000000000001
$other-user | isa user, iid 0x1e00000000000000000000
$other-username | isa username "alice"
$user | isa user, iid 0x1e00000000000000000006
$user | isa user, iid 0x1e00000000000000000003
$username | isa username "delta"
---------------------
$other-user | isa user, iid 0x1e00000000000000000002
$other-user | isa user, iid 0x1e00000000000000000001
$other-username | isa username "bob"
$user | isa user, iid 0x1e00000000000000000006
$user | isa user, iid 0x1e00000000000000000003
$username | isa username "delta"
---------------------
$other-user | isa user, iid 0x1e00000000000000000003
$other-user | isa user, iid 0x1e00000000000000000002
$other-username | isa username "charlene"
$user | isa user, iid 0x1e00000000000000000006
$user | isa user, iid 0x1e00000000000000000003
$username | isa username "delta"
---------------------
# end::pipeline2_result[]
Expand Down Expand Up @@ -564,37 +571,37 @@ Console::
# tag::function_pipeline1[]
match
let $most-popular-user, $most-popular-username = most_popular_user();
$other-user isa user, has username $username;
$other-user isa user, has username $other-username;
not { $most-popular-user is $other-user; };
friendship ($other-user, $most-popular-user);
# end::function_pipeline1[]

# tag::function_pipeline1_result[]
----------------------------
$most-popular-user | isa user, iid 0x1e00000000000000000006
$most-popular-username | isa username "deltaonenine"
$other-user | isa user, iid 0x1e00000000000000000007
$username | isa username "ecclestone"
$most-popular-user | isa user, iid 0x1e00000000000000000003
$most-popular-username | isa username "delta"
$other-user | isa user, iid 0x1e00000000000000000004
$other-username | isa username "echo"
----------------------------
$most-popular-user | isa user, iid 0x1e00000000000000000003
$most-popular-username | isa username "delta"
$other-user | isa user, iid 0x1e00000000000000000005
$other-username | isa username "fizzbuzz"
----------------------------
$most-popular-user | isa user, iid 0x1e00000000000000000006
$most-popular-username | isa username "deltaonenine"
$other-user | isa user, iid 0x1e00000000000000000008
$username | isa username "fizzbuzz"
$most-popular-user | isa user, iid 0x1e00000000000000000003
$most-popular-username | isa username "delta"
$other-user | isa user, iid 0x1e00000000000000000000
$other-username | isa username "alice"
----------------------------
$most-popular-user | isa user, iid 0x1e00000000000000000006
$most-popular-username | isa username "deltaonenine"
$most-popular-user | isa user, iid 0x1e00000000000000000003
$most-popular-username | isa username "delta"
$other-user | isa user, iid 0x1e00000000000000000001
$username | isa username "alice1925"
$other-username | isa username "bob"
----------------------------
$most-popular-user | isa user, iid 0x1e00000000000000000006
$most-popular-username | isa username "deltaonenine"
$most-popular-user | isa user, iid 0x1e00000000000000000003
$most-popular-username | isa username "delta"
$other-user | isa user, iid 0x1e00000000000000000002
$username | isa username "bob78"
----------------------------
$most-popular-user | isa user, iid 0x1e00000000000000000006
$most-popular-username | isa username "deltaonenine"
$other-user | isa user, iid 0x1e00000000000000000003
$username | isa username "candice001"
$other-username | isa username "charlene"
----------------------------
# end::function_pipeline1_result[]
----
Expand Down Expand Up @@ -644,13 +651,11 @@ include::./query-composition.adoc[tag=fetch1]
----

This query now returns a sequence of JSON documents:
[source]
[source, json]
----
include::./query-composition.adoc[tag=fetch_1_result]
include::./query-composition.adoc[tag=fetch1_result]
----

The fetch clause lets you lay out the exact JSON document you need for your application, making it easy to retrieve additional data such as optional attributes or answers from subqueries.

--
Console::
+
Expand Down Expand Up @@ -679,38 +684,38 @@ fetch {
};
# end::fetch1[]

# tag::fetch_1_result[]
# tag::fetch1_result[]
{
"username": "alice",
"friends": [
{
"friend": "bob78"
"friend": "bob"
},
{
"friend": "deltaonenine"
"friend": "delta"
}
],
"username": "alice1925"
]
}
{
"username": "bob",
"friends": [
{
"friend": "alice1925"
"friend": "alice"
},
{
"friend": "deltaonenine"
"friend": "delta"
}
],
"username": "bob78"
]
}
{
"username": "candice001",
"username": "charlene",
"friends": [
{
"friend": "deltaonenine"
"friend": "delta"
}
]
}
#end::fetch_1_result[]
#end::fetch1_result[]
----
////
[,typeql]
Expand All @@ -719,11 +724,19 @@ fetch {
include::./query-composition.adoc[tag=fetch1]
----

The fetch clause lets you lay out the exact JSON document you need for your application, making it easy to retrieve additional data such as optional attributes or answers from subqueries.
This query now returns a sequence of JSON documents:

[source, json]
----
include::./query-composition.adoc[tag=fetch1_result]
----

--
====

The fetch clause lets you lay out the exact JSON document you need for your application, making it easy to retrieve additional data such as optional attributes or answers from subqueries.


== What next?
There is much more to explore in the world of TypeDB, including building custom query logic using disjunctions and negations, the deep exploration of data connection using functional recursion, and more.

Expand Down
Loading