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-employermay be the ID of the link type defined between theEmployeeandCompanyobject 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, ordeprecated. By default, theEmployee → Employerlink type will have statusexperimental. Read more about statuses. - Object types: The object types related through the link type definition. For example, the
Employee → Employerlink type will refer to theEmployeeandCompanyobject 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 → Employerhas cardinalitymanyand the Company object type has cardinalityone, since many employees are linked to a single employer. The Employee object types in link typeDirect Report ↔ Managerwill each have cardinalitymanyif 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 → Employerlink type, theEmployeeobject type may have anemployer IDproperty (the foreign key) that refers to thecompany IDproperty (primary key) of theCompanyobject 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 ↔ Managerlink type might contain pairs ofemployee numbers, for which each pair represents aDirect Report ↔ Managerlink. - 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 → Employerlink type, the display name for theEmployeeobject type isEmployeeand the display name for theCompanyobject type isEmployer. - 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 → Employerlink type, the plural display name for theEmployeeobject type isEmployeesand there is no plural display name for theCompanyobject 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 → Employerlink type isemployee, then callingCompany.employee.get()will return theEmployeeobjects linked to thoseCompanyobjects. 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
prominentside of a link type will lead applications to show this side of the link type first to users. Ahiddenside of a link type will not appear in user applications. By default, the Employee and Company sides of the link type will have visibilitiesnormal. - Type classes: Additional metadata that are interpreted by user applications. Read more about type classes.
Learn more about properties (characteristics of an object type).
中文翻译¶
元数据参考¶
在 Foundry Ontology 中,链接类型由以下元数据表示:
- ID: 链接类型的唯一标识符,主要用于在配置应用程序时引用此类型的链接。例如,
employee-employer可能是定义在Employee和Company对象类型之间的链接类型的 ID。 - RID: Foundry 中每个资源自动生成的唯一标识符。链接类型的 RID 将在平台上的错误消息中被引用。
- 状态(Status): 向用户和其他 Ontology 构建者提示链接类型在开发流程中所处阶段的信号。状态可以是
active(活跃)、experimental(实验性)或deprecated(已弃用)。默认情况下,Employee → Employer链接类型的状态为experimental。了解更多关于状态的信息。 - 对象类型(Object types): 通过链接类型定义关联的对象类型。例如,
Employee → Employer链接类型将引用Employee和Company对象类型。 - 基数(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对象类型的显示名称为Employee,Company对象类型的显示名称为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): 由用户应用程序解释的附加元数据。了解更多关于类型类的信息。