Entity relationship 文本中的实体关系表示法
实体关系是否有标准(非图形)符号 现在我正在使用我自己的janky符号:Entity relationship 文本中的实体关系表示法,entity-relationship,relationship,notation,erd,Entity Relationship,Relationship,Notation,Erd,实体关系是否有标准(非图形)符号 现在我正在使用我自己的janky符号: Cardinality Syntax 0 or 1 ? exactly 1 1 0 or more * 1 or more + 用户>>照片(1-many) 用户>配置文件(1-1 hasOne) 配置文件
Cardinality Syntax
0 or 1 ?
exactly 1 1
0 or more *
1 or more +
- 用户>>照片(1-many)
- 用户>配置文件(1-1 hasOne)
- 配置文件<用户,(1-1属于STO)
- 照片为什么不使用与ER图相同的图表:
- 用户1-n照片
- 用户1-1配置文件
- 照片n-1用户
等等。但我从未听说过正式的明文标准。差不多10年后,我也很难找到明文标准。以下是我到目前为止的发现(不过这是一个很好的警告,大部分图形标准碰巧在文本中工作得很好) 首先,描述对象之间关系的基数的常用术语是“多重性” 此关联关系表示(至少)两个相关类中的一个引用另一个。这种关系通常被描述为“A有B”(母猫有小猫,小猫有母猫)
这方面似乎有一些变化:+--------------+--------+-----------------------------------------+ | Multiplicity | Option | Cardinality | +--------------+--------+-----------------------------------------+ | 0..0 | 0 | Collection must be empty | | 0..1 | | No instances or one instance | | 1..1 | 1 | Exactly one instance | | 0..* | * | Zero or more instances | | 1..* | | At least one instance | | 5..5 | 5 | Exactly 5 instances | | m..n | | At least m but no more than n instances | +--------------+--------+-----------------------------------------+
- 微软的
- Smartdraw's
有可用的软件可以将纯文本描述转换为可视ER图 例如,使用以下符号:
示例:Cardinality Syntax 0 or 1 ? exactly 1 1 0 or more * 1 or more +
也检查一下这个Person *--1 `Birth Place` Artist +--? PlatinumAlbums
但是,这些都不能称为标准。我在寻找一个标准,但我仍然很奇怪为什么没有。多对多关系的符号应该是什么?迟做总比不做强!谢谢你的回复+----------------------+-----------------+---------------------------------+-------------+-----------------+----------------------+ | (min,max) [Entity 1] | [UML, Entity 1] | Chen-Notation | MC-Notation | [UML, Entity 2] | (min,max) [Entity 2] | +----------------------+-----------------+---------------------------------+-------------+-----------------+----------------------+ | (0,1) | 0..1 | 1:1 | c:c | 0..1 | (0,1) | | (0,N) | 0..1 | 1:N | c:mc | 0..* | (0,1) | | (0,N) | 1..1 | 1:N + total participation | 1:mc | 0..* | (1,1) | | (0,N) | 0..* | M:N | mc:mc | 0..* | (0,N) | | (1,1) | 0..1 | total participation + 1:1 | c:1 | 1..1 | (0,1) | | (1,N) | 0..1 | total participation + 1:N | c:m | 1..* | (0,1) | | (1,1) | 1..1 | total part. + 1:1 + total part. | 1:1 | 1..1 | (1,1) | | (1,N) | 1..1 | total part. + 1:N + total part. | 1:m | 1..* | (1,1) | | (1,N) | 0..* | total participation + M:N | mc:m | 1..* | (0,N) | | (1,N) | 1..* | total part. + M:N + total part. | m:m | 1..* | (1,N) | +----------------------+-----------------+---------------------------------+-------------+-----------------+----------------------+
Cardinality Syntax 0 or 1 ? exactly 1 1 0 or more * 1 or more +
Person *--1 `Birth Place` Artist +--? PlatinumAlbums