Skip to content

Provenance API - Operations on DDC

Note

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 obtain the number of records of a ddc that has already been created.

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

The format of the response is as follows

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

Parameters

The following parameters can be specified for params.

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

Check for DDC existence prov.ddc_exists

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

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

The format of the response is as follows

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

Parameters

The following parameters can be specified for 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 obtain column information for a specified ddc.

{
  "jsonrpc": "2.0",
  "method": "prov.get_ddc_columns",
  "params": {"ddc_label": "ddc:xrain"},
  "id": "provenance_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": "provenance_jsonrpc_id",
  "jsonrpc": "2.0"
}

Parameters

The following parameters can be specified for 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 obtain metadata for a specified ddc.

{
  "jsonrpc": "2.0",
  "method": "prov.resolve_ddc",
  "params": {"ddc_label": "ddc:xrain"},
  "id": "provenance_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": "provenance_jsonrpc_id",
  "jsonrpc": "2.0"
}

Parameters

The following parameters can be specified for params.

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

Execute Open API process prov.process

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

Please refer to the reference for each Open API process.

{
  "jsonrpc": "2.0",
  "method": "prov.process",
  "params": {
    "method": "aggregate_geometry_table",
    "params": {
        "output_ddc": "ddc:agg_domingo",
        "input_ddc": "ddc:domingo",
        "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": "provenance_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": "provenance_jsonrpc_id",
  "jsonrpc": "2.0"
}

Parameters

The following parameters are specified in params, note that there are more params in params as JSON-RPC.

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

Get DDC processing history 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": "provenance_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": "provenance_jsonrpc_id",
  "jsonrpc": "2.0"
}

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

{
  "jsonrpc": "2.0",
  "method": "prov.get_ddc_last_activity",
  "params": {"ddc_label": "ddc:xrain"},
  "id": "provenance_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": "provenance_jsonrpc_id",
  "jsonrpc": "2.0"
}

Parameters

The following parameters are specified in the 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 execution status of DDC prov.ddc_processing_status

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

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

The format of the response is as follows

{
  "result": {
  "stat": "finished",
  "message": "set_ddc('ddc:xrain','event_xrain_clipped','{NULL}','true','link',NULL)"
  },
  "id": "provenance_jsonrpc_id",
  "jsonrpc": "2.0"
}

Parameters

The following parameters can be specified for params.

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