跳转至

Metadata reference(元数据参考)

A link type is represented in the Foundry Ontology by the following metadata:

  • ID: A unique identifier of the link type, primarily used to reference links of this type when configuring an application. For example, employee-employer may be the ID of the link type defined between the Employee and Company object types.
  • RID: An automatically generated unique identifier for every resource in Foundry. A link type’s RID will be referenced in error messages across the platform.
  • Status: A signal to users and other Ontology builders about where in the development process the link type stands. It can be active, experimental, or deprecated. By default, the Employee → Employer link type will have status experimental. Read more about statuses.
  • Object types: The object types related through the link type definition. For example, the Employee → Employer link type will refer to the Employee and Company object types.
  • Cardinality: Indicates to applications if each object type in the link type has one or many objects. For example, The Employee object type in link type Employee → Employer has cardinality many and the Company object type has cardinality one, since many employees are linked to a single employer. The Employee object types in link type Direct Report ↔ Manager will each have cardinality many if a direct report can have multiple managers and if a manager can have multiple direct reports.
  • Key: The properties or columns used to create the links.
  • In a one-to-one or in a one-to-many cardinality link type, a property of one object type (the foreign key) refers to the primary key property of the other object type. This reference between a foreign key and primary key defines the links between objects. For example, in the Employee → Employer link type, the Employee object type may have an employer ID property (the foreign key) that refers to the company ID property (primary key) of the Company object type.
  • In a many-to-many cardinality link type, a table containing pairs of primary keys defines the links between two objects. These link types require a join table to be specified, along with mapping these keys that tell applications which columns in the join table refer to the primary keys of which object types in the link type. For example, the join table backing the Direct Report ↔ Manager link type might contain pairs of employee numbers, for which each pair represents a Direct Report ↔ Manager link.
  • Display name: The name shown to anyone accessing a link of this type in user applications. Each side of a link type has a display name. A side of a link type represents the link to that object type. For example, In the Employee → Employer link type, the display name for the Employee object type is Employee and the display name for the Company object type is Employer.
  • Plural display name: The name shown to anyone accessing a link of this type with many linked object types in user applications. For example, In the Employee → Employer link type, the plural display name for the Employee object type is Employees and there is no plural display name for the Company object type, as there can only be one company per employee.
  • API name: The name used when referring to the link type programmatically in code. The API name on a side of a link type can be used to return objects of that type. For example, if the API name on the Employee side of the Employee → Employer link type is employee, then calling Company.employee.get() will return the Employee objects linked to those Company objects. Read more about API names.
  • Visibility: An indication to user applications for how prominently to display the side of the link type (referring to links to the object type on that side). A prominent side of a link type will lead applications to show this side of the link type first to users. A hidden side of a link type will not appear in user applications. By default, the Employee and Company sides of the link type will have visibilities normal.
  • Type classes: Additional metadata that are interpreted by user applications. Read more about type classes.

Learn more about creating and configuring a link type in the Ontology and about validation requirements for link type metadata.

Learn more about properties (characteristics of an object type).


中文翻译


元数据参考

在 Foundry Ontology 中,链接类型由以下元数据表示:

  • ID: 链接类型的唯一标识符,主要用于在配置应用程序时引用此类型的链接。例如,employee-employer 可能是定义在 EmployeeCompany 对象类型之间的链接类型的 ID。
  • RID: Foundry 中每个资源自动生成的唯一标识符。链接类型的 RID 将在平台上的错误消息中被引用。
  • 状态(Status): 向用户和其他 Ontology 构建者提示链接类型在开发流程中所处阶段的信号。状态可以是 active(活跃)、experimental(实验性)或 deprecated(已弃用)。默认情况下,Employee → Employer 链接类型的状态为 experimental。了解更多关于状态的信息。
  • 对象类型(Object types): 通过链接类型定义关联的对象类型。例如,Employee → Employer 链接类型将引用 EmployeeCompany 对象类型。
  • 基数(Cardinality): 向应用程序指示链接类型中每个对象类型包含一个还是多个对象。例如,在 Employee → Employer 链接类型中,Employee 对象类型的基数为 many(多),而 Company 对象类型的基数为 one(一),因为多个员工关联到同一个雇主。在 Direct Report ↔ Manager 链接类型中,如果一名下属可以有多个经理,且一名经理可以有多个下属,则两个 Employee 对象类型的基数均为 many
  • 键(Key): 用于创建链接的属性或列。
  • 在一对一或一对多基数的链接类型中,一个对象类型的属性(外键)引用另一个对象类型的主键属性。外键与主键之间的这种引用定义了对象之间的链接。例如,在 Employee → Employer 链接类型中,Employee 对象类型可能有一个 employer ID 属性(外键),引用 Company 对象类型的 company ID 属性(主键)。
  • 在多对多基数的链接类型中,一个包含主键对的表定义了两个对象之间的链接。此类链接类型需要指定一个连接表(join table),并映射这些键,以告知应用程序连接表中的哪些列引用链接类型中哪些对象类型的主键。例如,支持 Direct Report ↔ Manager 链接类型的连接表可能包含 employee numbers 对,每对代表一个 Direct Report ↔ Manager 链接。
  • 显示名称(Display name): 在用户应用程序中访问此类型链接时显示的名称。链接类型的每一侧都有一个显示名称。链接类型的一侧表示指向该对象类型的链接。例如,在 Employee → Employer 链接类型中,Employee 对象类型的显示名称为 EmployeeCompany 对象类型的显示名称为 Employer
  • 复数显示名称(Plural display name): 在用户应用程序中访问此类型链接且涉及多个链接对象类型时显示的名称。例如,在 Employee → Employer 链接类型中,Employee 对象类型的复数显示名称为 Employees,而 Company 对象类型没有复数显示名称,因为每个员工只能对应一家公司。
  • API 名称(API name): 在代码中以编程方式引用链接类型时使用的名称。链接类型某一侧的 API 名称可用于返回该类型的对象。例如,如果 Employee → Employer 链接类型中 Employee 侧的 API 名称为 employee,则调用 Company.employee.get() 将返回链接到这些 Company 对象的 Employee 对象。了解更多关于 API 名称的信息。
  • 可见性(Visibility): 向用户应用程序指示链接类型一侧(指指向该侧对象类型的链接)的显示突出程度。链接类型的 prominent(突出)侧将引导应用程序首先向用户显示该侧。链接类型的 hidden(隐藏)侧将不会出现在用户应用程序中。默认情况下,链接类型的 Employee 和 Company 侧的可见性均为 normal(正常)。
  • 类型类(Type classes): 由用户应用程序解释的附加元数据。了解更多关于类型类的信息。

了解有关在 Ontology 中创建和配置链接类型以及链接类型元数据验证要求的更多信息。

了解有关属性(对象类型的特征)的更多信息。