REST Resource: projects.locations.corpora.dataSchemas

Resource: DataSchema

Data schema indicates how the user specified annotation is interpreted in the system.

JSON representation
{
  "name": string,
  "key": string,
  "schemaDetails": {
    object (DataSchemaDetails)
  }
}
Fields
name

string

Resource name of the data schema in the form of: projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{dataSchema} where {dataSchema} part should be the same as the key field below.

key

string

Required. The key of this data schema. This key should be matching the key of user specified annotation and unique inside corpus. This value can be up to 63 characters, and valid characters are /[a-z][0-9]-/. The first character must be a letter, the last could be a letter or a number.

schemaDetails

object (DataSchemaDetails)

The schema details mapping to the key.

DataSchemaDetails

Data schema details indicates the data type and the data struct corresponding to the key of user specified annotation.

JSON representation
{
  "type": enum (DataType),
  "protoAnyConfig": {
    object (ProtoAnyConfig)
  },
  "listConfig": {
    object (ListConfig)
  },
  "customizedStructConfig": {
    object (CustomizedStructConfig)
  },
  "granularity": enum (Granularity),
  "searchStrategy": {
    object (SearchStrategy)
  }
}
Fields
type

enum (DataType)

Type of the annotation.

protoAnyConfig

object (ProtoAnyConfig)

Config for protobuf any type.

listConfig

object (ListConfig)

Config for List data type.

customizedStructConfig

object (CustomizedStructConfig)

Config for CustomizedStruct data type.

granularity

enum (Granularity)

The granularity associated with this DataSchema.

searchStrategy

object (SearchStrategy)

The search strategy to be applied on the key above.

DataType

Data type of the annotation.

Enums
DATA_TYPE_UNSPECIFIED Unspecified type.
INTEGER Integer type. Allowed search strategies: - DataSchema.SearchStrategy.NO_SEARCH, - DataSchema.SearchStrategy.EXACT_SEARCH. Supports query by IntRangeArray.
FLOAT Float type. Allowed search strategies: - DataSchema.SearchStrategy.NO_SEARCH, - DataSchema.SearchStrategy.EXACT_SEARCH. Supports query by FloatRangeArray.
STRING String type. Allowed search strategies: - DataSchema.SearchStrategy.NO_SEARCH, - DataSchema.SearchStrategy.EXACT_SEARCH, - DataSchema.SearchStrategy.SMART_SEARCH.
DATETIME Supported formats: %Y-%m-%dT%H:%M:%E*S%E*z (absl::RFC3339_full) %Y-%m-%dT%H:%M:%E*S %Y-%m-%dT%H:%M%E*z %Y-%m-%dT%H:%M %Y-%m-%dT%H%E*z %Y-%m-%dT%H %Y-%m-%d%E*z %Y-%m-%d %Y-%m %Y Allowed search strategies: - DataSchema.SearchStrategy.NO_SEARCH, - DataSchema.SearchStrategy.EXACT_SEARCH. Supports query by DateTimeRangeArray.
GEO_COORDINATE Geo coordinate type. Allowed search strategies: - DataSchema.SearchStrategy.NO_SEARCH, - DataSchema.SearchStrategy.EXACT_SEARCH. Supports query by GeoLocationArray.
PROTO_ANY Type to pass any proto as available in annotations.proto. Only use internally. Available proto types and its corresponding search behavior: - ImageObjectDetectionPredictionResult, allows SMART_SEARCH on displayNames and NO_SEARCH. - ClassificationPredictionResult, allows SMART_SEARCH on displayNames and NO_SEARCH. - ImageSegmentationPredictionResult, allows NO_SEARCH. - VideoActionRecognitionPredictionResult, allows SMART_SEARCH on displayName and NO_SEARCH. - VideoObjectTrackingPredictionResult, allows SMART_SEARCH on displayName and NO_SEARCH. - VideoClassificationPredictionResult, allows SMART_SEARCH on displayName and NO_SEARCH. - OccupancyCountingPredictionResult, allows EXACT_SEARCH on stats.full_frame_count.count and NO_SEARCH. - ObjectDetectionPredictionResult, allows SMART_SEARCH on identifiedBoxes.entity.label_string and NO_SEARCH.
BOOLEAN Boolean type. Allowed search strategies: - DataSchema.SearchStrategy.NO_SEARCH, - DataSchema.SearchStrategy.EXACT_SEARCH.
LIST List type. - Each element in the list must be of the exact same data schema; otherwise, they are invalid arguments. - List level cannot set search strategy. Leaf node level can do. - Elements cannot be another list (no list of list). - Elements can be CUSTOMIZED_STRUCT, and max number of layers is 10.
CUSTOMIZED_STRUCT Struct type. - SearchStrategy: * Data Schema that's CUSTOMIZED_STRUCT cannot set search strategy. * Leaf-node elements allow setting search strategy based on element's SearchStrategy restriction. - Nested layer restrictions: * Data Schema that's CUSTOMIZED_STRUCT allows its fields to be of CUSTOMIZED_STRUCT as well, but the overall layers restriction is 10.

ProtoAnyConfig

The configuration for PROTO_ANY data type.

JSON representation
{
  "typeUri": string
}
Fields
typeUri

string

The type URI of the proto message.

ListConfig

The configuration for LIST data type.

JSON representation
{
  "valueSchema": {
    object (DataSchemaDetails)
  }
}
Fields
valueSchema

object (DataSchemaDetails)

The value's data schema in the list.

CustomizedStructConfig

The configuration for CUSTOMIZED_STRUCT data type.

JSON representation
{
  "fieldSchemas": {
    string: {
      object (DataSchemaDetails)
    },
    ...
  }
}
Fields
fieldSchemas

map (key: string, value: object (DataSchemaDetails))

Direct child elements data schemas.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

Granularity

The granularity of annotations under this DataSchema.

Enums
GRANULARITY_UNSPECIFIED Unspecified granularity.
GRANULARITY_ASSET_LEVEL Asset-level granularity (annotations must not contain partition info).
GRANULARITY_PARTITION_LEVEL Partition-level granularity (annotations must contain partition info).

SearchStrategy

The search strategy for annotations value of the key.

JSON representation
{
  "searchStrategyType": enum (SearchStrategyType)
}
Fields
searchStrategyType

enum (SearchStrategyType)

The type of search strategy to be applied on the key above. The allowed searchStrategyType is different for different data types, which is documented in the DataSchemaDetails.DataType. Specifying unsupported searchStrategyType for data types will result in INVALID_ARGUMENT error.

SearchStrategyType

The types of search strategies to be applied on the annotation key.

Enums

Methods

create

Creates data schema inside corpus.

delete

Deletes data schema inside corpus.

get

Gets data schema inside corpus.

list

Lists a list of data schemas inside corpus.

patch

Updates data schema inside corpus.