foundryts.objects.FoundryObject¶
class foundryts.objects.FoundryObject(object_type_id, object_primary_key)¶
An object in the Ontology.
- Parameters:
- object_type_id (str) – ID of the object type in the Ontology.
- object_primary_key (str) – The primary key of the object which can be found either in the dataset defining the object or in the ↗ Object Explorer.
:::callout{theme="warning" title="Note"}
A FoundryObject should only be created using Object.id() which provides safeguards for
accessing objects in the Ontology. Refer to examples below.
:::
Examples¶
>>> aircraft_object = Object("aircraft").id("aircraft-1l)
property(property_id, dataframe_identifier=None)¶
Creates a time series reference using the Time Series Property of the FoundryObject.
This reference can be used for all transformations and analysis supported by FoundryTS.
- Parameters:
- property_id (str) – The property ID used to reference a Time Series Property which can be extracted from the ↗ Property editor view in the Ontology Manager.
- dataframe_identifier (str , optional) – The series identifier in the resulting dataframe when multiple time series are evaluated in a
foundryts.NodeCollection. This is required for accessing complex Time Series Property types such as ↗ Templates (default is the series ID in the platform). - Returns:
A time series reference as a
FunctionNodethat can be used for transformations and analysis. - Return type:
FunctionNode
:::callout{theme="warning" title="Note"}
Ensure you’re using the Property ID for property_id since there are three property references available on
the platform: property ID, property RID, API Name.
:::
Examples¶
>>> aircraft_1_altimeter_reading = (
... Object("aircraft")
... .id("aircraft-1")
... .property("altimeter_series_id")
... )
>>> aircraft_1_altimeter_reading.to_pandas()
timestamp value
0 2024-09-06 07:00:00.000 -1.185493
1 2024-09-06 07:01:30.983 0.830117
2 2024-09-06 07:03:01.966 0.115240
3 2024-09-06 07:04:32.949 0.059973
4 2024-09-06 07:06:03.932 -0.290032
.. ... ...
245 2024-09-06 13:11:30.835 2.346732
246 2024-09-06 13:13:01.818 0.891372
247 2024-09-06 13:14:32.801 0.318806
248 2024-09-06 13:16:03.784 -0.339124
249 2024-09-06 13:17:34.767 -0.879413
中文翻译¶
foundryts.objects.FoundryObject¶
class foundryts.objects.FoundryObject(object_type_id, object_primary_key)¶
本体(Ontology)中的一个对象。
:::callout{theme="warning" title="注意"}
FoundryObject 应仅通过 Object.id() 创建,该方法提供了访问本体中对象的安全保障。请参考以下示例。
:::
示例¶
>>> aircraft_object = Object("aircraft").id("aircraft-1")
property(property_id, dataframe_identifier=None)¶
使用 FoundryObject 的时间序列属性(Time Series Property)创建一个时间序列引用。
该引用可用于 FoundryTS 支持的所有转换和分析。
- 参数:
- property_id (str) – 用于引用时间序列属性的属性 ID,可从 ↗ 本体管理器中的属性编辑器视图 获取。
- dataframe_identifier (str , 可选) – 当多个时间序列在
foundryts.NodeCollection中求值时,结果数据框中的序列标识符。访问复杂时间序列属性类型(如 ↗ 模板)时需要此参数 (默认为平台中的序列 ID)。 - 返回:
一个时间序列引用,类型为
FunctionNode,可用于转换和分析。 - 返回类型:
FunctionNode
:::callout{theme="warning" title="注意"}
请确保为 property_id 使用属性 ID(Property ID),因为平台上有三种属性引用:property ID、property RID 和 API Name。
:::
示例¶
>>> aircraft_1_altimeter_reading = (
... Object("aircraft")
... .id("aircraft-1")
... .property("altimeter_series_id")
... )
>>> aircraft_1_altimeter_reading.to_pandas()
timestamp value
0 2024-09-06 07:00:00.000 -1.185493
1 2024-09-06 07:01:30.983 0.830117
2 2024-09-06 07:03:01.966 0.115240
3 2024-09-06 07:04:32.949 0.059973
4 2024-09-06 07:06:03.932 -0.290032
.. ... ...
245 2024-09-06 13:11:30.835 2.346732
246 2024-09-06 13:13:01.818 0.891372
247 2024-09-06 13:14:32.801 0.318806
248 2024-09-06 13:16:03.784 -0.339124
249 2024-09-06 13:17:34.767 -0.879413