跳转至

Properties(属性)

A property of an object type is the schema definition of a characteristic of a real-world entity or event. A property value refers to the value of a property on an object, or a single instance of that real world entity or event.

For example, in the Ontology Manager, an Employee object type may have properties employee number, start date, and role. The notional employee “Melissa Chang” may have property values “11502” for employee number, “October 9, 2016” for start date, and “software engineer” for role.

Similarly, in the Ontology Manager, a Flight object type may have properties departure date, arrival date, and passenger count. The object “JFK → SFO 24-02-2021” may have property values “24-02-2021” for departure date, “25-02-2021” for arrival date, and “150” for passenger count.

The concepts underpinning the Ontology have analogous concepts in the structure of a dataset. The definition of a property in the Ontology is analogous to that of a column in a dataset, while the definition of a property value is analogous to that of a field in the dataset. For example, an Employee dataset may have columns for departure date, arrival date, and passenger count. In this case, a single field will have the value “11502” for the employee number column of the row for employee “Melissa Chang.”

Rather than being an abstract data model, the Foundry Ontology maps each ontological concept to an organization's actual data, enabling this data asset to power real-world applications. Property values are created and displayed in user applications by adding backing datasources to an object type in the Ontology Manager. To create property values for properties employee number, start date, and role on objects of type Employee, an organization will add backing datasources to the Employee object type and feed their employee directory and other enterprise data into the Ontology.

Supported property types

Property base type Valid as title key? Valid as primary key? Notes
Commonly used: String, Integer, Short Yes Yes
Time-based: Date, Timestamp Yes Discouraged Typically, time values are inappropriate as primary keys, due to potentially unexpected collisions / uniqueness based on the storage format differing from the display format. In most cases, we recommend using String instead.
Number-like: Boolean, Byte, Long Yes Discouraged Boolean limits your object type to two object instances. Byte properties can only be assigned in Actions via an Integer parameter, so in most cases we recommend using Integer properties instead. Long has representational issues in Javascript ↗, so not all frontend libraries and code work well with Long values greater than 1e15. In most cases, we recommend using String instead.
Float-like: Float, Double, Decimal Yes No
Vector No No
Array Yes No Array properties cannot contain null elements.
If the inner type of the Array is not a valid title property, the Array property also cannot be used as the title property.
Nested arrays are not supported in Object Storage V2.
Struct No No Struct properties do not support nesting, and fields cannot be arrays. See the struct documentation for detailed information on supported field types.
Media Reference, Time Series, Attachment No No
Geopoint Yes No
Geoshape No No
Marking No No
Cipher Yes No

To learn more about base types, see base types.


中文翻译


属性

属性(property)是对象类型的模式定义,用于描述现实世界实体或事件的特征。属性值(property value)则指对象上某个属性的具体取值,即该现实世界实体或事件的单个实例。

例如,在 Ontology Manager 中,Employee 对象类型可能包含 employee number(员工编号)、start date(入职日期)和 role(职位)等属性。假设员工 "Melissa Chang" 的属性值分别为:employee number 为 "11502",start date 为 "October 9, 2016",role 为 "software engineer"。

同样,在 Ontology Manager 中,Flight 对象类型可能包含 departure date(出发日期)、arrival date(到达日期)和 passenger count(乘客数量)等属性。对象 "JFK → SFO 24-02-2021" 的属性值可能为:departure date 为 "24-02-2021",arrival date 为 "25-02-2021",passenger count 为 "150"。

支撑 Ontology 的概念与数据集结构中的概念具有类比关系。Ontology 中属性的定义类似于数据集中的列,而属性值的定义则类似于数据集中的字段。例如,Employee 数据集可能包含 departure datearrival datepassenger count 等列。在这种情况下,员工 "Melissa Chang" 所在行的 employee number 列中,单个字段的值为 "11502"。

Foundry Ontology 并非抽象数据模型,而是将每个本体概念映射到组织的实际数据,从而使这一数据资产能够驱动实际应用。通过在 Ontology Manager 中为对象类型添加支持数据源(backing datasource),即可在用户应用中创建和显示属性值。例如,要为 Employee 类型的对象创建 employee numberstart daterole 等属性的属性值,组织需要为 Employee 对象类型添加支持数据源,并将其员工目录及其他企业数据导入 Ontology。

支持的属性类型

属性基础类型 可作为标题键? 可作为主键? 说明
常用类型:StringIntegerShort
时间类型:DateTimestamp 不推荐 时间值通常不适合作为主键,因为存储格式与显示格式的差异可能导致意外的冲突或唯一性问题。大多数情况下,建议使用 String 替代。
数值类:BooleanByteLong 不推荐 Boolean 会将对象类型限制为仅两个对象实例。Byte 属性只能通过 Integer 参数在操作(Actions)中赋值,因此大多数情况下建议使用 Integer 属性。LongJavaScript 中存在表示问题 ↗,因此并非所有前端库和代码都能良好处理大于 1e15 的 Long 值。大多数情况下,建议使用 String 替代。
浮点类:FloatDoubleDecimal
Vector
Array 数组属性不能包含空元素。
如果 Array 的内部类型不是有效的标题属性,则该 Array 属性也不能用作标题属性。
Object Storage V2 不支持嵌套数组。
Struct Struct 属性不支持嵌套,且字段不能为数组。有关支持的字段类型的详细信息,请参阅 struct 文档
Media ReferenceTime SeriesAttachment
Geopoint
Geoshape
Marking
Cipher

要了解更多关于基础类型的信息,请参阅基础类型