T
TypeDB•7mo ago
modeller

Docs erratas

perhaps we need a channel for errata as there are some small spelling mistakes and i dont want to dominate this channel?
42 Replies
georgii
georgii•7mo ago
This can be a start
modeller
modellerOP•7mo ago
no s on labels sentence ends abruptly and lacks ending
No description
modeller
modellerOP•7mo ago
modeller
modellerOP•7mo ago
built instead of build
No description
modeller
modellerOP•7mo ago
Incomplete text, relation roles can be played by entities or relations, this is not explained. This is a key difference between TypeDB and any other graph, so you mut say it!!! Thus, the sentence should be extended by saying something like
may link two friends (implemented by, say, two entities, or a relation and an entity)
may link two friends (implemented by, say, two entities, or a relation and an entity)
or, better, when you mention roles you should define what type of objects can play roles!!!!!!
No description
modeller
modellerOP•7mo ago
Incorrect, structs are not a type. They are a sub-type of the attribute type. There are only 3 type in typedb, entity, relation, attribute, so the below text is inconsistent, consider revising 3 and 4 to reflect the fact that attributes can be primitve or structured
No description
modeller
modellerOP•7mo ago
Again, lists are not a type. Attributes can be either primitive or structured, Either can be defined singly or as a list. the entire Attribute section needs to be reconsidered, as it is poorly constructed atm
No description
modeller
modellerOP•7mo ago
A schema query, implies that i am querying the schema, i can query against the schema to retrieve data, but this is poorly phrased, remove the word schema, or change it to say
data queries against the schema
data queries against the schema
No description
modeller
modellerOP•7mo ago
Should be a full stop instead of a colon. The sentences should read
... which filters and retrieves data using TypeQL patterns. TypeQL patterns are a direct ....
... which filters and retrieves data using TypeQL patterns. TypeQL patterns are a direct ....
No description
modeller
modellerOP•7mo ago
there is no $u variable
No description
modeller
modellerOP•7mo ago
there is a definition of what it is, bit no example showing its use. If you cant use it yet, then remove it, else show and example of Optional variables
No description
modeller
modellerOP•7mo ago
Confusing text on anonymous variables: 1. Why is it useful? 2. When would i use it? 3. How do i use it (example)?
No description
modeller
modellerOP•7mo ago
Illogical to have the numbers backward, why is function 1 called from function2? Why make the user mentally reverse the numbers? Surely it will be 10x clearer if you reverse the numbers, so it makes some kind of logical sense, also reword it
If function *2* is called from function *1*, and that call is from within the scope of a negation, then the evaluation of function *2* ...
If function *2* is called from function *1*, and that call is from within the scope of a negation, then the evaluation of function *2* ...
No description
modeller
modellerOP•7mo ago
What is a non-type variable, why not just say variable Stage should be Stages
No description
modeller
modellerOP•7mo ago
---------------- Whew, the first two pages properly checked, see above
georgii
georgii•7mo ago
Thank you for the feedback! Extremely appreciated @core We'll need to have an iteration through these points with the incoming docs update
krishnan
krishnan•7mo ago
I'd guess the author stopped halfway through the explanation of stratification. "Stratification ensures function 1 is fully evaluated before function 2" Good set of questions. Why is it useful? It's not returned by the stage and they don't cause duplicates. So you should be able to do: Examples of use: * When you don't care about a variable as long as there's atleast one. This prevents duplicating $x if they have multiple addresses - match $x isa person, has address $_; * There's an irrelevant subpattern you need to traverse, that you don't want blowing up your answers: - match $x isa person, has name "John"; $_ isa friendship, links ($x,$_1); $_ isa friendship, links($_1, $y); I hope these work, because I don't use them much myself since I'm usually debugging and want the answers for every variable. Can you achieve the same with an explicit distinct and select? I think so.
modeller
modellerOP•7mo ago
I'll do more over time lads, and just keep posting it here
Joshua
Joshua•7mo ago
@georgii or @krishnan have either of you started fixing these yet?
krishnan
krishnan•7mo ago
Not me. Figured we'd do it during the next doc run
georgii
georgii•7mo ago
Same, that's what I said above
modeller
modellerOP•5mo ago
What does this statement actually mean?? Can it be interpreted without additional info??? I cant understand it, how does it differ from key??? What is it meant to do?
No description
modeller
modellerOP•5mo ago
Consider completely revising the description
dmitrii
dmitrii•5mo ago
FWIW @unique is a lot like @key, except a concept can only own one key attribute, but any number of unique attributes. Each attribute can still only have one owner though. You can think of @key as @unique + @card(1)
modeller
modellerOP•5mo ago
hmm thank you, i did find it in the TypeQL manual with a better description, @Joshua and i were also talking about the issue of modelling a dict, where it would be nice to have a unique, key for each value but only for that object, so unique is more useful if it can be scoped so, a global unique and a local unique are both useful Question:, looking through the keyword glossary, I see the word "struct". Is struct implemented, or is this just forewarning? https://typedb.com/docs/typeql/keywords#_statements If it is forewarning, should I include the keyword "list"??
dmitrii
dmitrii•5mo ago
Structs and lists are not yet implemented. struct is a reserved keyword, list is also a keyword, but weak, it's used as an aggregation function reduce $xs = list($x); The list type is denoted with [], e.g. person[].
modeller
modellerOP•5mo ago
ok, thank you. I thought Lists were still to be implemented, can i use a list for a role? is lists the same or different to cardinality?
dmitrii
dmitrii•5mo ago
Lists aren't implemented yet, no. You can use list as a role name, it's not reserved.
modeller
modellerOP•5mo ago
oh riught, when they are implemented, you may change the cardinality to suit i was looking at one to many, and thinking list
dmitrii
dmitrii•5mo ago
They're not intrinsically related. Lists in schema are about ordering, i.e. ordered attribute ownerships for a concept and ordered role players for a role in a relation.
modeller
modellerOP•5mo ago
aah, of course, the ordering, i was thinking of just many, so the card 1 to many is like the old grakn unordered list? Anyway, thanks In the SubTyping Section, there is no detail on subtyping attributes, or relations for that matter. When subtyping attributes, does one use an abstracting keyword for the supertype? What is the correct approach for attribute subtyping?? https://typedb.com/docs/manual/schema/schema_structure#_subtyping_and_inheritance Question: When Defining Cardinality Constraints for Role Traits, are they specified on the Source Relation, or the Role object's (entity or relation)?? In this doc the card annotation is shown being marked on an entity's plays trait. Do I take this to mean that generally in the schema, relation role cardinality is marked on the end object type, rather than the source relation? https://typedb.com/docs/typeql/annotations/card#_usage If so, this really needs to be clearly explained for both, attribute ownership and role playing
georgii
georgii•5mo ago
It's not explained because there is no difference for all the kinds in the schema (maybe we can just state it explicitly). There is a special case of value types which is explained on the next page, though Since 3.0.x (I don't remember the specific patch version), attribute supertypes can be non-abstract
modeller
modellerOP•5mo ago
do attribute supertypes have to have a value? or can they swing value types?
georgii
georgii•5mo ago
I felt like the section you reference shows a representative example to answer your question. You better avoid saying "role trait". Roles are separate types. Relations have two role-related traits: relating and roleplaying (roleplaying is also available for entities). When declaring relates, you can set the cardinality of this relates: restrictions for the number of roleplayers of this role for a relation instance. When declaring plays, you can set the cardinality for this plays: restrictions for the number of times an instance can play this role. We may extend my explanation above in the docs. https://typedb.com/docs/manual/schema/types#_attribute_types We definitely need to think about how to merge/reorganize these two pages as the questions may arise earlier. But there is also a chance that you have these questions only because you're migrating from 2.x
modeller
modellerOP•5mo ago
true, plus i am somewhat retentive on docs to be fair, so i ponder them and mull the words them over crazy that i can declare relation cardinality on either plays or relates keywords
georgii
georgii•5mo ago
Why so? It's quite basic even in SQL 🙂 One-to-many, one-to-one, and it's specified for each direction And even more representative with TypeDB graph visualization: 3 types of traits (edges), 3 separate cardinalities For other edges, the unchanged default is 0..1 (sub, value, etc)
krishnan
krishnan•5mo ago
They're not the same though from what I gather. Declaring a relation friendship relates friend @card(2) means an instance of friendship can have at most 2 friend roles. Declaring entity person plays friendship:friend @card(1..) means a person must play the role of friend in atleast one friendship relation. I hope that's what you were asking
modeller
modellerOP•5mo ago
aah, thats a gotcha for certain, so if you use the card annotation, the instance must have at least one copy??
krishnan
krishnan•5mo ago
One copy of what?
modeller
modellerOP•5mo ago
the attribute data, or the plays object
krishnan
krishnan•5mo ago
No, @card(0..) is a valid cardinality entity person has name @card(0..); would allow a person with no name to exist
modeller
modellerOP•5mo ago
most of the lists in Stix are unordered, so this seems like the perfect annotation to have on repeat thank you, i will use that everywhere, cutting and pasting now actually, hahaha

Did you find this page helpful?