1. Introduction
Sensor observations, positioning data, measurements, mobility information... are commonly published as Time Series data with a timestamp and a value. Representing Time Series data in RDF drastically raises the verbosity, as each data point is often given its own identifier, for which contextual information is repeated on all data points. With Time Series Snippets, we allow a data publisher to compact the data points in subsets of a Time Series, called the Snippet with JSON objects, allowing to re-use existing tooling for analyzing time series. This way, you can greatly reduce the amount of triples when describing a Time Series.
Time Series Snippets use the following prefix and namespace:
@prefix tss: <https://w3id.org/tss#> ;
A first example illustrates the features of a tss:Snippet
:
<snippet/2026-01-01> a tss : Snippet ; tss : points """[ { "time": "2026-01-01T06:00:00Z", "value": "5.4", "id": "https://example.org/0"}, { "time": "2026-01-01T06:59:59Z", "value": "5.2", "id": "https://example.org/1"}, { "time": "2026-01-01T08:00:00Z", "value": "5.2", "id": "https://example.org/2"}, { "time": "2026-01-01T09:00:00Z", "value": "6.1", "id": "https://example.org/3"} ]"""^^rdf:JSON; tss:from "2026-01-01T00:00:00Z"^^xsd:dateTime; tss:until "2026-01-02T00:00:00Z"^^xsd:dateTime; tss:pointType sosa:Observation; tss:context """ "@context":{ "id": "@id", "time": { "@id":"http://www.w3.org/ns/sosa/resultTime", "@type":"http://www.w3.org/2001/XMLSchema#dateTime" }, "value": { "@id": "http://www.w3.org/ns/sosa/resultTime", "@type":"http://www.w3.org/2001/XMLSchema#integer" } } """ ^^ rdf : JSON ; tss : about [ a tss : PointTemplate ; sosa : madeBySensor <temp_sensor_1> ; sosa : observedProperty <temperature> ; ]; .
The intention of Time Series Snippets is to be a lossless format as, if needed, it can be expanded again. Example 1 for example can be expanded to this RDF dataset:
<https://example.org/0> a sosa : Observation ; sosa : madeBySensor <temp_sensor_1> ; sosa : hasSimpleResult "5.4" ^^ xsd : double ; sosa : observedProperty <temperature> ; sosa : resultTime "2026-01-01T06:00:00Z" ^^ xsd : dateTime . <https://example.org/1> a sosa : Observation ; sosa : madeBySensor <temp_sensor_1> ; sosa : hasSimpleResult "5.2" ^^ xsd : double ; sosa : observedProperty <temperature> ; sosa : resultTime "2026-01-01T06:59:59Z" ^^ xsd : dateTime . <https://example.org/2> a sosa : Observation ; sosa : madeBySensor <temp_sensor_1> ; sosa : hasSimpleResult "5.2" ^^ xsd : double ; sosa : observedProperty <temperature> ; sosa : resultTime "2026-01-01T08:00:02Z" ^^ xsd : dateTime . <https://example.org/3> a sosa : Observation ; sosa : madeBySensor <temp_sensor_1> ; sosa : hasSimpleResult "6.1" ^^ xsd : double ; sosa : observedProperty <temperature> ; sosa : resultTime "2026-01-01T09:00:00Z" ^^ xsd : dateTime .
2. Definitions
A Time Series is a set of data points ordered by timestamp, where each data point consists of a timestamp and corresponding value.
A Snippet describes a subset of a Time Series within a certain period defined by a start and end timestamp, and a description of the entity providing the data points.
A Data Point is a single point of a Time Series containing an ISO timestamp, a value with datatype, and optionally an identifier.
3. Snippet properties
Each Snippet SHOULD have the following properties:
-
tss:points
: a JSON array (datatyperdf:JSON
) of data points where each data point is a JSON object with atime
key usingxsd:dateTime
value, with avalue
key for which the value is annotated with a datatype, and optionally anid
key for which the value is an IRI for the current data point. -
tss:from
: starting timestamp (including) of the period covered bytss:points
using anxsd:dateTime
. -
tss:until
: until this timestamp (excluding) of the period covered bytss:points
using anxsd:dateTime
. -
tss:about
: contains statements the data points, defined as atss:PointTemplate
. The statements can be asserted on top of all data points intss:points
when expanding the Snippet. -
tss:pointType
: the RDF type of all data points intss:points
. -
tss:context
: JSON-LD context describing the JSON array oftss:points
.
Discuss whether these properties are required or optional. E.g., a publisher might decide to do a lossy conversion for their goal, and not include a JSON-LD context or pointType. However, we can still analyze and visualize the data without that information.
3.1. Data Points
tss:points
MUST be a JSON array with JSON objects (rdf:JSON
as datatype).
Each Data Point itself MUST be a JSON object consisting of 2 required properties and 1 optional property:
-
time
: the timestamp of the data point using anxsd:dateTime
. -
value
: the value of the data point with corresponding datatype. -
id
: the data point identifier is optionally. When set, this MUST be a named node.
"""[ { "time": "2026-01-01T06:00:00Z", "value": "5.4", "id": "https://example.org/0" }, { "time": "2026-01-01T06:59:59Z", "value": "5.2", "id": "https://example.org/1" }, { "time": "2026-01-01T08:00:00Z", "value": "5.2", "id": "https://example.org/2" }, { "time": "2026-01-01T09:00:00Z", "value": "6.1", "id": "https://example.org/3" } ]""" ^^ rdf : JSON ;
3.2. Expanding data points
When the optional JSON-LD context is provided through tss:context
, a Snippet can be expanded to a verbose RDF representation, for example using its original vocabulary as defined in the JSON-LD specification to transform JSON-LD into RDF quads. The following default JSON-LD context is used if no context is specified:
{ "@context" : { "id" : "@id" , "time" : { "@id" : "https://w3id.org/tss#time" , "@type" : "http://www.w3.org/2001/XMLSchema#dateTime" }, "value" : "https://w3id.org/tss#value" } }
The properties tss:about
and tss:pointType
will influence that process.
For each Data Point, it can be mapped as follows:
-
Use the JSON-LD process to convert the given JSON to RDF using the JSON-LD context.
-
For each entity (which may be a blank node or an IRI),
-
When
tss:pointType
is set, create a triple stating this id is ofrdf:type
the object of the pointType triple. -
When
tss:about
is set, apply the subject-based star pattern of the template, except for the type, to this entity.
-