Entity relationship 文本中的实体关系表示法

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) 配置文件

实体关系是否有标准(非图形)符号

现在我正在使用我自己的janky符号:

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”(母猫有小猫,小猫有母猫)

    尽管有相当多的资料也使用“基数”一词。 关于这个问题的不同,有一些很好的答案。我觉得这个很简洁:

    …多重性由一个较低的基数和一个较高的基数组成。基数是一个集合中有多少个元素。因此,多重性告诉您集合中允许的最小和最大成员

    UML的多重性表示法 UML在文本中运行良好

    +--------------+--------+-----------------------------------------+
    | 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

    陈式 从陈体是“原始格式”。我认为:

    IDEF1X和其他 有(NIST标准):

    IDEF1X是一种设计关系数据库的方法,其语法旨在支持开发概念模式所需的语义结构

    这似乎描述了维基百科(Wikipedia)所引用的(英文链接目前已断开,但也列出了一些其他样式的图形符号,其中一些是文本友好的

    德语还有一个比较UML、Chen、(min、max)和:


    有可用的软件可以将纯文本描述转换为可视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