Skip to content

Commit

Permalink
Merge pull request #140 from RADAR-base/release-0.4.0
Browse files Browse the repository at this point in the history
Release 0.4.0
  • Loading branch information
blootsvoets committed Aug 30, 2018
2 parents 2ff182d + f1bc125 commit 2d98fc7
Show file tree
Hide file tree
Showing 81 changed files with 317 additions and 1,379 deletions.
11 changes: 5 additions & 6 deletions commons/connector/fitbit/fitbit_intraday_heart_rate.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
"type": "record",
"name": "FitbitIntradayHeartRate",
"doc": "Intra day heart rate data from fitbit device.",
"fields": [
{ "name": "time", "type": "double", "doc": "Device timestamp in UTC (s)." },
{ "name": "timeReceived", "type": "double", "doc": "Time that the data was received from the Fitbit API (seconds since the Unix Epoch)." },
{ "name": "timeInterval", "type": "int", "doc": "Chronological window size (s)." },
{ "name": "timezoneOffset", "type": "int", "doc": "Offset from UTC (s)." },
{ "name": "heartRate", "type": "int", "doc":"Heart rate value (bpm)."}
"fields": [
{ "name": "time", "type": "double", "doc": "Device timestamp in UTC (s)." },
{ "name": "timeReceived", "type": "double", "doc": "Time that the data was received from the Fitbit API (seconds since the Unix Epoch)." },
{ "name": "timeInterval", "type": "int", "doc": "Chronological window size (s)." },
{ "name": "heartRate", "type": "int", "doc": "Heart rate value (bpm)."}
]
}
11 changes: 5 additions & 6 deletions commons/connector/fitbit/fitbit_intraday_steps.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
"type": "record",
"name": "FitbitIntradaySteps",
"doc": "Intra day steps data from fitbit device.",
"fields": [
{ "name": "time", "type": "double", "doc": "Device timestamp in UTC (s)." },
{ "name": "timeReceived", "type": "double", "doc": "Time that the data was received from the Fitbit API (seconds since the Unix Epoch)." },
{ "name": "timeInterval", "type": "int", "doc": "Chronological window size (s)." },
{ "name": "timezoneOffset", "type": "int", "doc": "Offset from UTC (s)." },
{ "name": "steps", "type": "int", "doc":"Steps taken in this period."}
"fields": [
{ "name": "time", "type": "double", "doc": "Device timestamp in UTC (s)." },
{ "name": "timeReceived", "type": "double", "doc": "Time that the data was received from the Fitbit API (seconds since the Unix Epoch)." },
{ "name": "timeInterval", "type": "int", "doc": "Chronological window size (s)." },
{ "name": "steps", "type": "int", "doc": "Steps taken in this period."}
]
}
14 changes: 14 additions & 0 deletions commons/connector/fitbit/fitbit_sleep_classic.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"namespace": "org.radarcns.connector.fitbit",
"type": "record",
"name": "FitbitSleepClassic",
"doc": "Classic sleep data as defined at https://dev.fitbit.com/build/reference/web-api/sleep/. This is generally returned for devices without a heart rate sensor. Deduce absolute times using the timezone at the time of the measurement.",
"fields": [
{ "name": "dateTime", "type": "string", "doc": "ISO 6801 formatted local date time of device (yyyy-MM-ddTHH:mm:ss)." },
{ "name": "timeReceived", "type": "double", "doc": "Time that the data was received from the Fitbit API (seconds since the Unix Epoch)." },
{ "name": "duration", "type": "int", "doc": "Duration at this sleep characteristic in seconds." },
{ "name": "level", "type":
{ "name": "FitbitSleepClassicLevel", "type": "enum", "symbols": ["AWAKE", "RESTLESS", "ASLEEP", "UNKNOWN"], "doc": "Level of sleep as computed by Fitbit."},
"doc": "Level of sleep as computed by Fitbit.", "default": "UNKNOWN" }
]
}
13 changes: 0 additions & 13 deletions commons/connector/fitbit/fitbit_sleep_pattern.avsc

