Skip to content

Commit

Permalink
Merge pull request #114 from RADAR-base/release-0.3.2
Browse files Browse the repository at this point in the history
Release 0.3.2
  • Loading branch information
yatharthranjan authored Mar 1, 2018
2 parents ec8f710 + fcb9007 commit 71f28c3
Show file tree
Hide file tree
Showing 30 changed files with 254 additions and 2,484 deletions.
24 changes: 24 additions & 0 deletions commons/active/notification/notification.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"namespace": "org.radarcns.active.notification",
"type": "record",
"name": "Notification",
"doc": "General schema for notifications. Check the specification folder to see how the notification has been defined. For each NotificationType there is a JSON file reporting the questions set and possible answers if available.",
"fields": [
{ "name": "time", "type": "double", "doc": "Timestamp in UTC (s) when the notification is submitted to the subject." },
{ "name": "timeCompleted", "type": "double", "doc": "Timestamp in UTC (s) when subject marks the notification as complete." },
{ "name": "name", "type": "string", "doc": "Notifications names." },
{ "name": "version", "type": "string", "doc": "It reports the notification version stated in the JSON specification." },
{ "name": "answers", "type": {
"type": "array",
"items": {
"name": "Answer",
"type": "record",
"doc": "Notification answer.",
"fields": [
{ "name": "value", "type": ["int", "string", "double"], "doc": "Subject answer." },
{ "name": "startTime", "type": "double", "doc": "Timestamp in UTC (s) when the notification is shown." },
{ "name": "endTime", "type": "double", "doc": "Timestamp in UTC (s) when the notification is answered." }
]
}}, "doc": "Answers list. The answers order must follow the notification order."}
]
}
13 changes: 13 additions & 0 deletions commons/active/opensmile/open_smile_2_audio_analysis.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"namespace": "org.radarcns.active.opensmile",
"type": "record",
"name": "OpenSmile2AudioAnalysis",
"doc": "Audio data collected by aRMT app and processed using openSMILE.",
"fields": [
{"name": "time", "type": "double", "doc": "Device timestamp in UTC (s)."},
{ "name": "timeCompleted", "type": "double", "doc": "Timestamp in UTC (s) when subject completed the audio questionnaire." },
{"name": "config", "type": "string", "doc": "Contents of an OpenSMILE configuration file." },
{"name": "data", "type": ["null", "string"], "doc": "Audio features computed by openSMILE in plain text.", "default": null},
{ "name": "reciteText", "type": ["null", "string"], "doc": "Text that was supposed to be recited as part of the recording.", "default": null }
]
}
13 changes: 13 additions & 0 deletions commons/active/opensmile/open_smile_2_audio_recording.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"namespace": "org.radarcns.active.opensmile",
"name": "OpenSmile2AudioRecording",
"type": "record",
"doc": "Audio recording part of the RADAR aRMT app.",
"fields": [
{ "name": "time", "type": "double", "doc": "Device timestamp when the audio recording was started (s since the Unix Epoch)." },
{ "name": "timeCompleted", "type": "double", "doc": "Device timestamp when the audio recording was completed (s since the Unix Epoch)." },
{ "name": "mediaType", "type": "string", "doc": "Media type of the audio recording format. For example, audio/wav for a WAV recording. See https://www.iana.org/assignments/media-types/media-types.xhtml#audio for the list of standardized audio media types."},
{ "name": "data", "type": "string", "doc": "Base64 encoded contents of the recorded audio file." },
{ "name": "reciteText", "type": ["null", "string"], "doc": "Text that was supposed to be recited as part of the recording.", "default": null }
]
}
24 changes: 24 additions & 0 deletions commons/active/task/task.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"namespace": "org.radarcns.active.task",
"type": "record",
"name": "Task",
"doc": "General schema for tasks. Check the specification folder to see how the task has been defined. For each TaskType there is a JSON file reporting the tasks set and possible answers if available.",
"fields": [
{ "name": "time", "type": "double", "doc": "Timestamp in UTC (s) when the task is submitted to the subject." },
{ "name": "timeCompleted", "type": "double", "doc": "Timestamp in UTC (s) when subject marks the task as complete." },
{ "name": "name", "type": "string", "doc": "Task names." },
{ "name": "version", "type": "string", "doc": "It reports the task version stated in the JSON specification." },
{ "name": "answers", "type": {
"type": "array",
"items": {
"name": "Answer",
"type": "record",
"doc": "Task answer.",
"fields": [
{ "name": "value", "type": ["int", "string", "double"], "doc": "Subject answer." },
{ "name": "startTime", "type": "double", "doc": "Timestamp in UTC (s) when the task is shown." },
{ "name": "endTime", "type": "double", "doc": "Timestamp in UTC (s) when the task is answered." }
]
}}, "doc": "Answers list. The answers order must follow the task order."}
]
}
12 changes: 0 additions & 12 deletions commons/catalogue/radar_widget.avsc

