Skip to content

Conversation

krishnangovindraj
Copy link
Member

@krishnangovindraj krishnangovindraj commented Aug 7, 2025

Goal

Updates to TypeQL reference pages

Implementation

Copy link
Member Author

@krishnangovindraj krishnangovindraj left a comment

Choose a reason for hiding this comment

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

Flag stuff to that needs to be done for myself

@@ -3,7 +3,7 @@
This reference covers the usage of patterns in TypeQL.

== Scopes and operations

// TODO: Must update.
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: This is actually the ideal state but I'm not sure we'll ever implement it.

delete ( <variable> | has <variable> of <variable> | links ( <variable> [ , ... ] ) of <variable> ); [ ... ]
delete
( <variable> | has <variable> of <variable> | links ( <variable> [ , ... ] ) of <variable> );
[ ... ]
Copy link
Member Author

Choose a reason for hiding this comment

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

Is this better or worse?

Copy link
Member

Choose a reason for hiding this comment

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

neither

@@ -13,7 +13,7 @@ match <pattern>
where `<pattern>` denotes a valid xref:{page-version}@reference::typeql/patterns/index.adoc[pattern].

== Behavior

// TODO: This should true for all pipelines. Why have it here?
Copy link
Member Author

Choose a reason for hiding this comment

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

If we can say this, we don't need to akwardly mention that update & delete can't be the first stage in the pipelines.

@@ -1,22 +1,26 @@
= With stage
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't like calling it a stage if it's not in the pipeline.

@krishnangovindraj krishnangovindraj force-pushed the docathon-typeql-reference-check branch from 550300d to ea54a07 Compare August 7, 2025 20:45
@@ -43,6 +43,8 @@ type signature `... -> { A, B }`
returns stream `{ $a, $b }`
|===

// TODO: Compare to rules
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO

Copy link
Member

@farost farost left a comment

Choose a reason for hiding this comment

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

Comments & approve

@@ -20,8 +20,7 @@ The `@abstract` annotation does not accept any arguments.

// tag::description[]
When defined for a type, the `@abstract` annotation enforces the `abstract` constraint, making the type abstract.
An abstract type cannot be a direct type for an instance.
Thus, a concrete subtype is required for instances creation, and an abstract type can be used as a query target to retrieve information about its subtypes.
An abstract type cannot be instantiated. but can be used in a query (e.g. in an `isa` constraint to refer to all its subtypes).
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
An abstract type cannot be instantiated. but can be used in a query (e.g. in an `isa` constraint to refer to all its subtypes).
An abstract type cannot be instantiated, but can be used in a query (e.g., in an `isa` constraint to refer to all its supertypes).

Copy link
Member Author

Choose a reason for hiding this comment

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

Subtypes, no?

Copy link
Member

Choose a reason for hiding this comment

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

"in a constraint to refer to all its subtypes" is wrong, you don't refer to subtypes of anything through isa. If you want your idea of referencing abstract types through concrete subtypes to be expressed, we need to find another sentence

Copy link
Member

Choose a reason for hiding this comment

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

At least fix the , / .

Copy link
Member Author

Choose a reason for hiding this comment

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

Reworked. Check again pls?


// [,typeql]
Copy link
Member

Choose a reason for hiding this comment

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

What are you going to do with these commented out things?

Copy link
Member Author

Choose a reason for hiding this comment

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

I can either keep them around, or remove them with a commit SHA saying "This commit actually refers to the other behaviour"

Copy link
Member

Choose a reason for hiding this comment

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

Either remove or move or put a huge explicit todo

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed and replaced with a comment

Pattern comprise statements containing variables. Given a pattern, the *scope* of a variable is:

* the block `{ ... }` in which variable appears at top-level (i.e., not nested in further `{...}`) but it does not appear outside of the block,
- Exceptionally, if the variable appears in all branches of a disjunction, it counts as appearing in the parent conjunction.
Copy link
Member

Choose a reason for hiding this comment

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

I don't really understand the structure of this - point with a full sentence "Exceptionally, .... ." splitting a bullet-point list of * written in lowercase (naturally)

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't really know where to fit it.

Copy link
Member

Choose a reason for hiding this comment

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

Not here or not this way at least... it's currently read as:

But it does not appear outside of the block, Exceptionaly, ...., it counts as appearing in the parent conjunction. or, the entire...

delete ( <variable> | has <variable> of <variable> | links ( <variable> [ , ... ] ) of <variable> ); [ ... ]
delete
( <variable> | has <variable> of <variable> | links ( <variable> [ , ... ] ) of <variable> );
[ ... ]
Copy link
Member

Choose a reason for hiding this comment

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

neither

@@ -1,6 +1,101 @@
= Optionals

Optional patterns can be used in `match` stages to optionally match a pattern,
or in `insert` stages to insert a pattern *if* all the variables involved are bound.
Copy link
Member

Choose a reason for hiding this comment

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

insert or delete stages

[NOTE]
====
Coming soon.
Optional patterns are banned in `put` stages.
Copy link
Member

Choose a reason for hiding this comment

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

TBH i still have to think about this, but yah probably

@krishnangovindraj krishnangovindraj merged commit 6af175e into typedb:3.x-development Aug 13, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants