// This file contains the proto messages describing a dataset type. A dataset type is akin to a protobuf message type, // and can be converted to it. edition = "2023"; package datasets.v1; import "buf/validate/validate.proto"; import "datasets/v1/well_known_types.proto"; import "google/protobuf/descriptor.proto"; import "google/protobuf/timestamp.proto"; import "tilebox/v1/id.proto"; option features.field_presence = IMPLICIT; // Field is the request representation of a dataset field. It intentionally combines only a protobuf field descriptor // with its Tilebox annotation, matching the information represented separately by AnnotatedType. message Field { // The descriptor contains the name of the field, the type, optional labels (e.g. repeated) and other information. // For built-in message and enum types, set type_name to the full name with a leading dot, e.g. `.datasets.v1.Vec3`. // For a custom enum, set TYPE_ENUM, leave type_name empty, and provide annotation.enum_values. google.protobuf.FieldDescriptorProto descriptor = 1 [(buf.validate.field).required = true]; // Documentation, source mapping, query metadata, and custom enum values for the field. FieldAnnotation annotation = 2; } // DatasetKind is an enum describing the kind of dataset. A dataset kind specifies a set of default fields, that // cannot be modified and will always be present for every DatasetMessageType of that kind. enum DatasetKind { DATASET_KIND_UNSPECIFIED = 0; // A temporal dataset is a dataset that contains a "time" field, which is a timestamp. DATASET_KIND_TEMPORAL = 1; // A spatio temporal dataset is a dataset that contains a "start_time" and "end_time" field which are timestamps // as well as a "geometry" field which is Polygon or MultiPolygon. DATASET_KIND_SPATIOTEMPORAL = 2; } // FieldRole describes a semantic display role fulfilled by a dataset field. // Thumbnail discovery is intentionally not represented here: thumbnails are assets whose STAC asset roles include // thumbnail. enum FieldRole { FIELD_ROLE_UNSPECIFIED = 0; // The primary human-readable title or name used when displaying a datapoint. FIELD_ROLE_PRIMARY_TITLE = 1; } // EnumValue is one allowed value of a custom enum. message EnumValue { // The value users ingest, query, and receive, e.g. "L1". string value = 1 [(buf.validate.field).string = { min_len: 1 max_len: 128 }]; } // FieldAnnotation contains additional information about a field in a dataset. message FieldAnnotation { string description = 1; string example_value = 2; // RFC 6901 JSON Pointer locating the field value in the source document. // This allows flattened dataset fields to be reconstructed without relying on their protobuf field names. string source_json_pointer = 3 [features.field_presence = EXPLICIT]; // Whether the field can be used in server-side filter expressions. bool queryable = 4; // Optional JSON Schema reference for this field when it corresponds to a well known schema. // For example, this may reference the canonical STAC extension schema definition for a property. // Emitted as `$ref` when advertising this field as a queryable in STAC. string json_schema_ref = 5 [features.field_presence = EXPLICIT]; // Semantic display roles fulfilled by this field. repeated FieldRole roles = 6 [ (buf.validate.field).repeated.unique = true, (buf.validate.field).repeated.items.enum = { defined_only: true not_in: [0] } ]; // Allowed values for a custom enum field. Values must be unique; leave empty for other types. // The server generates the protobuf enum names and numbers. Clients do not need to know its naming rules. // The server validates enum vocabulary changes when updating a dataset. // // In responses, entries match the enum descriptor's members in order, excluding the generated zero member. // Pair each entry with the corresponding member's number to encode and decode datapoints. List positions // are not enum numbers. The zero member is not a public value; missing fields remain distinct from zero. // Repeated enum fields are deduplicated at ingestion, preserving first-occurrence order in the stored payload. // Every element must be a declared nonzero member. // Omitted and empty repeated fields are equivalent. Queryable repeated enums support FieldArrayPredicate. repeated EnumValue enum_values = 7 [(buf.validate.field).repeated.max_items = 100]; } // DatasetType is the request representation of a dataset type, used when creating or updating a dataset. message DatasetType { // kind denotes the kind of dataset this type describes. We do not rely on the default fields to be set in our // array of fields - since that way users could circumvent those by manually sending requests not from our Console. DatasetKind kind = 1 [(buf.validate.field).enum = { defined_only: true not_in: [0] }]; // A list of fields that this dataset consists of. repeated Field fields = 2; } // AnnotatedType is the resolved representation returned on Dataset messages, including GetDataset responses. // It combines the generated protobuf descriptors with the corresponding Tilebox field annotations. message AnnotatedType { // Descriptors for the dataset's datapoint message, including its generated enums. google.protobuf.FileDescriptorSet descriptor_set = 1; // Identifies the datapoint message in descriptor_set by name, independent of file or declaration order. string type_url = 2; reserved 3; // Annotations corresponding by index to the FieldDescriptorProto entries of the message selected by type_url. // Empty annotations must be retained so this positional mapping remains stable. repeated FieldAnnotation field_annotations = 4; DatasetKind kind = 5; } // TemporalDatapoint is a single datapoint in a temporal dataset. The message is a superset of all // message types that are Temporal Datasets. message TemporalDatapoint { // The timestamp associated with each data point. google.protobuf.Timestamp time = 1; // A universally unique identifier (UUID) that uniquely identifies each data point. tilebox.v1.ID id = 2; // The time the data point was ingested into the Tilebox API. google.protobuf.Timestamp ingestion_time = 3; } // SpatioTemporalDatapoint is a single datapoint in a spatiotemporal dataset. The message is a superset of all // message types that are spatiotemporal Datasets. message SpatioTemporalDatapoint { // The timestamp associated with each data point. google.protobuf.Timestamp time = 1; // A universally unique identifier (UUID) that uniquely identifies each data point. tilebox.v1.ID id = 2; // The time the data point was ingested into the Tilebox API. google.protobuf.Timestamp ingestion_time = 3; // The geometry associated with each data point. Geometry geometry = 4; }