From 8a01780cab5d759bacded21f1fd36289adf34a51 Mon Sep 17 00:00:00 2001 From: Nicholas Otto Date: Fri, 2 Aug 2024 15:53:00 -0400 Subject: [PATCH 1/9] Made survey proto updates to support data sharing agreement --- proto/src/google/ground/v1beta1/survey.proto | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/proto/src/google/ground/v1beta1/survey.proto b/proto/src/google/ground/v1beta1/survey.proto index 8c00e1030..32f1ca6f5 100644 --- a/proto/src/google/ground/v1beta1/survey.proto +++ b/proto/src/google/ground/v1beta1/survey.proto @@ -37,6 +37,18 @@ message Survey { // Required. User id of the survey owner. string owner_id = 5; + + // Properties related to sharing of survey data. + message DataSharing { + // Type of data sharing agreement. + DataSharingAgreementType type = 0; + + // Text of custom data sharing agreement terms. + string custom_text = 1; + } + + // Defines how data sharing agreement is displayed to users. + DataSharing dataSharingAgreement = 6; } // Defines a user's role in a survey. @@ -53,3 +65,15 @@ enum Role { // User may also manage the survey, update locations of interest, etc. SURVEY_ORGANIZER = 3; } + +// Defines the type of data sharing agreement the user will see. +enum DataSharingAgreementType { + // Data will only be shared with survey organizers. + PRIVATE = 0; + + // Survey organizers can share data with no constraints. + PUBLIC = 1; + + // Terms are defined by survey organizers. + CUSTOM = 2; +} From 252f8084b3c303185e0f75745691118cca304ef8 Mon Sep 17 00:00:00 2001 From: Nicholas Otto Date: Fri, 2 Aug 2024 16:05:02 -0400 Subject: [PATCH 2/9] Fixed numbering of proto fields --- proto/src/google/ground/v1beta1/survey.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proto/src/google/ground/v1beta1/survey.proto b/proto/src/google/ground/v1beta1/survey.proto index 32f1ca6f5..7cca99599 100644 --- a/proto/src/google/ground/v1beta1/survey.proto +++ b/proto/src/google/ground/v1beta1/survey.proto @@ -41,10 +41,10 @@ message Survey { // Properties related to sharing of survey data. message DataSharing { // Type of data sharing agreement. - DataSharingAgreementType type = 0; + DataSharingAgreementType type = 1; // Text of custom data sharing agreement terms. - string custom_text = 1; + string custom_text = 2; } // Defines how data sharing agreement is displayed to users. From 1a67ff7e23d9ee36c07d7d416218cfd3f5c7350f Mon Sep 17 00:00:00 2001 From: Nicholas Otto Date: Mon, 5 Aug 2024 18:50:53 -0400 Subject: [PATCH 3/9] Updated survey protos to be more explicit about data sharing consent instead of agreement --- proto/src/google/ground/v1beta1/survey.proto | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/proto/src/google/ground/v1beta1/survey.proto b/proto/src/google/ground/v1beta1/survey.proto index 7cca99599..2145f06dc 100644 --- a/proto/src/google/ground/v1beta1/survey.proto +++ b/proto/src/google/ground/v1beta1/survey.proto @@ -38,17 +38,17 @@ message Survey { // Required. User id of the survey owner. string owner_id = 5; - // Properties related to sharing of survey data. - message DataSharing { - // Type of data sharing agreement. - DataSharingAgreementType type = 1; + // Properties related to data sharing consent. + message DataSharingConsent { + // Type of data sharing consent the user will see. + DataSharingConsentType type = 1; - // Text of custom data sharing agreement terms. + // Text of custom data sharing consent terms. string custom_text = 2; } - // Defines how data sharing agreement is displayed to users. - DataSharing dataSharingAgreement = 6; + // Defines how data sharing consent agreemnent is displayed to users. + DataSharing dataSharingConsent = 6; } // Defines a user's role in a survey. @@ -66,8 +66,8 @@ enum Role { SURVEY_ORGANIZER = 3; } -// Defines the type of data sharing agreement the user will see. -enum DataSharingAgreementType { +// Defines the type of data sharing consent agreement the user will see. +enum DataSharingConsentType { // Data will only be shared with survey organizers. PRIVATE = 0; From a76fb18f5861fdbc46f39cb240be9cdf56a321db Mon Sep 17 00:00:00 2001 From: Nicholas Otto Date: Mon, 5 Aug 2024 18:53:02 -0400 Subject: [PATCH 4/9] Slight updates to consent agreement proto language --- proto/src/google/ground/v1beta1/survey.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proto/src/google/ground/v1beta1/survey.proto b/proto/src/google/ground/v1beta1/survey.proto index 2145f06dc..9e6dd0095 100644 --- a/proto/src/google/ground/v1beta1/survey.proto +++ b/proto/src/google/ground/v1beta1/survey.proto @@ -40,7 +40,7 @@ message Survey { // Properties related to data sharing consent. message DataSharingConsent { - // Type of data sharing consent the user will see. + // Type of data sharing consent agreement the user will see. DataSharingConsentType type = 1; // Text of custom data sharing consent terms. @@ -66,7 +66,7 @@ enum Role { SURVEY_ORGANIZER = 3; } -// Defines the type of data sharing consent agreement the user will see. +// Defines the type of data sharing consent agreement the user can see. enum DataSharingConsentType { // Data will only be shared with survey organizers. PRIVATE = 0; From 0c3a79b3d3a3c31640893c72917f81918311ecf4 Mon Sep 17 00:00:00 2001 From: Nicholas Otto Date: Wed, 7 Aug 2024 17:43:18 -0400 Subject: [PATCH 5/9] Cleaned up naming of survey data sharing protos and added data sharing enum to submission proto --- .../google/ground/v1beta1/submission.proto | 4 +++ proto/src/google/ground/v1beta1/survey.proto | 36 +++++++++---------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/proto/src/google/ground/v1beta1/submission.proto b/proto/src/google/ground/v1beta1/submission.proto index 1d4ef4889..6144c2ac8 100644 --- a/proto/src/google/ground/v1beta1/submission.proto +++ b/proto/src/google/ground/v1beta1/submission.proto @@ -20,6 +20,7 @@ package google.ground.v1beta1; import "google/ground/v1beta1/audit_info.proto"; import "google/ground/v1beta1/geometry.proto"; +import "google/ground/v1beta1/survey.proto"; import "google/protobuf/timestamp.proto"; option java_multiple_files = true; @@ -54,6 +55,9 @@ message Submission { // The data collector's responses to tasks in this job. repeated TaskData task_data = 8; + + // The type of terms that the user agreed to. + Survey.DataSharingTerms.Type data_sharing_consent_type = 9; } // Data provided by data collectors for a specific task and LOI. diff --git a/proto/src/google/ground/v1beta1/survey.proto b/proto/src/google/ground/v1beta1/survey.proto index 9e6dd0095..707090d6e 100644 --- a/proto/src/google/ground/v1beta1/survey.proto +++ b/proto/src/google/ground/v1beta1/survey.proto @@ -38,17 +38,29 @@ message Survey { // Required. User id of the survey owner. string owner_id = 5; - // Properties related to data sharing consent. - message DataSharingConsent { - // Type of data sharing consent agreement the user will see. - DataSharingConsentType type = 1; + // Properties related to data sharing terms. + message DataSharingTerms { + // Defines the type of data sharing terms the user will see. + enum Type { + // Data will only be shared with survey organizers. + PRIVATE = 0; + + // Survey organizers can share data with no constraints. + PUBLIC = 1; + + // Terms are defined by survey organizers. + CUSTOM = 2; + } + + // Type of data sharing consent terms the user will see. + Type type = 1; // Text of custom data sharing consent terms. string custom_text = 2; } - // Defines how data sharing consent agreemnent is displayed to users. - DataSharing dataSharingConsent = 6; + // Defines how data sharing terms are displayed users. + DataSharingTerms data_sharing_terms = 6; } // Defines a user's role in a survey. @@ -65,15 +77,3 @@ enum Role { // User may also manage the survey, update locations of interest, etc. SURVEY_ORGANIZER = 3; } - -// Defines the type of data sharing consent agreement the user can see. -enum DataSharingConsentType { - // Data will only be shared with survey organizers. - PRIVATE = 0; - - // Survey organizers can share data with no constraints. - PUBLIC = 1; - - // Terms are defined by survey organizers. - CUSTOM = 2; -} From 9f846550e35352be6161747ae33405778287e93f Mon Sep 17 00:00:00 2001 From: Nicholas Otto Date: Wed, 7 Aug 2024 17:54:17 -0400 Subject: [PATCH 6/9] Added default unspecified value for DataSharingTerms.Type --- proto/src/ground/v1beta1/survey.proto | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/proto/src/ground/v1beta1/survey.proto b/proto/src/ground/v1beta1/survey.proto index 597ee4345..1d19cd36b 100644 --- a/proto/src/ground/v1beta1/survey.proto +++ b/proto/src/ground/v1beta1/survey.proto @@ -42,14 +42,17 @@ message Survey { message DataSharingTerms { // Defines the type of data sharing terms the user will see. enum Type { + // Default value when the type is missing. + TYPE_UNSPECIFIED = 0; + // Data will only be shared with survey organizers. - PRIVATE = 0; + PRIVATE = 1; // Survey organizers can share data with no constraints. - PUBLIC = 1; + PUBLIC = 2; // Terms are defined by survey organizers. - CUSTOM = 2; + CUSTOM = 3; } // Type of data sharing consent terms the user will see. From d7fad077c77dd4c26827fc707dd26803a82d2170 Mon Sep 17 00:00:00 2001 From: Nicholas Otto Date: Wed, 7 Aug 2024 18:29:43 -0400 Subject: [PATCH 7/9] Removed data sharing consent type field from submission proto --- proto/src/ground/v1beta1/submission.proto | 4 ---- 1 file changed, 4 deletions(-) diff --git a/proto/src/ground/v1beta1/submission.proto b/proto/src/ground/v1beta1/submission.proto index 013631610..e10cea76f 100644 --- a/proto/src/ground/v1beta1/submission.proto +++ b/proto/src/ground/v1beta1/submission.proto @@ -20,7 +20,6 @@ package ground.v1beta1; import "ground/v1beta1/audit_info.proto"; import "ground/v1beta1/geometry.proto"; -import "ground/v1beta1/survey.proto"; import "google/protobuf/timestamp.proto"; option java_multiple_files = true; @@ -55,9 +54,6 @@ message Submission { // The data collector's responses to tasks in this job. repeated TaskData task_data = 8; - - // The type of terms that the user agreed to. - Survey.DataSharingTerms.Type data_sharing_consent_type = 9; } // Data provided by data collectors for a specific task and LOI. From 1f80cf8fa2ec1ed9de898f90d9c8ce9a6e6a7907 Mon Sep 17 00:00:00 2001 From: Gino Miceli <228050+gino-m@users.noreply.github.com> Date: Thu, 8 Aug 2024 12:03:42 -0400 Subject: [PATCH 8/9] Update proto docs --- proto/src/ground/v1beta1/survey.proto | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/proto/src/ground/v1beta1/survey.proto b/proto/src/ground/v1beta1/survey.proto index 1d19cd36b..292b04781 100644 --- a/proto/src/ground/v1beta1/survey.proto +++ b/proto/src/ground/v1beta1/survey.proto @@ -38,7 +38,8 @@ message Survey { // Required. User id of the survey owner. string owner_id = 5; - // Properties related to data sharing terms. + // Defines the terms data collectors must agree to before + // collecting data. message DataSharingTerms { // Defines the type of data sharing terms the user will see. enum Type { @@ -55,14 +56,17 @@ message Survey { CUSTOM = 3; } - // Type of data sharing consent terms the user will see. + // Required. Type of data sharing terms the data collectors must + // agree to before collecting data. Type type = 1; - // Text of custom data sharing consent terms. + // If type is CUSTOM, this field contains the custom data sharing + // terms text specified by the survey organizer. string custom_text = 2; } - // Defines how data sharing terms are displayed users. + // Defines the terms data collectors must agree to before + // collecting data. DataSharingTerms data_sharing_terms = 6; } From b473cd35ba15111c6ef1b39a2a3658382e464dac Mon Sep 17 00:00:00 2001 From: Gino Miceli <228050+gino-m@users.noreply.github.com> Date: Thu, 8 Aug 2024 12:05:27 -0400 Subject: [PATCH 9/9] More proto doc --- proto/src/ground/v1beta1/survey.proto | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/proto/src/ground/v1beta1/survey.proto b/proto/src/ground/v1beta1/survey.proto index 292b04781..2a0292a3b 100644 --- a/proto/src/ground/v1beta1/survey.proto +++ b/proto/src/ground/v1beta1/survey.proto @@ -49,8 +49,10 @@ message Survey { // Data will only be shared with survey organizers. PRIVATE = 1; - // Survey organizers can share data with no constraints. - PUBLIC = 2; + // Data can be made public with no constraints. Data + // collectors waive all rights to collected data, making + // it available under the CC0 "No Rights Reserved" license. + PUBLIC_CC0 = 2; // Terms are defined by survey organizers. CUSTOM = 3;