APIs for time series data

Each LinkedFactory instance provides a set of REST-APIs for working with items and associated time series data.

values

Endpoint for ingesting and querying of time series data.

properties

Endpoint for reading the known properties of a single item.

descendants

Endpoint for reading the descendants of a single item

The values endpoint

This is the main entry point for working with time series data.

Insert data

Data can be ingested by using POST requests with content-type application/json to the endpoint values.

Query data

Data can be queried by issueing a GET request to the endpoint /linkedfactory/values with the required parameter item which specifies the subject of time series data.

An example would be GET values?item=http://example.org/resource1 that returns a JSON document like:

{
    "http://example.org/resource1": {
       "http://example.org/properties/p1": [
           { "value": 20.4, "time": 1619424246120 },
           { "value": 20.3, "time": 1619424246100 }
       ],
       "http://example.org/properties/p2": [
           { "value": { "msg" : "Error 1", "nr" : 1 }, "time": 1619424246100 }
       ]
    }
}
The returned data is sorted descending by time. That means a GET request with limit=1 always returns the latest value.
Table 1. Parameters for a GET request
Parameter Description Example

item (required)

One ore more subject of the time series data. This is a space separated list.

http://example.org/resource1 or http://example.org/resource1 http://example.org/resource2

property

One ore more properties whose values should be returned. This is a space separated list.

http://example.org/property1 or http://example.org/property1 http://example.org/property2

limit

Maximum number of values for each property.

5

to

The last timestap in milliseconds (inclusive)

1619424246120

from

The first timestap in milliseconds (inclusive)

1619424246100

op

Aggregation operator for the data values. One of: min, max, avg, sum

avg

interval

Used in conjunction with op and specifies the grouping interval for the aggregation operation in milliseconds.

1000

The properties endpoint

This endpoint allows to query the known properties of an item.

Table 2. Parameters for a GET request
Parameter Description Example

item (required)

The item for which the properties should be returned.

http://example.org/resource1

An example would be GET properties?item=http://example.org/resource1 that returns a JSON document like:

[{
    "@id": "http://example.org/properties/p1"
}, {
    "@id": "http://example.org/properties/p2"
}]

The ** endpoint

This endpoint returns the known descendants of an item. It can be used as an entry point to traverse the items of a LinkedFactory instance.

What is considered a descendant of another item is specific to the data model of an instance. The hierarchy may be established by the URLs path structure, where resource1/component1 is a descendant of resource1, or via other means like OPC UA defined relationships.

Table 3. Parameters for a GET request
Parameter Description Example

item

The item for which the descendants should be returned.

http://example.org/resource1. If item is not specified then all items are returned.

An example would be GET **?item=http://example.org/resource1 that returns a JSON document like:

[{
    "@id": "http://example.org/resource1/component1"
}, {
    "@id": "http://example.org/resource1/component2"
}, {
    "@id": "http://example.org/resource1/component2/sub-component1"
}]