This file was deleted.

10 changes: 10 additions & 0 deletions commons/monitor/application/application_time_zone.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"namespace": "org.radarcns.monitor.application",
"name": "ApplicationTimeZone",
"type": "record",
"doc": "Local time zone that the device is running in.",
"fields": [
{ "name": "time", "type": "double", "doc": "Device timestamp in UTC (s)." },
{ "name": "offset", "type": "int", "doc": "Offset from UTC (s)." }
]
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"namespace": "org.radarcns.passive.emotion",
"namespace": "org.radarcns.passive.bittium",
"type": "record",
"name": "EmotionFarosAcceleration",
"doc": "Data from 3-axis accelerometer sensor of a eMotion Faros device.",
"name": "BittiumFarosAcceleration",
"doc": "Data from 3-axis accelerometer sensor of a Bittium Faros device.",
"fields": [
{ "name": "time", "type": "double", "doc": "Device timestamp in UTC (s)." },
{ "name": "timeReceived", "type": "double", "doc": "Device receiver timestamp in UTC (s)." } ,
Expand Down
12 changes: 12 additions & 0 deletions commons/passive/bittium/bittium_faros_battery_level.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"namespace": "org.radarcns.passive.bittium",
"type": "record",
"name": "BittiumFarosBatteryLevel",
"doc": "Battery level of a Bittium Faros device.",
"fields": [
{ "name": "time", "type": "double", "doc": "Device timestamp in UTC (s)." },
{ "name": "timeReceived", "type": "double", "doc": "Device receiver timestamp in UTC (s)." },
{ "name": "batteryLevel", "type": "float", "doc": "Battery level from 0 to 1. Note that the battery level is a rough estimate." },
{ "name": "exact", "type": "boolean", "doc": "Whether the batteryLevel can be taken as an exact value. True if the battery level is an exact representation, false if it is just an estimate based on the battery status (CRITICAL/LOW/MEDIUM/HIGH)." }
]
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"namespace": "org.radarcns.passive.emotion",
"namespace": "org.radarcns.passive.bittium",
"type": "record",
"name": "EmotionFarosEcg",
"doc": "Data from eMotion Faros' multi-channel electrocardiography electrodes. Not all Faros models possess the same number of channels, so the second and third channels are optional.",
"name": "BittiumFarosEcg",
"doc": "Data from Bittium Faros' multi-channel electrocardiography electrodes. Not all Faros models possess the same number of channels, so the second and third channels are optional.",
"fields": [
{ "name": "time", "type": "double", "doc": "Device timestamp in UTC (s)." },
{ "name": "timeReceived", "type": "double", "doc": "Device receiver timestamp in UTC (s)." } ,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"namespace": "org.radarcns.passive.emotion",
"namespace": "org.radarcns.passive.bittium",
"type": "record",
"name": "EmotionFarosInterBeatInterval",
"doc": "Time between two successive R-peaks (RR-interval), as calculated by a eMotion Faros device from the ECG signal. You can compute the heart rate as (60 / ibi).",
"name": "BittiumFarosInterBeatInterval",
"doc": "Time between two successive R-peaks (RR-interval), as calculated by a Bittium Faros device from the ECG signal. You can compute the heart rate as (60 / ibi).",
"fields": [
{"name": "time", "type": "double", "doc": "Device timestamp in UTC (s)." },
{"name": "timeReceived", "type": "double", "doc": "Device receiver timestamp in UTC (s)." },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"namespace": "org.radarcns.passive.emotion",
"namespace": "org.radarcns.passive.bittium",
"type": "record",
"name": "EmotionFarosTemperature",
"doc": "Data from an eMotion Faros' temperature sensor.",
"name": "BittiumFarosTemperature",
"doc": "Data from an Bittium Faros' temperature sensor.",
"fields": [
{"name": "time", "type": "double", "doc": "Device timestamp in UTC (s)." },
{"name": "timeReceived", "type": "double", "doc": "Device receiver timestamp in UTC (s)." },
Expand Down
11 changes: 0 additions & 11 deletions commons/passive/emotion/emotion_faros_battery_level.avsc

This file was deleted.

6 changes: 3 additions & 3 deletions java-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ repositories {
dependencies {
// Commons schemas (backend, passive remote monitoring app)
compile 'org.radarcns:radar-schemas-commons:0.3.1'
compile 'org.radarcns:radar-schemas-commons:0.3.2'
// REST API schemas (REST API, testing)
compile 'org.radarcns:radar-schemas-restapi:0.3.1'
compile 'org.radarcns:radar-schemas-restapi:0.3.2'
// Questionnaire schemas (active remote monitoring app)
compile 'org.radarcns:radar-schemas-tools:0.3.1'
compile 'org.radarcns:radar-schemas-tools:0.3.2'
}
```
Usually, you only need to include the schemas you actually need in your dependencies.
Expand Down
2 changes: 1 addition & 1 deletion java-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ subprojects {
apply plugin: 'idea'

// Configuration
version = '0.3.1'
version = '0.3.2'
group = 'org.radarcns'
ext.githubRepoName = 'RADAR-CNS/RADAR-Schemas'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package org.radarcns.stream;

import org.radarcns.catalogue.TimeWindow;

import java.util.concurrent.TimeUnit;
import org.radarcns.catalogue.TimeWindow;

/** TimeWindow labels and window time period. */
public enum TimeWindowMetadata {
Expand Down Expand Up @@ -34,4 +33,28 @@ public long getIntervalInMilliSec() {
public String getTopicLabel(String topic) {
return topic + label;
}

/**
* Get the timewindow metadata for given TimeWindow.
* @param timeWindow time window to look up
* @return metadata or {@code null} if given TimeWindow is unknown.
*/
public static TimeWindowMetadata getMetadata(TimeWindow timeWindow) {
switch (timeWindow) {
case TEN_SECOND:
return TEN_SECOND;
case ONE_MIN:
return ONE_MIN;
case TEN_MIN:
return TEN_MIN;
case ONE_HOUR:
return ONE_HOUR;
case ONE_DAY:
return ONE_DAY;
case ONE_WEEK:
return ONE_WEEK;
default:
return null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,14 @@ private static <T> Map<String, T> initSources(ObjectReader reader, Path root, Sc
return Files.walk(baseFolder)
.filter(Files::isRegularFile)
.map(f -> {
String filename = f.getFileName().toString();
int extensionIndex = filename.lastIndexOf('.');
if (extensionIndex != -1) {
filename = filename.substring(0, extensionIndex);
}
try {
return new AbstractMap.SimpleImmutableEntry<>(
f.getFileName().toString()
.split("\\.")[0]
.toUpperCase(Locale.ENGLISH),
filename.toUpperCase(Locale.ENGLISH),
reader.<T>readValue(f.toFile()));
} catch (IOException ex) {
logger.error("Failed to load configuration {}", f, ex);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@
package org.radarcns.schema.specification.active.questionnaire;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.radarcns.schema.specification.DataTopic;

import javax.validation.constraints.NotEmpty;
import java.util.List;
import java.net.URL;
import java.util.Map;
import org.radarcns.schema.specification.DataTopic;

/**
* TODO.
Expand All @@ -31,18 +29,16 @@ public enum RadarSourceTypes {
ARMT
}

@JsonProperty @NotEmpty
private List<Question> questions;
@JsonProperty
private URL questionnaireDefinitionUrl;

public List<Question> getQuestions() {
return questions;
public URL getQuestionnaireDefinitionUrl() {
return questionnaireDefinitionUrl;
}

@Override
protected void propertiesMap(Map<String, Object> properties, boolean reduced) {
super.propertiesMap(properties, reduced);
if (!reduced) {
properties.put("questions", questions);
}
protected void propertiesMap(Map<String, Object> props, boolean reduced) {
super.propertiesMap(props, reduced);
props.put("questionnaireDefinitionUrl", questionnaireDefinitionUrl);
}
}

This file was deleted.

Loading

0 comments on commit 71f28c3

Please sign in to comment.