166 Matching Annotations
  1. Mar 2024
    1. selection in SQL.

      (expressed, e.g., using WHERE and FROM clauses)

    2. projection in SQL.

      (expressed using SELECT clauses)

    3. should

      will

    4. n retrieved.

      comment on how the JSON has changed structurally? "list of attributes" became "dictionary of specific attributes".

    5. Exercise

      this exercise might be a bit too trivial?

    1. f"insert $p isa person, has full-name $fn, has email $e; $fn == '{name}'; $e =

      same comment, also: line breaks!

    2. "match $u isa user; fetch $u: full-name, email;"

      make this a constant early in the query

    3. f""" match $fn == '{name}'; $u isa user, has full-name $fn; $p($u, $pa) isa permission; $o isa object, has path $fp; $pa($o, $va) isa access; $va isa action, has name 'view_file'; get $fp; sort $fp asc; """

      make this a constant early in the function

    4. True

      Same comment

    5. .clone()

      do you actually need clone() here? even though it's python and not rust :-D

    6. See the full schema listing

      no need to hyperlink

      Text: See full schema file

    7. See the full Insert query listing

      See full data file

    8. connect_to_typedb

      see above .. let's call this something like initialize_db_driver

    9. new_database

      refactor to database

    10. create_new_database

      refactor to something like open_or_create_database

    11. connect_to_typedb

      A bit weird that connect returns a driver. I'd say:

      • either initialize_db_driver(...) returns driver
      • or connect_to_db(...) returns a connection

      In principle, I like the second option more, and would rename driver to connection. But this contradicts driver terminology hmmm so maybe first option.

    12. Example

      remove caption

    13. pip install typedb-driver

      where do I see the necessary imports?

    14. Follow the steps below or see the full source code.

      You can find the full source code [here].

    1. Only the first one will be successfully executed.

      would be instructional to also include the error messages of the others!

    2. Lesson 7.1 (coming soon).

      an earlier reference to Lesson 8 did not have the "(coming soon)" ... should it be everywhere?

    1. You should complete Lesson 2 before starting this lesson.

      add: Some basic familiarity with SQL will be helpful, but is not required

    2. match fetch attribute isa has entity relation isa! sub sub! owns relates plays

      make this comma separated

    1. TypeQL is flexible enough that we could certainly do so if we wanted, but it is not particularly useful to and there are certain practical considerations that make the syntax tricky to use correctly. While learning the basics of TypeQL, it is best to avoid relates statements of this kind.

      instead of saying it's dangerous, can you saying something more concrete? (and less dramatic sounding :-D )

    2. Everything has a type, and so everything can be a variable.

      attribute to

      TypeDB Fundamentals, "Type Theoretic Foundations"

    1. If you see this result, you’ve set up everything correctly and are ready to begin learning how to read data in Lesson 3.

      I think it would be super useful to explain "Running a code selection" as well on this page (with screenshots). Otherwise, they'll have create a new file for each query.

    2. ff, open a

      reversed order of icon + button name?

    1. Inferred data is only generated once, so results returned are never redundant.

      unclear without further explanation

    2. Rule inference functions on deductive reasoning,

      unclear without further explanation

    3. resolved

      activated?

    4. locating

      AHHHHHHHHH

      it doesn't read good haha. what did we have against localization again?

    1. Parametric polymorphism

      prob rewrite intro paragraph. see individual comments.

      I'd rewrite this section which a focus on parametric statements. then "parametric query" can be a derived notation.

      Examples of parametric statements: $x sub relation; $y has $a; $b ($a) isa $T;

    2. The defining feature of parametric statements is that they do not include any type names, except for the root type keywords entity, relation, and attribute

      i would change this definition (I'm sure this won't impact the rest too much): the defining property is that they contain type variables that can potentially range over multiple inheritance hierarchies or interface implementations. Really, the feature to communicate is that we can have type variables! Of course, this is often implicitly, for example, match $x isa book; book owns $T; $a isa $T; $x has $a; could be match $x isa book, has $a; I'd rewrite this section which a focus on parametric statements. tbd

    3. While these queries are purely parametric, it is also possible to write non-parametric queries that include parametric statements, as we will see shortly.

      this should be the default definition.

    4. is particularly useful for parametric queries, but

      omit

    5. Parametric queries do not represent questions in the business domain, and are typically used to perform administrative procedures or database analytics.

      this should come a bit later? after the examples?

    6. Parametric queries are unique in that they are valid over any schema.

      not true since queries can parametric in some type but not another. i see no need to interpret "parametric queries" this strictly.

    7. hey match particular data by structure rather than by semantics.

      sentence probably too vague/philosophical to be meaningful to the average user.

    8. in the schema that

      are you saying somewhere that we will leave the schema implicit for now? otherwise the user may wonder where "the schema" is that you are referring to.

      (also structurally ambiguous usage of "that")

    9. locating

      still wavering on refactoring this to sth that reads better.

    10. type of ISBN we are providing.

      this could be: isbn13, isbn10, ....

    11. querying their supertypes, as

      i feel like the following is missing: subtype of a supertype is more special that then the supertype, conversely, a supertype is the generalization of (maybe many) subtypes.

    12. all three of these types are subtypes of book, which was the type we specified for $book

      where was this subtyping defined?

    13. Polymorphism in TypeDB

      each of the definitions below could do with a tiny bit more meat. Maybe 2 sentences per definition.

    14. type hierarchies

      still no mention of sub and supertypes?

    15. Allows us to define interfaces that can be implemented independently in the schema and then query those interfaces declaratively.

      a bit too vague. what are interfaces?

    16. m. In the following query, we adjust the previous query to retrieve the titles and page counts of all books.

      Explain the relation of book with the other types, don't to say "supertype" but sth is needed.

  2. Feb 2024
    1. A data class has methods to traverse between data objects by retrieving all owned attributes, all relations played in and respective roles.

      Could do with more context + explanation

    2. Use type’s label to retrieve the type object. For example, to get a stateful object of the user entity type, use:

      Needs updating

    3. Full example

      Textual explanation missing!

    4. Traverse between data objects

      Traverse data objects

    5. Add data

      Inserting data

    6. Get data

      Retrieving data

    7. Query data

      Get data by querying

      This section needs more text to make it clear how it fits on this page. For example, it doesn't tell the reader at all about the fact that you can send queries with drivers. Make clear why this is here!

    8. Data objects

      Same comments apply as before: * Could link to other manuals for sending queries * Introduction of example goes before example * Some explanation of the code highlighting the specificities of individual drivers

    9. let users = transaction.

      this line is very long ... line wrap?

    1. Explanation objects ContentsExplainablesExplain queryExplanationFull exampleLearn more

      This page is very sparse on code explanations!

    1. Add a type

      Adding types

    2. Get a type

      Retrieving types

    3. Get the type by its label

      Get types by their label

    4. Query for types

      Get types by querying

      This section needs more text to make it clear how it fits on this page. For example, it doesn't tell the reader at all about the fact that you can send queries with drivers. Make clear why this is here!

    5. Send a Get query

      This could also link to the Get Manual?

    6. retrieving all rules, printing label, condition (when) and conclusion(then), adding a new rule, retrieving a rule by its label, and deleting a rule.

      make more specific

    7. Retrieve all rules in a schema:

      make full sentence, and more specific

    8. Retrieve a rule by its label:

      make full sentence, and more specific

    9. The above example set the user type as the supertype to the admin type, making admin a subtype of user.

      GENERAL THOUGHT It might be worth, in general, to point out language specificities in example. E.g. why we need drop(...) etc. Overall, some parts of the code could do with more explanation.

    10. drop

      why drop over { } blocks?

    11. Type manipulation

      description of next example missing

    12. get/set label, get/set supertype, get subtypes, get ownerships, get roles played, etc.

      make this a list

    13. Send a Get query that returns type concept(s).

      this section somehow lacks a discussion of "how to use the results returned by a get query". Add a sentence or two?

    14. retrieving a type by its label, adding type, changing supertype, and retrieving all subtypes of a type.

      could be more specific

    15. Use type’s label to retrieve the type object. For example, to get a stateful object of the user entity type, use:

      This is good! I now know what I'm going to be looking at.

    16. To add a new

      What does this example do

    17. The above example retrieves all entity types in a database (as subtypes of the entity root type).

      move before example

    1. See below an example of schema manipulation using driver API methods.

      This is a bit too generic, and doesn't say what the example is about. You can move it up, and make it the last sentence before the Example section.

    2. The above example adds an attribute type tag of a String value type and adds ownership over it for all non-abstract entity types that directly subtype the root entity type.

      Put the description of the example BEFORE the example.

      In general: Let's introduce the example before the actual example.

      Then, any special observations come after the example.

      See, e.g., the rust book that follows this style: https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html

      Here is how you would define and use a calculate_length function that has a reference to an object as a parameter instead of taking ownership of the value:

      EXAMPLE

      First, notice that ...

    3. To delete a type, open the Type Editor window by double-clicking on the selected type in the Type Browser. At the very bottom, click the Delete button and then the Confirm button.

      make this a three step list

    4. To rename a type, open the Type Editor window by double-clicking on the selected type in the Type Browser. At the very top, click on the pencil icon immediately right from the type name. Edit the name in the Label field and press the Rename button to save the changes.

      make this a three step list

    5. Type Editor is a powerful instrument that combines easy to use GUI with API calls that can modify schema directly, without TypeQL queries. With Type Editor, it’s much easier to rename a type or change type hierarchy by changing a supertype of a type. And it works even for types that already have data inserted for them.

      remove this (or integrate the most essential points into the first paragraph) as it's less informative

    6. You can rename a type, change its supertype, change whether it’s an abstract type, add or remove owned attributes, related roles, played roles, as well as just delete a type or export its full definition.

      make this a list!

    1. See the respective

      subsection: Operating on concept maps

      would it be worth having the same section in the insert/update pages? (which also return concepts maps?)

    2. There are modifiers

      subsection: Modifiers and aggregation

    3. The easiest way to send a

      subsection

    4. How to send a Get query

      Sending a get query

    1. concept

      some links explaining these terms will be useful in the future

    2. How to send a Fetch query

      subsection as before!

    1. The example above checks the response of an insert query and commits the changes only if the number of inserts is equal to the expected number (1). Otherwise, it closes the transaction without committing the changes.

      For longer example (like this), I prefer some explanation/introduction of the example BEFORE the example

    2. Estimate the number of inserts with a read query

      Estimation of inserts

    3. Estimation of operations

    4. An insert clause is executed once per every result matched by the match clause of the same Insert query. If the match clause is omitted, then the insert clause is executed exactly once.

      is this in the right section? it sounds like it should go in the intro of the page?

      OR: tell the reader what this has to do with the structure of responses.

    5. How to send an Insert query

      Sending an insert query

    6. Check the response

      Remove this heading. Just write. Let's see an example of how this works. Consider the following insert query with a match clause.

    7. To process the response

      Section this

    8. The easiest way to check

      Section this

    9. Alternatively, you can estimate the number of inserts in an Insert query with a match clause by running a dedicated Fetch or Get query with the same match clause in the same transaction. Read queries can be used in a write transaction, and write transactions are snapshoted, preventing data changes committed in other transactions from influencing the results.

      Move this into the section about estimation

    10. ConceptMap object

      Link?

    11. The easiest way to send an Insert query is to use Studio or Console:

      Subsection as before

    1. Estimate the number of inserts with a read query

      Estimation of updates

    2. Alternatively, you can estimate the number of inserts in an Update query with a match clause by running a dedicated Fetch or Get query with the same match clause in the same transaction. Read queries can be used in a write transaction, and write transactions are snapshoted, providing isolation from changes made by other transactions.

      move down into "Estimation" section

    3. The delete clause of an Update query is executed the same number of times as the insert clause, but if a concept specified for deletion is no longer present in a database for any reason, that would not produce an error. The query will continue its execution.

      this also sound like it belongs in "Behaviour"

    4. Both delete and insert clauses are executed once per every result matched by the match clause of the same Update query.

      same as before

    5. Update query ContentsHow to send an Update queryResponse interpretationCheck the responseEstimate the number of inserts with a read queryLearn more

      Same comments apply as on previous two pages

    1. Estimate the number of deletes with a read query

      Estimation of deletes

    2. How to send a Delete query

      Sending a delete query

    3. should

      will (if the query is valid)

    4. You can estimate the number of deletes in a Delete query by running a dedicated Fetch or Get query with the same match clause in the same transaction. Read queries can be used in a write transaction, and write transactions are snapshoted, preventing data changes committed in other transactions from influencing the results.

      move into section below

    5. A delete clause is executed once per every result matched by the match clause of the same Delete query.

      Move this up!

    1. How to send a Define query

      First: rename to Sending a define query

      Also: add subsections!

    2. This page assumes you’ve already followed instructions from the Connecting to TypeDB section pages. Here, you’ll see how to u

      eventually I would make this a note

    1. Query types and sessions/transactions

      can potentially omit this at this point. TBD

    2. Transaction management

      subsection this even if its super short sections

    3. Commit a transaction

      Subheadings * Clients (or: Studio and console) * Drivers

    4. A commit can fail if an inconsistency arises, like a concurrent modifications by another successful commit. A failed commit closes the transaction.

      put this in subheading "Commit failure"

    5. the variable

      which variable is "the variable" ?

    6. Closing transaction doesn’t save any changes made within the transaction.

      mention here already that "committing" is what you need to do to save changes (and say "see next section")

    7. Close a transaction

      subheadings!

    8. To open a transaction, you need to select a transaction type and use an open session. Optionally, you can set transaction options.

      as before: quite a lot of duplication of material here (or potential for it).

      Solution? Link from Studio manual to this specific content?

    9. Open a new transaction

      as before: subheadings!

    1. logically coherent

      example of what "logically coherent" means?

    2. Session management

      could have subheading here * Session timeouts * Blocking sessions * Best practice

    3. blocks

      highlight

    4. Open a new session

      Add subsections: * Open a new session * Studio and Console * Drivers * Close sessions * Studio and Console * Drivers

    5. To see how to close an open session, see below.

      omit

    6. most flexible

      what added flexibility? important to point this out?

    7. To open a session to a database, you need to have a connection to the server and know the name of the database.

      Add one sentence about what session are/what they are for.

    1. A network connection to TypeDB Core requires the address and port of the server to connect to.

      There is some duplication here... should we just refer to Console/Studio manual? hmm

      One solution could be to link to these specific tasks from the TypeDB studio manual. I think that would be my preferred option.

      E.g. have * TypeDB Studio (category) * Operations (page) * DB operations (heading) * you can create a database (link) * you can rename a database (link) * you can delete a database (link) * Type operations (heading) * ...

    2. let driver = Connection::new_core("127.0.0.1:1729");

      Should there be some mention of the necessary use statement? use typedb_driver::{ Connection, DatabaseManager, ... }; same for other drivers

    3. Learn more

      Next articles

    4. A network connection to a TypeDB Cloud cluster requires address and port of at least one server in the cluster, as well as username and password of a user.

      same as above

    1. TypeDB Studio

      Same comment as before. Could have:

      TypeDB Studio * Set-up (Setup/Connection/Databases/Settings) * Querying (Querying/Inference) * Operating (Type Browser/Editor/Settings) * Compatibility

    2. Prepare a query in a tab Run a query from a tab See the results of your query in all available output formats

      there could be more topical pictures for each of the sections

    3. Run a query

      can we get captions for the figures? It's so small, it's unclear what the picture is for!

    4. If the explain button is inactive, double-check that Studio is connected to TypeDB, a database is selected with a drop-down list in the toolbar, and the infer and snapshot buttons are on.

      make this a Note, and move to bottom

    5. it

      "it" is ambiguous. replace with "the result"

    6. It

      Unclear what "It" references

    7. Exporting rules is not supported by this button yet.

      make Note

    8. root types

      link

    9. Both ways require you to commit the changes by the Commit () button at the top toolbar.

      avoid general behaviour in the table. just add that outside the table (i.e. the same is repeated below)

    10. Type Editor is a powerful instrument that combines easy to use GUI with API calls that can modify schema directly, without TypeQL queries. With Type Editor, it’s much easier to rename a type or change type hierarchy by changing a supertype of a type. And it works even for types that already have data inserted for them.

      this becomes the second paragraph

    11. Given a schema session

      What does "given" mean here? It's better explained below

    12. You can rename a type, change its supertype, change whether it’s an abstract type, add or remove owned attributes, related roles, played roles, as well as just delete a type or export its full definition.

      make a table below

    13. green lining

      highlight

    14. Session type () switch — selects a session type to use for queries.

      make this into a table if possible

    15. ()

      style note: buttons don't look exactly the same. e.g. schema data has a black boundary around it.

    1. Learn more

      Read next/Next articles

    2. let databases = DatabaseManager::new(driver);

      same as before (mention use statement somehow?)

    3. To create a new database, follow the steps below:

      again some duplication here :/

    1. TypeDB Console ContentsConnect to TypeDBInteractive modeServer levelTransaction levelExampleNon-interactive modeExampleScriptingExampleTroubleshootingNon-ASCII charactersReferencesConsole CLI argumentsServer level commandsTransaction level commandsTransaction optionsVersion Compatibility

      Could the sections on this page be (short) individual pages? It could also be TypeDB Console

      TypeDB Studio * Set-up (Connection/Troubleshooting) * Querying (Interactive Mode/Non-int Mode/Scripting) * Reference (... tables) * Compatibility (... table)

      TBD

    2. Address to which Console will connect to: IP address and IP port separated by colon. Default value: localhost:1729. (TypeDB Core only)

      can we decrease the font size? make it look similar to https://www.mongodb.com/docs/manual/reference/method/db.collection.find/#behavior

    3. section

      "reference" or "reference section"

    4. section

      "reference" or "reference section"

    5. script.txt is the path to the file.

      where PATH is the path to the file script.txt

    6. --script=script.txt

      --script=PATH/script.txt

    7. script.txt

      is there another extension we could give to "typedb console script files" ? .tcs ? .tqs ?

    8. The above example creates a database with the name typedb, defines a schema with the person type, then inserts an instance of the person type into the database.

      move this into the example. Delete the enumeration in the example. Just text + code.

    9. typedb console

      start with $ sign to indicate shell execution?

    10. Run Console in

      Use text instead of numbering. i.e.

      First, start typedb console by running the following command ...

    11. You are now in TypeDB Wonderland!

      the in is highlighted?