النسخة التجريبية |
النسخة التجريبية |
One way to access the Data Portal is to use the REST API. Most of the portal core functionalities are available through the application programming interface (API), which encompasses most of what you can do with the web interface. The information retrieved can then be used by an external code to transform, update or reference and provide new input for further calls to the API.
Open Data Portal is based on DKAN Open Data Platform, which includes a number of APIs to allow it to communicate with external applications. DKAN comes with three API’s:
These can be queried to discover metadata associated with the catalog or a specific dataset. It can also be harvested by other portals by complying with the API standard data.json.
The DKAN Dataset REST API uses the Services module to create CRUD endpoint at api/dataset/node. By default, this endpoint provides full CRUD access to a website’s content nodes, and limited access to users (to allow authentication). Most common operations on datasets and resources are retrieving, creating, updating and deleting specific node or adding a file to resource. Node is the most basic data structure in DKAN and can be access in /api/dataset/node/{nid}.
GET http://docker:32774/api/dataset/node/75 Accept: application/json X-CSRF-Token: XBWI44XD33XBIANLpyK-rtvRa0N5OcaC03qLx0VQsP4 Cookie: SESSd14344a17ca11d13bda8baf612c0efa5=OBoeXKMQx3zmaZrS_v3FOP7_Ze66fYA61TGhtm9s0Qk
{ "body": [], "changed": "1492544349", "comment": "0", "created": "1492544348", "data": "b:0;", "field_additional_info": [], "field_author": [], "field_conforms_to": [], "field_contact_email": [], "field_contact_name": [], "field_data_dictionary": [], "field_data_dictionary_type": [], "field_frequency": [], "field_granularity": [], "field_harvest_source_ref": [], "field_is_part_of": [], "field_landing_page": [], "field_language": [], "field_license": { "und": [ { "format": null, "safe_value": "notspecified", "value": "notspecified" } ] }, "field_modified_source_date": [], "field_orphan": { "und": [ { "value": "0" } ] }, "field_pod_theme": [], "field_public_access_level": { "und": [ { "value": "public" } ] }, "field_related_content": [], "field_resources": { "und": [ { "target_id": "76" } ] }, "field_rights": [], "field_spatial": [], "field_spatial_geographical_cover": [], "field_tags": [], "field_temporal_coverage": [], "field_topic": [], "language": "und", "log": "", "name": "admin", "nid": "75", "og_group_ref": [], "path": "http://docker:32774/dataset/test-dataset-16", "picture": "0", "promote": "0", "revision_timestamp": "1492544349", "revision_uid": "1", "status": "1", "sticky": "0", "title": "Test Dataset", "tnid": "0", "translate": "0", "type": "dataset", "uid": "1", "uuid": "d53881b3-d80f-49c2-8815-897321fe926e", "vid": "117", "vuuid": "c4663ada-0162-4780-8ee5-347c6c037429" }
POST http://docker:32774/api/dataset/node Content-Type: application/json Accept: application/json X-CSRF-Token: XBWI44XD33XBIANLpyK-rtvRa0N5OcaC03qLx0VQsP4 Cookie: SESSd14344a17ca11d13bda8baf612c0efa5=OBoeXKMQx3zmaZrS_v3FOP7_Ze66fYA61TGhtm9s0Qk Content-Length: 44 { "type": "dataset", "title": "Test Dataset" }
{ "nid": "75", "uri": "http://docker:32774/api/dataset/node/75" }
DELETE http://docker:32774/api/dataset/node/123 Content-Type: application/json X-CSRF-Token: XBWI44XD33XBIANLpyK-rtvRa0N5OcaC03qLx0VQsP4
Content-Type: application/json Accept: application/json X-CSRF-Token: XBWI44XD33XBIANLpyK-rtvRa0N5OcaC03qLx0VQsP4 Cookie: SESSd14344a17ca11d13bda8baf612c0efa5=OBoeXKMQx3zmaZrS_v3FOP7_Ze66fYA61TGhtm9s0Qk Content-Length: 34 {"title": "Updated dataset title"}
{ "nid": "75", "uri": "http://docker:32774/api/dataset/node/75" }
POST http://docker:32774/api/dataset/node Content-Type: application/json Accept: application/json X-CSRF-Token: XBWI44XD33XBIANLpyK-rtvRa0N5OcaC03qLx0VQsP4 Cookie: SESSd14344a17ca11d13bda8baf612c0efa5=OBoeXKMQx3zmaZrS_v3FOP7_Ze66fYA61TGhtm9s0Qk Content-Length: 97 { "type": "resource", "field_dataset_ref": {"und": [{"target_id": "75"}]}, "title": "Test Resource" }
{ "nid": "76", "uri": "http://docker:32774/api/dataset/node/76" }
The pydkan Python client interface with DKAN Dataset REST API DKAN Dataset web service and can be used to build on for your own applications. For more information please visit DKAN API Guide.
SDMX, which stands for Statistical Data and Metadata Exchange is an international initiative that aims at standardising and modernising (“industrialising”) the mechanisms and processes for the exchange of statistical data and metadata among international organisations and their member countries.
SDMX is sponsored by seven institutions including the Bank for International Settlements (BIS), the European Central Bank (ECB), Eurostat (Statistical Office of the European Union), the International Monetary Fund (IMF), the Organisation for Economic Cooperation and Development (OECD), the United Nations Statistical Division (UNSD), and the World Bank. Their purpose is to provide standards for the exchange of statistical information.
This standard describes and universalizes the way to exchange statistical data, and provides standard formats for data and metadata, content guidelines as well as IT architecture for exchange of data and metadata.
The most common terms used in SDMX and their definitions can be found below:
Definition from The official site for the SDMX community and Eurostat. For more information pleas visit The official site for the SDMX community.
The Fusion Registry hosts a number of web services, including SDMX web services. SDMX Web Services include web services to retrieve and submit structures, data, and reference metadata. These web services comply with the SDMX Specification, supporting RESTful GET, and HTTP POST. The SDMX web services API supports multiple response formats for queries. The web services with no security imposed on them are accessed via ws/public/sdmxapi.
Ech web service is definied by following:
In URL entrypoint the resource is used to determine which structure type is being queried. The most common resources:
For more information please visit Fusion Registry Web Services API documentation.