Subject | Re: [firebird-support] DDL for graph edges |
---|---|
Author | Doug Chamberlin |
Post date | 2010-05-02T23:57:12Z |
My fault for not looking closer and translating.
Your scheme looks good to me except one thing. The relationship between
A and B is not always equal going in both directions. If they are
friends the "is a friend of" relationship is the same going both ways,
but many, many relationships are not that way. For example, "works for",
"father of", etc. Therefore, you may not want to constrain the second
table to only allow one record between two people (where A < B in your
schema). You may want to allow a record with B and A where a different
relationship exists.
In fact you may want to add a new field to FS that defines the actual
relationship and is a foreign key to a relationship type table. All
depends on how complicated you want to get with this and how far ahead
you want to plan for future flexibility.
Hope this helps!
Doug C.
Your scheme looks good to me except one thing. The relationship between
A and B is not always equal going in both directions. If they are
friends the "is a friend of" relationship is the same going both ways,
but many, many relationships are not that way. For example, "works for",
"father of", etc. Therefore, you may not want to constrain the second
table to only allow one record between two people (where A < B in your
schema). You may want to allow a record with B and A where a different
relationship exists.
In fact you may want to add a new field to FS that defines the actual
relationship and is a foreign key to a relationship type table. All
depends on how complicated you want to get with this and how far ahead
you want to plan for future flexibility.
Hope this helps!
Doug C.