We are pleased to announce the implementation of a new data processing protocol designed to identify, classify, and exclude naps within sleep summaries (sleep_summary). This update ensures that key metrics, such as total sleep duration and sleep efficiency, exclusively reflect the user's primary rest period.
The challenge of sleep data
In the ecosystem of wearables and portable devices, naps often skew health metrics by overlapping with nighttime sleep. To address this, we've developed a four-stage system that standardizes data from multiple sources.
Definition of siesta for ROOK
To properly manage naps, we first need to define what a nap is. We will base this on how Oura classifies naps and primary sleep:
  • Main sleep: This is the longest and most continuous block of sleep that occurs mainly during the night.
  • Nap: Any block of sleep other than main sleep, occurring outside of regular nighttime sleep hours, have a maximum duration of 3 hours.
Identification and exclusion of naps
We use two processes to identify a nap, the first is by label and the second by definition.
  • By tag: First, it detects if the data source provides specific nap parameters, such as Fitbit (isMainSleep), Garmin (naps), Oura (type: late_nap) and Whoop (nap: true).
  • Logically: If the sleep event is less than three hours, it will be discarded as a nap.
  • Filtering based on long sessions: The system discards naps only when a main sleep session is already recorded.
Once sleep sessions are identified as "Siesta", they are discarded to ensure accuracy in the data analysis.
Benefits for the technical ecosystem
This improvement allows access to cleaner, more processed data, eliminating data noise caused by short sleep periods. By centralizing this logic in our data pipeline, we reduce the analytical workload for our clients, allowing them to focus on generating valuable insights for their end users.
Availability and validation
This functionality is directly integrated into the data delivery flow via SDK and API. Technical teams are advised to validate the information using the sleep_start_datetime_string and sleep_duration_seconds_int fields to confirm the correct classification of events.
FAQ
How do we define a nap at ROOK?
A nap is defined as any block of sleep other than the main period of rest. To be classified as such, the session must occur outside the user's usual nighttime sleep schedule and have a minimum duration maximum of 3 hours.
What is the "main dream" under this new protocol?
Main sleep is considered to be the longest and most continuous block of sleep that usually occurs during the night.
Why is it necessary to exclude naps from sleep summaries?
Naps often mix their metrics with those of nighttime sleep, skewing critical data such as total sleep duration and efficiency. The goal of this process is to refine the analysis so that the metrics exclusively reflect the user's primary rest.
How do we identify which sleep sessions are naps?
Our team uses two identification methods:
  • By tag: First, it detects if the data source provides specific nap parameters, such as Fitbit (isMainSleep), Garmin (naps), Oura (type: late_nap) and Whoop (nap: true).
  • Logically: If the sleep event is less than three hours, it will be discarded as a nap.
  • Filtering based on long sessions: The system discards naps only when a main sleep session is already recorded.
What happens if a user only sleeps two hours a day?
Following the filtering logic, if there is no previous main sleep session, the system does not discard that short block, thus avoiding misinterpretations or loss of essential sleep data.
Where is this new functionality integrated?
This update is available directly in the data pipeline and is delivered through our SDKs and APIs.