<datasource_uri>/datasets[.<format>]
Datasets resource present the set of all the datasets in a datasource. Implement POST request on datasets resource, you can create a dataset belong to <datasource_uri> datasource, including point, line, region dataset, text dataset,CAD dataset and tabular dataset, set dataset information and copy the current dataset are two ways of create a dataset.
Supported methods
Supported output formats:rjson, json, html, xml.
Implement the HTTP request on the following URI, where supermapiserver is the server name and World is a datasource on the server, and get the response in rjson format.
http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets.rjson
Get all the information about dataset in the datasource.
None.
Implement GET request on datasets resource, returns all the dataset information in the datasource, the following is the structure of the resource output format.
Name | Type | Description |
datasetCount | int | The number of datasets in the datasource. |
datasetsNames | List<String> | The name list of the dataset. |
childUriList | List<String> | List of access path of datasets (URI of the dataset resource). |
Implement the GET request on the datasource resource with http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World.rjson to get the response in rjson format, as shown below:
{
"childUriList": [
"http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/Ocean",
"http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/CountryLabel",
"http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/OceanBoundary",
"http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/ContinentBoundary",
"http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/CountryBoundary",
"http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/Lakes",
"http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/Capitals",
"http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/ContinentLabel",
"http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/Grids",
"http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/OceanLabel",
"http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/Rivers",
"http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/OceanLabelP_C",
"http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/OceanLabelP_E",
"http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/Countries",
"http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/test",
"http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/Day",
"http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/Night"
],
"datasetCount": 17,
"datasetNames": [
"Ocean",
"CountryLabel",
"OceanBoundary",
"ContinentBoundary",
"CountryBoundary",
"Lakes",
"Capitals",
"ContinentLabel",
"Grids",
"OceanLabel",
"Rivers",
"OceanLabelP_C",
"OceanLabelP_E",
"Countries",
"test",
"Day",
"Night"
]
}
create a new dataset in the datasource ,set dataset information and copy the current dataset are two ways of create a dataset.
A new dataset must be created before implement POST request, the request body must includes same parameters, SuperMap iServer will create a new dataset in the datasource on the basis of these parameters if they are valid.
Different parameters will be sent based on the methods of creating datasets, the following parameters are needed if you want to create new dataset by setting dataset names and types:
Field | Type | Definition |
datasetName | string | Dataset Name. |
datasetType | DatasetType | Dataset type, six enumeration values are supported: POINT,LINE,REGION,TEXT,CAD,TABULAR. |
The following parameters are needed if you want to create new datasets by copy datasets:
Field | Type | Definition |
srcDatasourceName | string | Source Datasource name, by default, it is the current datasource, the operation will fail if the source datasource and the current datasource are not in the same workspace. |
srcDatasetName | string | Source Dataset Name. |
destDatasetName | string | The name of the target dataset to be created. |
Note: If two kinds of parameters are all included in the POST request body, the first kind of parameters will be used to create new dataset.
Implement POST request on the datasets resource, create a new dataset, the following are the representation structure of the operation result returned.
Name | Type | Description |
succeed | boolean | Whether the dataset was created successfully. |
newResourceID | string | New field resource ID. |
newResourceLoaction | string | The URL of the new created dataset resource. |
error | HttpError | An error message. If successful, the field will be absent. |
Implement POST request with the parameters show as follows on the sample datasets resource http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets.rjson and create new dataset by setting dataset information.
{"datasetType":"POINT","datasetName":"RestCreate"}
If successfully, the response in rjson format is shown as below.
{
"newResourceID": "/name/RestCreate",
"newResourceLocation": "http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/RestCreate.rjson",
"succeed": true
}
Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content. The meta-information includes the media-type, content-encoding, transfer-encoding, content-length, etc.
HEAD request can be used to check if the TSPPaths resource exists, or if the resource can be accessed by clients. It can also determine if the TSPPaths resource supports an output format <format> if performed on a URI with .<format> included.