![]() | |
#41
| |||
| |||
|
|
On May 12, 12:53*am, Nilone <rea... (AT) gmail (DOT) com> wrote: On May 12, 12:30*am, Tegiri Nenashi <tegirinena... (AT) gmail (DOT) com> wrote: Again, the IS-A case seems easier because we already have subset relationship defined for each pair of "attribute- compatible" relations. I consider x IS-A y as a relation named y with a unique constraint on x. *Your thoughts? I'm lost. Example, please? |
|
I'm not that sure about the HAS-A. I consider x HAS-A y as a relation which includes attributes x and y. A unique constraint on y denotes aggregation, the lack of it association. Well, I was impressed by Smith&Smith "Aggregation and Generalization" paper a while while ago, but since the rise of UML avoid using these terms. Again, example, please. |
|
Well, how about "Gentle introduction to relational lattice"? Better yet, you appears to have solid programming background, so I assume downloadinghttp://qbql.googlecode.com/svn/trunk/dist/qbql.jar or even checking in QBQL project in Eclipse wouldn't be a problem? |
#42
| |||
| |||
|
|
// 'is' of identity Flower = [x: Name] * * * * Rose * * * * Violet // 'is' of predication FlowerColor = [x : Animal, y : Color] * * * * Rose, Red * * * * Violet, Blue |
#43
| |||
| |||
|
|
On May 12, 6:26*pm, Tegiri Nenashi <tegirinena... (AT) gmail (DOT) com> wrote: On May 12, 12:53*am, Nilone <rea... (AT) gmail (DOT) com> wrote: I consider x IS-A y as a relation named y with a unique constraint on x. *Your thoughts? I'm lost. Example, please? This definition of IS-A differs from the one I previously gave in this thread ("IS-A is an isomorphism between domains of entities"). * |
|
The two uses correspond to the 'is' of identity and the 'is' of predication, resp (see Korzybski). *For example: // 'is' of identity Flower = [x: Name] * * * * Rose * * * * Violet // 'is' of predication FlowerColor = [x : Animal, y : Color] * * * * Rose, Red * * * * Violet, Blue |
|
Aren't those terms still used in UML, e.g.http://en.wikipedia.org/wiki/Class_d...Relationships? I messed up 'aggregation' and 'association' there. *Let me try again: a lack of unique constraints imply aggregation, a unique constraint on x denotes the composition of y from x, and vice-versa for a unique constraint on y. *Unique constraints on both implies a binary association relation. *For example: // aggregation StudentClass = [x : Student, y : Class] * * * * John, Math * * * * John, Biology * * * * Mary, Math * * * * Mary, History // composition, unique constraint on y SubjectModule = [x : Subject, y : Module] * * * * Math, Geometry 1 * * * * Math, Algebra 1 * * * * Biology, Evolution 1 // association, unique constraint on (x, y) DepartmentHead = [x : Department, y : Professor] * * * * Physics, Frank * * * * History, Susan |
#44
| ||||
| ||||
|
|
On May 13, 1:07*am, Nilone <rea... (AT) gmail (DOT) com> wrote: This definition of IS-A differs from the one I previously gave in this thread ("IS-A is an isomorphism between domains of entities"). * That one didn't make sense: isomorphism is an equivalence [relation], and we are after an order. Homomorphism might do. |
|
The two uses correspond to the 'is' of identity and the 'is' of predication, resp (see Korzybski). *For example: // 'is' of identity Flower = [x: Name] * * * * Rose * * * * Violet // 'is' of predication FlowerColor = [x : Animal, y : Color] * * * * Rose, Red * * * * Violet, Blue I don't understand: 'IS-A' is a binary relation, what are the things you relate to with 'IS-A' in your examples? |
|
Association is easy: it is unconstrained binary relation between two things. It doesn't have to be reflexive, irreflexive, symmetric, asymmetric, antisymmetric, transitive, total, trichotomous, or whatever. |
|
I still struggle to understand what are the things that you are trying to relate to. |
#45
| ||||
| ||||
|
|
On May 8, 2:12*pm, r... (AT) raampje (DOT) lan (Reinier Post) wrote: Nilone *wrote: It looks to me like tuples are being equated with entities. When justifying the definition of IS-A in the E/R-model: yes. What do you mean? |
|
I'm thinking: - E/R model entities and attributes are elements of domains - E/R model relationships are relations over domains - Tuples are the elements of relations over domains of entities - IS-A is an isomorphism between domains of entities - HAS-A is a monomorphism between domains of entities |
|
So when it looks like an entities are equated with tuples, I wonder why. I believe it's a mistake to do so, but perhaps I'm missing something. |
|
A relation is not a domain. THat is irrelevant for the IS-A I'm discussing. My apologies for jumping to conclusions. I would like to understand the IS-A you're discussing. I'll continue reading. |
#46
| ||||||||||
| ||||||||||
|
|
I am referring to the notions of E/R model and IS-A I've detailed here before, from the textbook by Silberschatz et al.: *http://www.db-book.com/ |
|
They avoid considering tuple-valued domains. *Instead, they define entities (to be precise: entity sets) as relations identified entirely by their own attributes, and relationships (to be precise: relationship sets) as relations defined entirely by their foreign key attributes, which foreign keys are all primary keys of entities. |
|
*Definied in this way, entities and relationships are particular types of relations in relational schemas. |
|
However, this definition only applies to E/R diagrams in which all attributes and identifications have been fully specified, not to incomplete ones in which foreign key relationships may be specified prior to the entity's identifying attributes. |
|
It is not a mistake, but a modeling decision. *One may wish to express that two relations share a common part, prior to or independent of the exact attributes of that part. |
|
*For instance, in an E/R model we may wish to express that both persons and companies have addresses, that these addresses are the same type of entity, and that addresses are not atomic domain values, but tuples in a relation, prior to specifying any further details of addresses. |
|
*In a Silberschatz et al. E/R model, this can be expressed by making Address an entity (set) and Person and Company relationship (set)s. *These models are subsequently elaborated into relational models by detailing the exact attributes of all entities and relationships concerned. |
|
*In more general techniques such as ORM we don't need to categorize all relations as either relationship (set) or entity (set), but can specify arbirary identification relations between relations. *The identification relations become foreign keys once all attributes have been specified in full. Similarly, in an E/R or ORM (or similar) model one may wish to say that a particular relation has the same primary key as some other relation, whether or not that primary key has been specified any further. *That is IS-A. |
|
A relation is not a domain. THat is irrelevant for the IS-A I'm discussing. My apologies for jumping to conclusions. *I would like to understand the IS-A you're discussing. *I'll continue reading. I've been on a short vacation. *I'm not sure how to explain these things effectively. |
|
*The ideas aren't exactly new, mine, unusual, or rocket science, but when I bring them up here people tend respond by saying I'm a "moron" who "can't reason abstractly", etc. so something must be wrong with what I say about them. |
#47
| ||||||||
| ||||||||
|
|
On May 22, 12:26*am, r... (AT) raampje (DOT) lan (Reinier Post) wrote: I am referring to the notions of E/R model and IS-A I've detailed here before, from the textbook by Silberschatz et al.: *http://www.db-book.com/ |
|
Entities, in general, contain identifying attributes (e.g. SSN) and non-identifying attributes (e.g. birthdate). It sounds as if they include both identifying and non-identifying attributes in the same "relation". |
|
If so, I disagree with that approach. As I see it, the identifying attributes define one relation, and each non-identifying attribute defines a relation from the identity of the entity to the identity of another entity (e.g. a date). *Definied in this way, entities and relationships are particular types of relations in relational schemas. I, too, think that entities and relationships define relations, but I equate an entity with its identity only, and view all other attributes as observations (more relations) upon the entity, not components of it. |
|
However, this definition only applies to E/R diagrams in which all attributes and identifications have been fully specified, not to incomplete ones in which foreign key relationships may be specified prior to the entity's identifying attributes. I don't understand the reason for this qualification. |
|
It is not a mistake, but a modeling decision. *One may wish to express that two relations share a common part, prior to or independent of the exact attributes of that part. I can understand that two entities can share a part, but when two relations share an attribute, that just means they describe the same domain. |
|
*For instance, in an E/R model we may wish to express that both persons and companies have addresses, that these addresses are the same type of entity, and that addresses are not atomic domain values, but tuples in a relation, prior to specifying any further details of addresses. I interpret this as: Person = [ ... ] Company = [ ... ] Address = [ ... ] PersonAddress = [ x : Person, y : Address ] CompanyAddress = [ x : Company, y : Address ] which says very little about how to implement it in SQL. |
|
I suspect "relational models" here means "SQL schemas". I disagree that the model as described can be called relational, in the mathematical sense of the word relational. |
|
*In more general techniques such as ORM we don't need to categorize all relations as either relationship (set) or entity (set), but can specify arbirary identification relations between relations. *The identification relations become foreign keys once all attributes have been specified in full. Similarly, in an E/R or ORM (or similar) model one may wish to say that a particular relation has the same primary key as some other relation, whether or not that primary key has been specified any further. *That is IS-A. I'll have to study ORM properly some time. |
#48
| |||||||
| |||||||
|
|
Nilone wrote: Entities, in general, contain identifying attributes (e.g. SSN) and non-identifying attributes (e.g. birthdate). *It sounds as if they include both identifying and non-identifying attributes in the same "relation". Yes, of course: the primary key of a relation rarely contains all of its attributes. |
|
You basically factor out all primary keys of entities (i.e. entity sets, relvars in Date's terminology). This turns IS-A into a subset relation on them. It makes perfect sense to me except that I don't quite see the reasons for constraining models in this way. |
|
Just a technicality: in E/R diagrams in which primary keys haven't yet been specified, the entities and relationships that are indicated strictly speaking aren't, if entity- and relationship-ness is defined in terms of primary keys. |
|
I can understand that two entities can share a part, but when two relations share an attribute, that just means they describe the same domain. Why? *For that they must share not just any attribute, but a key, and furthermore, be mustually IS-A (e.g. always hold the exact same sets of values for that key). |
|
Yes, that's perfectly reasonable, but Silberschatz et al. do make that decision, by assuming primary keys on all relations, and using not entities themselves but their primary keys in relationships. *Which leads to the technicality above. Your way avoids the technicality, directly corresponds to the actual E/R model, postponing the translation to a relational model as a later step; all clear advantages. |
|
A disadvantage is that entity-valued attributes raise some eyebrows among certain relational purists. *In all I think the differences are minor. |
|
I mean 'relational models' in some mathematical sense (the one I've helped teach was by Debrock) which will indeed be converted to SQL schemas when implemented in an SQL database. *What would be un-relational or un-mathematical about them? |
#49
| |||||||||||
| |||||||||||
|
|
On May 22, 9:14*pm, r... (AT) raampje (DOT) lan (Reinier Post) wrote: You basically factor out all primary keys of entities (i.e. entity sets, relvars in Date's terminology). This turns IS-A into a subset relation on them. It makes perfect sense to me except that I don't quite see the reasons for constraining models in this way. Although you see me factoring out primary keys, I believe I only unpacked conflated relations. I don't think it constrains a model at all, but rather it makes our assumptions explicit. |
|
Just a technicality: in E/R diagrams in which primary keys haven't yet been specified, the entities and relationships that are indicated strictly speaking aren't, if entity- and relationship-ness is defined in terms of primary keys. This seems to conflate the model with its implementation. |
|
I can understand that two entities can share a part, but when two relations share an attribute, that just means they describe the same domain. Why? *For that they must share not just any attribute, but a key, and furthermore, be mustually IS-A (e.g. always hold the exact same sets of values for that key). I think our difference here depends on our different understandings of the term 'relation'. Mine corresponds roughly to relationships in E/R diagrams, except I view EVERYTHING as relationships / relations. |
|
Yes, that's perfectly reasonable, but Silberschatz et al. do make that decision, by assuming primary keys on all relations, and using not entities themselves but their primary keys in relationships. *Which leads to the technicality above. Your way avoids the technicality, directly corresponds to the actual E/R model, postponing the translation to a relational model as a later step; all clear advantages. I believe mine corresponds to a relational model, which gets translated into an implementation model such as SQL later. |
|
A disadvantage is that entity-valued attributes raise some eyebrows among certain relational purists. *In all I think the differences are minor. Such entity-valued attributes allow us to climb to higher abstraction levels. Without them, higher order relations become a mess of redundant definitions. |
|
If you describe a dog or car or person or chair or anything, do you reiterate its defining characteristics every time? |
|
Look at http://en.wikipedia.org/wiki/Turing_...mal_definition. First it defines a (one-tape) Turing machine as a 7-tuple and describes the heading of the relation, then it defines the 3-state busy beaver as an instance of that class. However, in this post I can refer to the 3-state busy beaver without reiterating its definition. Furthermore, I can refer to *it* without reiterating its name. |
|
Anything that can be said about the entity describes it, so what about the thing itself? |
|
Korzybski equates it to a relation over the various descriptions of it. |
|
In order to express that relation, we need what you call entity-valued attributes. Otherwise, we'll be stuck describing bits forever. |
|
I mean 'relational models' in some mathematical sense (the one I've helped teach was by Debrock) which will indeed be converted to SQL schemas when implemented in an SQL database. *What would be un-relational or un-mathematical about them? I may have jumped the gun since the given description ("Address an entity (set) and Person and Company relationship (set)s") seems too vague to work from. Also, can you verify that Person and Company refer to relationship (set)s? I think I need an example for further comment. |
#50
| |||||||||
| |||||||||
|
|
Nilone wrote: Although you see me factoring out primary keys, I believe I only unpacked conflated relations. *I don't think it constrains a model at all, but rather it makes our assumptions explicit. It does constrain your models: they are always 'unpacked'. |
|
I think our difference here depends on our different understandings of the term 'relation'. *Mine corresponds roughly to relationships in E/R diagrams, except I view EVERYTHING as relationships / relations. But you'll need to start somewhere. *I suppose you also have domains. If your entities form somains you'll presumably want to distinguish between 'atomic' and 'complex' domains, or between 'value' and 'entity' domains, or something like that. *Silberschatz avoids that. |
|
I don't quite understand the relationship (in an informal sense) between your domains and your entities. |
|
Such entity-valued attributes allow us to climb to higher abstraction levels. *Without them, higher order relations become a mess of redundant definitions. No, they don't, as Silberschatz's solution shows. |
|
If you describe a dog or car or person or chair or anything, do you reiterate its defining characteristics every time? No, Silberschatz reiterates its primary key attributes. |
|
There is no such thing as 'the thing itself' - the idea that there is is a fallacy that appears to permeate a lot of writing on logic. |
|
Korzybski equates it to a relation over the various descriptions of it. This is a possible way out. *Brian Selzer likes to defend this view here. I believe Russell would also subscribe to it but I haven't read much Russell. *I don't see how we need this in relational modeling. |
|
In order to express that relation, we need what you call entity-valued attributes. *Otherwise, we'll be stuck describing bits forever. We don't need to express such a "universal" relation at all. The idea that objects can be uniquely determined in this way is a fundamental fallacy. *All identification is relative to a domain model. It suffices to express relations in the amount of detail required for the problem(s) at hand. *Identification of objects will be relative to the resulting model (schema). *This is not because we're lazy, it's because object identification is fundamentally like that.. |
|
These descriptions aren't vague at all, they are mathematical criteria in terms of primary keys, which I have stated. *It is impossible to 'verify' whether Person or Company are entity sets in general, because it depends on the range of possible situations the schema is designed to capture; I was merely assuming this by way of illustration.. |
![]() |
| Thread Tools | |
| Display Modes | |
| |