Help Center> RES> API Reference> API> Data Source> Querying the Result of a Data Source Task

Querying the Result of a Data Source Task

Function

This API is used to query the result of an offline task in a specified data source, including data format, data detection, data exploration, and effect evaluation.

URI

GET /v2.0/{project_id}/workspaces/{workspace_id}/data-sources/{resource_id}/detail

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details on how to obtain the project ID, see Obtaining a Project ID.

resource_id

Yes

String

Resource ID

workspace_id

Yes

String

Workspace ID

Table 2 Query parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. For details on how to obtain the user token, see Obtaining a User Token Through Password Authentication.

type

Yes

String

Task type. The options are:

  • DATA_STRUCT indicates the data structure task.

  • DATA_INSPECTION indicates the data detection task.

  • DATA_EXPLORATION indicates the data exploration task.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Content type. The value is application/json.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

error_count

error_count object

Number of errors

data_struct

data_struct object

Data format (returned when the request type is DATA_STRUCT)

error_samples

Array of error_sample objects

Error example (returned when the request type is DATA_INSPECTION)

inspect_result

Array of inspect_result objects

Data detection result (returned when the request type is DATA_INSPECTION)

is_success

Boolean

Whether the request is successful

message

String

Response message

legal_rate

Double

Validity rate (returned when the request type is DATA_INSPECTION)

inspect_rst_generated_time

String

The generation time of detection result (returned when the request type is DATA_INSPECTION)

final_report

FinalReport object

Data exploration report (returned when the request type is DATA_EXPLORATION)

Table 5 error_count

Parameter

Type

Description

empty

Boolean

Null

Table 6 data_struct

Parameter

Type

Description

behaviors

BehaviorsConfig object

Behavior

item_attrs

Array of item_attrs objects

Item parameter

user_attrs

Array of user_attrs objects

User parameter

user_dynamic_attr

UserDynamicAttr object

Dynamic user parameter

Table 7 BehaviorsConfig

Parameter

Type

Description

positive_behaviors

Array of behaviorWeights objects

Positive behavior

negative_behaviors

Array of behaviorWeights objects

Negative behavior

Table 8 behaviorWeights

Parameter

Type

Description

behavior_type

String

Behavior type

weight

Integer

Behavior weight

other_uses

Array of strings

Other usage

Table 9 item_attrs

Parameter

Type

Description

data_type

String

Data type

name

String

Item

other_uses

Array of strings

Other usage

Table 10 user_attrs

Parameter

Type

Description

data_type

String

Data type

name

String

Username

Table 11 UserDynamicAttr

Parameter

Type

Description

user_interested_attrs

Attribute object

User interest feature

user_interested_action_type

Attribute object

User-concerned behavior type

Table 12 Attribute

Parameter

Type

Description

name

String

Name

data_type

String

Data type

other_uses

Array of strings

Other usage

Table 13 error_sample

Parameter

Type

Description

source

String

Detection source description

count

Integer

Total number of errors

msg

String

Error data and error message

Table 14 inspect_result

Parameter

Type

Description

type

String

Data type

count_num

Integer

Total number of records

multiplicity

Double

Repetition

legal_rate

Double

Validity

Table 15 FinalReport

Parameter

Type

Description

generated_time

String

Report generation time

wide_table_num

Long

Number of entries in a wide table, which is the number of deduplicated behavior data records.

user_complete_degree

Double

Completeness of user information. Whether a user has a profile when a behavior record is generated.

item_complete_degree

Double

Completeness of item information. Whether an item has a profile when a behavior record is generated.

bhv_count

Map<String,Integer>

Number of behaviors

user_long_feature_report

Array of NumFeatureReport objects

Long user feature

user_float_feature_report

Array of NumFeatureReport objects

Float user feature

user_str_feature_report

Array of StrFeatureReport objects

String user feature

user_strArray_feature_report

Array of StrFeatureReport objects

StrArray user feature

item_long_feature_report

Array of NumFeatureReport objects

Long item feature

item_float_feature_report

Array of NumFeatureReport objects

Float item feature

item_str_feature_report

Array of StrFeatureReport objects

String item feature

item_strArray_feature_report

Array of StrFeatureReport objects

StrArray item feature

Table 16 NumFeatureReport

Parameter

Type

Description

avg

Double

Mean

min

Double

Min. value

max

Double

Max. value

median

Double

Median

percents_agg

String

Percentile statistics

name

String

Feature name

data_type

String

Feature type

Table 17 StrFeatureReport

Parameter

Type

Description

name

String

Feature name

data_type

String

Feature type

str_count

Map<String,Integer>

Number of discrete feature occurrences

Example Requests

This API is used to query the result of a specified type of task.

/v2.0/testuuidxxxxxxxxxxxxxxxxxxxxxxxx/workspaces/testuuidxxxxxxxxxxxxxxxxxxxxxxxx/data-source/testuuidxxxxxxxxxxxxxxxxxxxxxxxx/detail?type=DATA_STRUCT

-

Example Responses

Status code: 200

OK

{
  "is_success" : true,
  "data_sturct" : {
    "user_attrs" : [ {
      "name" : "age",
      "data_type" : "long",
      "modify_able" : false
    }, {
      "name" : "extend_float",
      "data_type" : "float",
      "modify_able" : false
    }, {
      "name" : "extend_long",
      "data_type" : "long",
      "modify_able" : false
    }, {
      "name" : "extend_strArray",
      "data_type" : "strArray",
      "modify_able" : false
    }, {
      "name" : "extend_string",
      "data_type" : "string",
      "modify_able" : false
    }, {
      "name" : "gender",
      "data_type" : "string",
      "modify_able" : false
    }, {
      "name" : "location",
      "data_type" : "location",
      "modify_able" : false
    }, {
      "name" : "tags",
      "data_type" : "strArray",
      "modify_able" : false
    }, {
      "name" : "userId",
      "data_type" : "string",
      "modify_able" : false
    } ],
    "item_attrs" : [ {
      "name" : "author",
      "data_type" : "strArray",
      "modify_able" : false
    }, {
      "name" : "category",
      "data_type" : "string",
      "modify_able" : false
    }, {
      "name" : "expireTime",
      "data_type" : "long",
      "modify_able" : false
    }, {
      "name" : "extend_float",
      "data_type" : "float",
      "modify_able" : false
    }, {
      "name" : "extend_long",
      "data_type" : "long",
      "modify_able" : false
    }, {
      "name" : "extend_strArray",
      "data_type" : "strArray",
      "modify_able" : false
    }, {
      "name" : "extend_string",
      "data_type" : "string",
      "modify_able" : false
    }, {
      "name" : "itemId",
      "data_type" : "string",
      "modify_able" : false
    }, {
      "name" : "itemType",
      "data_type" : "string",
      "modify_able" : false
    }, {
      "name" : "location",
      "data_type" : "location",
      "modify_able" : false
    }, {
      "name" : "publishTime",
      "data_type" : "long",
      "modify_able" : false
    }, {
      "name" : "score",
      "data_type" : "long",
      "modify_able" : false
    }, {
      "name" : "status",
      "data_type" : "long",
      "modify_able" : false
    }, {
      "name" : "tags",
      "data_type" : "strArray",
      "modify_able" : false
    } ],
    "behaviors" : {
      "positive_behaviors" : [ {
        "behavior_type" : "click",
        "weight" : 0.3
      }, {
        "behavior_type" : "like",
        "weight" : 0.8
      } ],
      "negative_behaviors" : [ {
        "behavior_type" : "view",
        "weight" : 0.1
      }, {
        "behavior_type" : "dislike",
        "weight" : 0.8
      } ]
    }
  }
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.