Data formatting
- Last UpdatedMay 13, 2026
- 2 minute read
When working with the Knowledge Graph, data is formatted in specific ways to ensure consistency and flexibility. The following is a breakdown of two types of data formatting you will encounter.
Property data
Property values are strongly typed and directly tied to the specific property implementation determined by the TypeCode. There are a total of six data types in addition to matching array representations. These types include:
-
stringValue String
-
numberValue Float
All number values are cast as a float. The different number types are:
-
Double
-
Single
-
Int32
-
Int64
-
-
enumValue String
A TypeCache Lookup finds the string representation of the enum and sets the value equal to it.
-
booleanValue Boolean
-
dateTimeValue DateTime
-
timeSpanValue TimeSpan
-
stringArrayValue [String]
-
numberArrayValue [Float]
-
enumArrayValue [String]
-
booleanArrayValue [Boolean]
-
dateTimeArrayValue [DateTime]
-
timeSpanArrayValue [TimeSpan]
Stream data
Stream data is presented in a tabular format, similar to how data is displayed in a spreadsheet or table view. This structure makes it easy to work with stream data programmatically, as the column definitions and row data are clearly separated.
Here’s how it is structured:
Columns array
-
Defines the names of the columns in the table.
-
Indicates whether each column is a "key" (a unique identifier for rows).
Columns example
"columns": [
{
"name": "Timestamp",
"type": "DateTime",
"isKey": true
},
{
"name": "Measurement",
"type": "Integer",
"isKey": false
}
]
Rows array
-
Contains the actual data points, with each row corresponding to a single entry in the table.
-
Each value in a row aligns with the columns defined in the columns array.
Rows example
"rows": [
{
"values": [
{
"stringValue": "2023-10-31T12:00:00.0000000Z",
"numberValue": null
},
{
"stringValue": "1",
"numberValue": 1.0
}
]
},
{
"values": [
{
"stringValue": "2023-10-31T12:45:00.0000000Z",
"numberValue": null
},
{
"stringValue": "3",
"numberValue": 3.0
}
]
}
]
Filtering with non-exact numbers
When filtering properties with irrational numbers (for example, π) or repeating decimals, exact equality filters (eq) may not work due to limitations in binary floating-point representation. For example, a simple decimal like 3.14 might be stored as 3.140000104904175.
Recommendations
-
Prefer range filters (gt, lt, ge, le) for non-integer or high-precision values.
-
If using eq, set an appropriate tolerance (default is 10, allowing for 6 decimal places of precision).
-
Include the unit of measure (uom) in filters when applicable.
-
Use stringValue for filtering string-based properties and numberValue for numeric properties.
Example
input: {
filter: {
where: {
properties: [
{ id: "NumberProperty", numberValue: { gt: 3.13, lt: 3.15 } }
]
}
}
}