文本中的实体关系表示法
实体关系是否有标准(非图形)表示法?
现在我正在使用我自己的简陋符号:
- 用户>>照片,(1-多)
- 用户> Profile , (1-1 hasOne)
- Profile <用户 , (1-1 属于)
- 照片 <<用户 , (many-1 属于)
- 照片 <>标签,(多对多)
Is there a standard (non-graphical) notation for Entity Relationships?
right now I'm using my own janky notation:
- User >> Photo , (1-many)
- User > Profile , (1-1 hasOne)
- Profile < User , (1-1 belongsTo)
- Photo << User , (many-1 belongsTo)
- Photo <> Tag , (many-many)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
差不多十年后,我也很难找到明文标准。这是我到目前为止所发现的(不过,公平警告,它主要是图形标准,恰好在文本中运行良好)。
首先,描述对象之间关系基数的常用术语是“多重性”。
尽管相当多的来源也使用术语“基数”。
关于多重性与基数这个SO问题的差异有一些很好的答案。我发现这个非常简洁:
UML 的多重性表示法
UML 的 多重表示法 在文本中效果很好。
这似乎有一些变体:
微软的关系表示法
<前><代码>+--------------------------------+--------- ------------+
|多重性|基数 |
+--------------------------------+---------------------------- ------+
| * |一比零或更多|
| 1..* | 1..*一对一或多对 |
| 0..1 | 0..1一比零还是一|
| 1 |正好一个 |
|用破折号分隔的两个数字 |范围 |
+--------------------------------+---------------------------- ------+
IBM 的
<前><代码>+------+--------------------+---------------------------- ----------------+
|玫瑰|软件架构师|描述 |
+------+--------------------+--------------------- ----------+
| n | * |无限数量的实例 |
| 1 | 1 |恰好 1 个实例 |
| 0..n | 0..n | * | 0 个或多个实例 |
| 1..n | 1..n | 1,,* | 1 个或多个实例 |
| 0..1 | 0..1 0..1 | 0..1 0 或 1 个实例 |
+------+--------------------+--------------------- ----------+
Smartdraw 的马丁风格
陈风格
来自 我读到的陈式是“原始格式”。我通常将其以文本形式表示为:
IDEF1X 和
其他IDEF1x(NIST 标准):
这似乎描述了Min-Max / ISO notation(英文链接目前为已损坏,但维基百科的 实体关系模型文章 其中还列出了一些其他样式的图形符号,其中一些是文本友好。
德语有关 (min,max) 表示法的文章 还有一个有用的表格比较 UML、Chen、(min,max) 和 MC(修改陈):
Almost 10 years later and I've also had a hard time finding plaintext standards. Here's what I've found so far (fair warning though, it's mostly graphical standards that happen to work well in text).
First, the common term for describing the cardinality of a relationship between objects is "multiplicity".
Though a considerable number of sources also use the term "cardinality".
There's a few good answers about the difference on this SO question about Multiplicity vs Cardinality. I found this one to be pretty succinct:
UML's Multiplicity Notation
UML's multiplicity notation works well in text.
There seem to be a few variations of this:
Microsoft's Relational Notation
IBM's
Smartdraw's Martin Style
Chen Style
From what I've read Chen style is the "original format". I commonly see this expressed in text as:
IDEF1X and Others
There's IDEF1x (a NIST standard):
That seems to describe the Min-Max / ISO notation (the English link is currently broken but here's a German article) referenced by Wikipedia's Entity–relationship model article which also lists a few other styles of graphical notations, some of which are text-friendly.
The German language article on (min,max) notation also has a useful table comparing UML, Chen, (min,max) and MC (Modified Chen):
为什么不使用与 ER 图中相同的内容:
等等。 但我从未听说过官方明文标准。
Why not use the same than in ER-Diagramms:
and so on. But I never heard of an official plaintext standart.
有软件可以将纯文本描述转换为可视化 ER 图。
例如 erd 使用以下符号:
示例:
另请检查此 类似工具列表。
然而,这些都不能称为标准。
There is software available that transforms plain text descriptions into visual ER diagrams.
For instance erd uses the following notation:
Examples:
Check also this list of similar tools.
However, none of these could be called a standard.