Skip to content

Operations on DDCs

This document has been machine translated.

This document describes operations related to DDC.

Count the number of records prov.count_ddc_records

The following is an example of a JSON-RPC request to get the number of records in a created ddc.

{
  "jsonrpc": "2.0",
  "method": "prov.count_ddc_records",
  "params": {"ddc_label": "ddc:xrain"},
  "id": "occurrence_jsonrpc_id"
}

The format of the response is as follows

{
  "result": 440,
  "id": "prosperity_jsonrpc_id",
  "jsonrpc": "2.0"
}

Parameters.

The following parameters can be specified in params.

parameter name data type content default value
ddc_label string DDC name required

DDC existence check prov.ddc_exists

The following is an example of a JSON-RPC request to check if the specified ddc exists.

{
  "jsonrpc": "2.0",
  "method": "prov.ddc_exists",
  "params": {"ddc_label": "ddc:xrain"},
  "id": "occurrence_jsonrpc_id"
}

The format of the response is as follows

{
  "result": true,
  "id": "prosperity_jsonrpc_id",
  "jsonrpc": "2.0"
}

Parameters.

The following parameters can be specified in params.

parameter name data type content default value
ddc_label string DDC name required

Get column information prov.get_ddc_columns

The following is an example of a JSON-RPC request to retrieve column information for a specified ddc.

{
  "jsonrpc": "2.0",
  "method": "prov.get_ddc_columns",
  "params": {"ddc_label": "ddc:xrain"},
  "id": "occurrence_jsonrpc_id"
}

The format of the response is as follows

{
  "result": [{
  "column_name": "start_datetime",
  "data_type": "timestamp with time zone",
  "nullable": false, "attnum": 1
}, {
  "column_name": "end_datetime",
  "data_type": "timestamp with time zone",
  "nullable": false, "attnum": 2
}, {
  "column_name": "location",
  "data_type": "geometry",
  "nullable": false, "attnum": 3
}, {
  "column_name": "rain_map",
  "data_type": "raster",
  "nullable": false, "attnum": 4
}],
  "id": "prosperity_jsonrpc_id",
  "jsonrpc": "2.0"
}

Parameters

The following parameters can be specified in params.

parameter name data type content default value
ddc_label string DDC name required

Get DDC metadata prov.resolve_ddc

The following is an example of a JSON-RPC request to retrieve the metadata for a specified ddc.

{
  "jsonrpc": "2.0",
  "method": "prov.resolve_ddc",
  "params": {"ddc_label": "ddc:xrain"},
  "id": "occurrence_jsonrpc_id"
}

The format of the response is as follows

{
  "result": {
  "id": 1002,
  "session_id": 43,
  "usename": "xuser",
  "ddc_type": "link",
  "short_form": "xrain",
  "long_form": "xrain_1611407057.670942",
  "realname": "public.event_xrain_clipped",
  "created_at": "2021-10-09 23:32:09.693272+09",
  "committed_at": "2021-10-09 23:32:10.39546+09",
  "prepared_activity_id": null
  },
  "id": "occurrence_jsonrpc_id",
  "jsonrpc": "2.0"
}

Parameters

The following parameters can be specified in params.

parameter name data type content default value
ddc_label string DDC name required

Open API process execution prov.process

The following is an example of a JSON-RPC request to run the Open API on a specified ddc. The aggregate_geometry_table is used as an example.

Please refer to the reference for each process of Open API.

{
  "jsonrpc": "2.0",
  "method": "prov.process",
  "params": {
    "method": "aggregate_geometry_table",
    "params": {
        "output_ddc": "ddc:agg_domingo",
        "input_ddc": "ddc:domainingo",
        "start_datetime": "2021-10-15 10:09:30+09:00",
        "end_datetime": "2021-10-15 10:30:30+09:00",
        "spatial_extent": "{\"type":\"Polygon\",\"coordinates":[[[139.25,35.25],[139.25,35.5],[139.625,35.5],[139.625,35.25],[139.25,35.25]]]}",
        "continuous_column_names": ["fld"],
        "discrete_column_names": [],
        "no_exec": true,
    },
  },
  "id": "occurrence_jsonrpc_id"
}

The format of the response is as follows

{
  "result": {
    "id": 1175,
    "session_id": 37,
    "usename": "test_user",
    "ddc_type": "table",
    "short_form": "agg_domingo",
    "long_form": "agg_domingo_1635548980.90725",
    "realname": "provenance.prov_ac5b5195430963ee5f5e0eab25a957e9",
    "created_at": "2021-10-15T10:09:40.123456+09:00",
    "committed_at": null,
    "prepared_activity_id": 1204
  },
  "id": "occurrence_jsonrpc_id",
  "jsonrpc": "2.0"
}

Parameters

Note that there are more params in params as JSON-RPC.

parameter name data type content default value
method string name of the open API method you want to execute required
params object parameter for the method of the open API to be executed required

Get the processing history of a DDC prov.get_ddc_activities, prov.get_ddc_last_activity

The following is an example of a JSON-RPC request to get the processing history of a specified ddc.

{
  "jsonrpc": "2.0",
  "method": "prov.get_ddc_activities",
  "params": {"ddc_label": "ddc:xrain"},
  "id": "occurrence_jsonrpc_id"
}

The format of the response is as follows

{
  "result": [{
  "context": "set_ddc('ddc:xrain','event_xrain_clipped','{NULL}','true','link',NULL)",
  "end_at": "2021-10-09 23:33:09.693272+09",
  "id": 1070,
  "input_ddc_list": null,
  "output_ddc": "xrain_1611407057.670942",
  "query": "",
  "relation_size": 65708032,
  "report": "",
  "start_at": "2021-10-09 23:32:10.39546+09",
  "successed": true
}],
  "id": "prosperity_jsonrpc_id",
  "jsonrpc": "2.0"
}

If you want to get only the last activity, run get_ddc_last_activity.

{
  "jsonrpc": "2.0",
  "method": "prov.get_ddc_last_activity",
  "params": {"ddc_label": "ddc:xrain"},
  "id": "occurrence_jsonrpc_id"
}
{
  "result": {
  "context": "set_ddc('ddc:xrain','event_xrain_clipped','{NULL}','true','link',NULL)",
  "end_at": "2021-10-09 23:33:09.693272+09",
  "id": 1070,
  "input_ddc_list": null,
  "output_ddc": "xrain_1611407057.670942",
  "query": "",
  "relation_size": 65708032,
  "report": "",
  "start_at": "2021-10-09 23:32:10.39546+09",
  "successed": true
},
  "id": "occurrence_jsonrpc_id",
  "jsonrpc": "2.0"
}

Parameters.

The following parameters are specified in params of prov.get_ddc_activities and prov.get_ddc_last_activity.

parameter name data type content default value
ddc_label string DDC name required

Get the execution status of the DDC prov.ddc_processing_status

The following is an example of a JSON-RPC request to get the processing execution status of a specified ddc.

{
  "jsonrpc": "2.0",
  "method": "prov.ddc_processing_status",
  "params": {"ddc_label": "ddc:xrain"},
  "id": "occurrence_jsonrpc_id"
}

The format of the response is as follows.

Parameters.

The following parameters can be specified for params.

parameter name data type content default value
ddc_label string DDC name required