This file was deleted.

9 changes: 5 additions & 4 deletions commons/connector/fitbit/fitbit_sleep_stage.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
"name": "FitbitSleepStage",
"doc": "Fitbit 'stages' sleep data as defined at https://dev.fitbit.com/build/reference/web-api/sleep/.",
"fields": [
{ "name": "time", "type": "double", "doc": "Device timestamp in UTC (s)." },
{ "name": "dateTime", "type": "string", "doc": "ISO 6801 formatted local date time of device (yyyy-MM-ddTHH:mm:ss)." },
{ "name": "timeReceived", "type": "double", "doc": "Time that the data was received from the Fitbit API (seconds since the Unix Epoch)." },
{ "name": "level", "type": "string", "doc": "Level of sleep, 'deep', 'light', 'rem', or 'awake'." },
{ "name": "timezoneOffset", "type": "int", "doc": "Offset from UTC (s)." },
{ "name": "sleepDuration", "type": "int", "doc":"Duration at this sleep characteristic in seconds." }
{ "name": "duration", "type": "int", "doc": "Duration at this sleep characteristic in seconds." },
{ "name": "level", "type":
{"name": "FitbitSleepStageLevel", "type": "enum", "symbols": ["DEEP", "LIGHT", "REM", "AWAKE", "UNKNOWN"], "doc": "Level of sleep as computed by Fitbit."},
"doc": "Level of sleep as computed by Fitbit.", "default": "UNKNOWN" }
]
}
10 changes: 10 additions & 0 deletions commons/connector/fitbit/fitbit_time_zone.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"namespace": "org.radarcns.connector.fitbit",
"type": "record",
"name": "FitbitTimeZone",
"doc": "Fitbit profile time zone at the current time. This can be used to estimate the UTC time for the Sleep API.",
"fields": [
{ "name": "timeReceived", "type": "double", "doc": "Time that the data was received from the Fitbit API (seconds since the Unix Epoch)." },
{ "name": "timeZoneOffset", "type": ["null", "int"], "doc": "Offset from UTC (s). If unknown, this is null.", "default": null }
]
}
14 changes: 14 additions & 0 deletions commons/kafka/record_set.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"namespace": "org.radarcns.kafka",
"name": "RecordSet",
"type": "record",
"doc": "Abbreviated record set, meant for binary data transfers of larger sets of data. It can contain just a source ID and the record values. The record keys are deduced from authentication parameters. This method of data transfer requires that the data actually adheres to the schemas identified by the schema version.",
"fields": [
{"name": "keySchemaVersion", "type": "int", "doc": "Key schema version for the given topic."},
{"name": "valueSchemaVersion", "type": "int", "doc": "Value schema version for the given topic."},
{"name": "projectId", "type": ["null", "string"], "doc": "Project ID of the sent data. If null, it is attempted to be deduced from the credentials.", "default": null},
{"name": "userId", "type": ["null", "string"], "doc": "User ID of the sent data. If null, it is attempted to be deduced from the credentials.", "default": null},
{"name": "sourceId", "type": "string", "doc": "Source ID of the sent data."},
{"name": "data", "type": {"type": "array", "items": "bytes", "doc": "Binary serialized Avro records."}, "doc": "Collected data. This should just contain the value records."}
]
}
22 changes: 6 additions & 16 deletions java-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@ repositories {
dependencies {
// Commons schemas (backend, passive remote monitoring app)
compile 'org.radarcns:radar-schemas-commons:0.3.6'
// REST API schemas (REST API, testing)
compile 'org.radarcns:radar-schemas-restapi:0.3.6'
compile 'org.radarcns:radar-schemas-commons:0.4.0'
// Questionnaire schemas (active remote monitoring app)
compile 'org.radarcns:radar-schemas-tools:0.3.6'
compile 'org.radarcns:radar-schemas-tools:0.4.0'
}
```
Usually, you only need to include the schemas you actually need in your dependencies.
Expand All @@ -24,20 +21,13 @@ The generated code each refers to a single schema. The classes of Avro records w

```java
public class Deserialize {
public static void main(String args[]) throws Exception {
public PhoneBatteryLevel deserializeBatteryLevel(InputStream json) throws Exception {
//Instantiating the Schema.Parser class.
DatumReader<PhoneBatteryLevel> datumReader = new SpecificDatumReader<>(PhoneBatteryLevel.class);
DataFileReader<PhoneBatteryLevel> dataFileReader = new DataFileReader<>(new File("/path/to/mydata.avro"), datumReader);

System.out.println("Reading phone battery levels");
PhoneBatteryLevel batteryLevel = null;
while (dataFileReader.hasNext()) {
batteryLevel = dataFileReader.next(batteryLevel);
System.out.println("Phone battery level: " + batteryLevel);
}
System.out.println("Done");
Decoder decoder = new DecoderFactory().jsonDecoder(PhoneBatteryLevel.getClassSchema(), outputStream);
return datumReader.read(null, decoder);
}
}
```

Alternatively, use `org.radarcns.data.SpecificRecordEncoder` and `org.radarcns.data.SpecificRecordDecoder` from the `radar-commons` package.
Alternatively, use `org.radarcns.data.SpecificRecordEncoder` and `org.radarcns.data.SpecificRecordDecoder` from the [`radar-commons`](https://github.com/RADAR-base/radar-commons) package.
24 changes: 6 additions & 18 deletions 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.6'
version = '0.4.0'
group = 'org.radarcns'
ext.githubRepoName = 'RADAR-base/RADAR-Schemas'

Expand Down Expand Up @@ -56,37 +56,25 @@ subprojects {
}
}
developers {
developer {
id 'herkulano'
name 'Herculano Campos'
email 'herculano@goldenarm.com'
organization 'Golden Arm Inc.'
}
developer {
id 'fnobilia'
name 'Francesco Nobilia'
email 'francesco.nobilia@kcl.ac.uk'
organization 'King\'s College London'
}
developer {
id 'blootsvoets'
name 'Joris Borgdorff'
email 'joris@thehyve.nl'
organization 'The Hyve'
}
developer {
id 'strangepleasures'
name 'Pavel Mikhailovskii'
email 'pavel@thehyve.nl'
organization 'The Hyve'
id 'yatharthranjan'
name 'Yatharth Ranjan'
email 'yatharth.ranjan@kcl.ac.uk'
organization 'King\'s College London'
}
}
issueManagement {
system 'GitHub'
url issueUrl
}
organization {
name 'RADAR-CNS'
name 'RADAR-base'
url website
}
scm {
Expand Down
1 change: 0 additions & 1 deletion java-sdk/radar-schemas-restapi/.gitignore

This file was deleted.

97 changes: 0 additions & 97 deletions java-sdk/radar-schemas-restapi/build.gradle

This file was deleted.

4 changes: 3 additions & 1 deletion java-sdk/radar-schemas-tools/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ ext {
jettyVersion = '9.4.11.v20180605'
junitVersion = '4.12'
kafkaVersion = '2.0.0'
radarCommonsVersion = '0.9.0'
okHttpVersion = '3.11.0'
radarCommonsVersion = '0.10.0'
slf4jVersion = '1.7.25'
}

Expand All @@ -42,6 +43,7 @@ dependencies {
implementation (group: 'org.apache.kafka', name: 'kafka_2.12', version: kafkaVersion) {
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
}
implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: okHttpVersion
implementation group: 'org.eclipse.jetty', name: 'jetty-server', version: jettyVersion
implementation group: 'org.eclipse.jetty', name: 'jetty-servlet', version: jettyVersion
implementation group: 'org.glassfish.jersey.core', name: 'jersey-server', version: jerseyVersion
Expand Down
Loading

0 comments on commit 2d98fc7

Please sign in to comment.