Please wait a minute...
Data Analysis and Knowledge Discovery  2017, Vol. 1 Issue (8): 92-99    DOI: 10.11925/infotech.2096-3467.2017.0492
Orginal Article Current Issue | Archive | Adv Search |
Interface Services and Applications of Open Data Platform
Weng Danyu, Zhai Jun(), Yuan Changfeng, Lin Yan
Transportation Management College, Dalian Maritime University, Dalian 116026, China
Download: PDF (743 KB)   HTML ( 1
Export: BibTeX | EndNote (RIS)      
Abstract  

[Objective] This paper aims to find out the differences between the interface services of governmental open data platform in China and developing trends around the world. [Context] During the 13th Five-Year Plan period, China will build a national open data platform to promote the sharing and in-depth utilization of data at all levels, which demands huge amount of interface services. [Methods] We analyzed the major issues facing the open data platform interface services in China, based on the popular international open data platforms and the W3C API best practices. We also introduced the open data protocol OData to discuss key steps for launching standardized API services. [Results] Building OData services, issuing documentation and machine-readable metadata could help our API services follow best practices. [Conclusions] Adopting internationally accepted standards could improve user experience of interface services in China.

Key wordsOpen Government Data      Open Data Platform      Application Programming Interface (API)      Interface ServiceOpen      Data Protocol (OData)     
Received: 31 May 2017      Published: 26 July 2017
ZTFLH:  G203  

Cite this article:

Weng Danyu,Zhai Jun,Yuan Changfeng,Lin Yan. Interface Services and Applications of Open Data Platform. Data Analysis and Knowledge Discovery, 2017, 1(8): 92-99.

URL:

https://manu44.magtech.com.cn/Jwk_infotech_wk3/EN/10.11925/infotech.2096-3467.2017.0492     OR     https://manu44.magtech.com.cn/Jwk_infotech_wk3/EN/Y2017/V1/I8/92

平台 网址 类别 应用实例
CKAN https://ckan.org 开源 超过146个应用实例, 如美国Data.Gov、英国Data.Gov.UK等
DKAN http://getdkan.com/
https://www.drupal.org/project/dkan
http://docs.getdkan.com/en/stable
开源 科隆(德国) https://www.offenedaten-koeln.de
Socrata https://socrata.com 商用 芝加哥data.cityofchicago.org
旧金山datasf.org/opendata
Junar http://www.junar.com 商用 智利recursos.datos.gob.cl
OpenDataSoft https://www.opendatasoft.com 商用 巴黎opendata.paris.fr
OGDI http://ogdi.codeplex.com
https://github.com/openlab/OGDI-DataLab
商用 哥伦比亚https://www.datos.gov.co/en
编号 最佳实践 说明
BP2 Provide Descriptive Metadata 为API提供描述元数据。
BP12 Use Machine-readable Standardized Data Formats 数据及元数据使用机器可读的标准数据格式, 如CSV、XML、JSON和RDF等。
BP14 Provide Data in Multiple Formats 为数据资源提供多种格式。
BP18 Provide Subsets for Large Datasets 对于大型数据集, 能让消费者获取它的子集。这时, API是最灵活的方式。
BP20 Provide Real-time Access 通过API定期轮询或流媒体技术, 让消费者实时获取数据。
BP21 Provide Data up to Date 为消费者提供最新数据, 防止数据过时。
BP23 Make Data Available through an API 为数据资源提供API, 可以借助平台(如CKAN)的API功能, 或者API的开发框架。
BP24 Use Web Standards as the Foundation of APIs API建立在Web标准(主要是HTTP、REST等)之上, 使其易于理解、使用和维护。
BP25 Provide Complete Documentation for Your API 为开发者提供详细的API说明文档, 包括每个API的目的、参数、返回值和使用示例等。
BP26 Avoid Breaking Changes to Your API 避免API格式与文档的变化, 使客户端代码保持稳定。如需改进API, 最好以增量的方式并采用版本控制。
地方政府 数据门户网站 主要优点 主要不足
北京市 http://www.bjdata.gov.cn/ BP2、BP23、BP25
(为API提供了元数据和说明文档)
BP12(元数据不是机器可读的); BP14(API不能返回多种格式, 只是JSON格式); BP18(API没有查询功能); BP24 (不是RESTfulAPI); 调用API需要key
上海市 http://www.datashanghai.gov.cn/ BP2、BP18、BP23、BP25
(为API提供了元数据和说明文档; API有查询功能)
BP12(元数据不是机器可读的); BP14(API不能返回多种格式, 只是XML格式); BP24(不是RESTfulAPI)
贵州省 http://www.gzdata.gov.cn/ BP2、BP23
(为API提供了元数据)
BP12(元数据不是机器可读的); BP14(API不能返回多种格式, 只是XML格式); BP18(API没有查询功能); BP24 (不是RESTful API); BP25(没有文档)
浙江省 http://data.zjzwfw.gov.cn/ BP2、BP18、BP23
(为API提供了元数据; API有查询
功能)
BP12(元数据不是机器可读的); BP14(API不能返回多种格式, 只是JSON格式); BP24(不是RESTful API); BP25(没有说明文档)
重庆市 http://cqckan.chinacloudapp.cn/ BP2、BP23、BP24
(为API提供了元数据; 少量数据集有OData API)
BP12(元数据不是机器可读的); BP14(API不能返回多种格式, 只是XML格式); BP18(API没有查询功能); BP25(没有说明文档)
广东省 http://www.gddata.gov.cn/ BP2、BP18、BP23、BP25
(为API提供了元数据和说明文档; API有查询功能)
BP12(元数据不是机器可读的); BP14(API不能返回多种格式, 只是JSON或XML); BP24(不是RESTful API)
贵阳市 http://www.gyopendata.gov.cn/ BP2、BP14、BP18、BP23、BP25
(为API提供了元数据和说明文档; 两种格式JSON和XML; API有查询功能)
BP12(元数据不是机器可读的); BP24(不是RESTful API)
序号 名称 说明
1 Part 1: Protocol Plus Errata 03 定义协议的核心语义和能力
2 Part 2: URL Conventions Plus Errata 03 推荐URL的构建规则, 用以标识数据和元数据, 以及查询字符串
3 Part 3: Common Schema Definition Language(CSDL) Plus Errata 03 定义OData服务的“实体数据模型”(EDM)的XML表示
4 OData JSON Format Version 4.0 Plus Errata 03 对Part 1的补充, 给出客户端与服务器通信的JSON格式语法
5 OData Extension for Data Aggregation Version 4.0 增加分组和聚集功能
EDM RDM 说明
实体集(Entity Set) 表或视图 对应数据库中的表, 也称集合(Collections)或源(Feeds)
实体(Entity) 数据行 对应数据库表中的一行数据
操作(Operation) 存储过程 对数据的CRUD (Create, Retrieve, Update, Delete)操作
导航属性(Navigation Property) 外键 定义实体间的关系
序号 查询关键字 说明
1 $select 等价于T-SQL的SELECT子句, 用于确定OData服务返回哪些列
2 $expand 用来指定相关的实体, 以内联形式表示, 类似T-SQL中的多表联合查询
3 $filter 等价于T-SQL的WHERE子句, 指定查询结果应满足的条件
4 $orderby 等价于T-SQL的ORDER BY子句, 用于对查询结果排序
5 $top 等价于T-SQL的TOP子句, 限制返回的记录个数
6 $skip 排除给定参数N的记录数, 从第N+1个记录开始返回
7 $count 指定true值, 返回请求匹配集合中总共的记录个数
8 $search 返回指定查询表达式限制的实体信息
平台 API类型 API模式
CKAN API 通过键值对的方式查询与查询字符串匹配的数据资源
的元数据
某一数据集下的全部的元数据描述, 包括该数据集下
数据资源元数据
{根URL}/api/{version}/action/resource_search?query=
{元数据字段key}:{value}
{根URL}/api/{version}/action/package_show?id=
{datasetName or datasetId}
Socrata API 某一数据集下的数据资源 {根URL}/resource/{dataset_identifier}.{datatype}
OData API 获取元数据文档
获取服务文档
获取一个实体集
查询实体集中某一实体
其他查询API
{根URL}/$metadata
{根URL}/
{根URL}/{entityset_identifier}
{根URL}/{entityset_identifier}(entity_id)
{根URL}/{entityset_identifier}?$filter={}等
名称 网址 技术平台 支持的版本
Apache Olingo http://olingo.apache.org/ Java V2和V4
RESTier http://odata.github.io/RESTier/ .Net V4
node-odata https://github.com/TossShinHwa/node-odata JavaScript V4
ODataStore for CoreData (iOS) http://www.hwigmbh.de/hwi/produkte/odatastore-for-coredata/ Objective-C (iOS & Mac OS X) V3
序号 API类型 调用方式
1 全部数据集元数据 GET localhost:8050/api.rsc/$metadata
2 数据集服务文档 GET localhost:8050/api.rsc/
3 查询某个数据集 GET localhost:8050/api.rsc/高等学校
4 查询数据集中某一数据项 GET localhost:8050/api.rsc/高等学校(1)
5 根据$search传入参数值进行查询 GET localhost:8050/api.rsc/高等学校?$search=大学
6 根据$filter传入参数值, 限制返回结果集 GET localhost:8050/api.rsc/高等学校?$filter=phone
7 $count返回数据集记录总数 GET localhost:8050/api.rsc/高等学校/$count
8 $orderby根据字段名返回结果集排序, 默认升序 GET localhost:8050/api.rsc/高等学校?$orderby schoolCode
[1] Attard J, Orlandi F, Scerri S, et al.A Systematic Review of Open Government Data Initiatives[J]. Government Information Quarterly, 2015, 32(4): 399-418.
doi: 10.1016/j.giq.2015.07.006
[2] World Bank. Open Data in 60 Seconds [EB/OL]. [2016-05-22]. .
[3] Zuiderwijk A, Helbig N, Gil-Garc, et al.Special Issue on Innovation Through Open Data: A Review of the State-of-the-Art and an Emerging Research Agenda: Guest Editors’ Introduction[J]. Journal of Theoretical & Applied Electronic Commerce Research, 2014, 9(2): 1-13.
[4] 吴钢, 曾丽莹. 国内外政府开放数据平台建设比较研究[J]. 情报资料工作, 2016(6): 75-79.
doi: 10.3969/j.issn.1002-0314.2016.06.015
[4] (Wu Gang, Zeng Liying.A Comparative Study on the Construction of Open Data Platform Between Chinese and Foreign Governments[J]. Information and Documentation Services, 2016(6): 75-79.)
doi: 10.3969/j.issn.1002-0314.2016.06.015
[5] 黄如花, 王春迎. 我国政府数据开放平台现状调查与分析[J]. 情报理论与实践, 2016, 39(7): 50-55.
[5] (Huang Ruhua, Wang Chunying.Investigation and Analysis of the Status of Government Open Data Platform in China[J]. Information Studies: Theory and Application, 2016, 39(7): 50-55.)
[6] 曹雨佳. 政府开放数据生存状态: 来自我国19个地方政府的调查报告[J]. 图书情报工作, 2016, 60(14): 94-101.
doi: 10.13266/j.issn.0252-3116.2016.14.011
[6] (Cao Yujia.Government Open Data Survival Status: Investigation Report on 19 Local Governments[J]. Library and Information Service, 2016, 60(14): 94-101.)
doi: 10.13266/j.issn.0252-3116.2016.14.011
[7] 邸弘阳, 任思琪. 政府数据公开网络平台的数据管理与利用方式研究[J]. 图书馆杂志, 2017(1): 88-96.
[7] (Di Hongyang, Ren Siqi.Research of Open Data Management and Utilization of Open Government Data Network Platforms[J]. Library Journal, 2017(1): 88-96.)
[8] Priebe S, Kannicht M, Jacob M, et al.The Complementarity of Open Data Infrastructures: An Analysis of Functionalities[C]////Proceedings of the 14th Annual International Conference on Digital Government Research. ACM, 2013: 166-171.
[9] 李盼, 翟军, 陈燕. 基于Drupal的政府开放数据平台构建[J]. 现代情报, 2016, 36(8): 37-43.
[9] (Li Pan, Zhai Jun, Chen Yan.The Construction of Government Open Data Platform Based on Drupal[J]. Modern Information, 2016, 36(8): 37-43.)
[10] W3C. Data on the Web Best Practices Working Group [EB/OL]. [2016-08-29]. .
[11] W3C. Data on the Web Best Practices[EB/OL].[2017-01-31]. https://www.w3.org/TR/dwbp/.
[12] W3C. DWBP Implementation Report [EB/OL]. [2017-01-29]. .
[13] OASIS Standards [EB/OL]. [2017-01-31]..
[14] ISO/IEC. Information technology -- Open Data Protocol (OData) v4.0 -- Part 1: Core[EB/OL]. [2017-01-29]. .
[15] Analyzing Socrata data in Microsoft Excel® via OData [EB/OL]. [2017-01-31]..
[16] OpenDataSoft. Using the OData API[EB/OL]. [2017-01-29]. .
[17] OData - The Protocol for REST APIs [EB/OL]. [2017- 01-31]. .
[18] Wikipedia. Open Data Protocol [EB/OL].[2017-01-29]. .
[19] W3C. Data Catalog Vocabulary (DCAT)[EB/OL]. [2014-01- 16]. .
[20] 于梦月, 翟军, 林岩. 我国地方政府开放数据的核心元数据研究[J]. 情报杂志, 2016, 35(12): 98-104.
[20] (Yu Mengyue, Zhai Jun, Lin Yan.Open Data Core Metadata Research in Chinese Local Governments[J]. Journal of Intelligence, 2016, 35(12): 98-104.)
[1] Qi Tuotuo, Bai Ruyu, Wang Tianmei. Research on Knowledge Payment Behavior Based on Information Adoption Model: Moderating Effect of Product Type [J]. 数据分析与知识发现, 0, (): 1-.
[2] Lu Quan, He Chao, Chen Jing, Tian Min, Liu Ting. A Multi-Label Classification Model with Two-Stage Transfer Learning[J]. 数据分析与知识发现, 2021, 5(7): 91-100.
[3] Chen Jun,Liang Hao,Qian Chen. Studying Investment Decisions of Rewarded Crowdfunding Users with Emotional Distance and Text Analysis[J]. 数据分析与知识发现, 2021, 5(4): 60-71.
[4] Liang Jiaming, Zhao Jie, Zheng Peng, Huang Liushen, Ye Minqi, Dong Zhenning. Framework for Computing Trust in Online Short-Rent Platform Using Feature Selection of Images and Texts[J]. 数据分析与知识发现, 2021, 5(2): 129-140.
[5] Wu Sizhu, Qian Qing, Zhou Wei, Zhong Ming, Wang Anran, Xiu Xiaolei, Gou Huan, Li Zanmei, Li Jiao, Fang An. Data Archive for Research Projects in Population Health[J]. 数据分析与知识发现, 2020, 4(12): 2-13.
[6] Huang Wei,Zhao Jiangyuan,Yan Lu. Empirical Research on Topic Drift Index for Trending Network Events[J]. 数据分析与知识发现, 2020, 4(11): 92-101.
[7] Chi Maomao,Pan Meiyu,Wang Weijun. Impacts of Cue Consistency on Shared Accommodation Bookings: Interaction Between Texts and Images[J]. 数据分析与知识发现, 2020, 4(11): 74-83.
[8] Cai Jingxuan,Wu Jiang,Wang Chengkun. Predicting Usefulness of Crowd Testing Reports with Deep Learning[J]. 数据分析与知识发现, 2020, 4(11): 102-111.
[9] Wu Sizhu, Qian Qing, Zhou Wei, Zhong Ming, Wang Anran, Xiu Xiaolei, Gou Huan, Li Zanmei, Li Jiao, Fang An. Design and Implementation of Data Archive for Data Collection from Research Projects in the Field of Population Health [J]. 数据分析与知识发现, 0, (): 1-.
[10] Wang Shuyi,Liu Sai,Ma Zheng. Microblog Image Privacy Classification with Deep Transfer Learning[J]. 数据分析与知识发现, 2020, 4(10): 80-92.
[11] Jiaming Liang, Jie Zhao, Peng Zheng, Liushen Huang, Minqi Ye, Zhenning Dong. Image and text analysis based computational framework of trust in online short-rent platform using feature selection [J]. 数据分析与知识发现, 0, (): 1-.
[12] Chi Maomao, Pan Meiyu, Wang Weijun. Research on the Impact of Clue Consistency on Purchasing Decisions of Peer-to-Peer Accommodation Platform: Interaction between Text and Image Clues [J]. 数据分析与知识发现, 0, (): 1-.
[13] Xuhui Li,Tao Yu,Ting Li,Yiwen Li,Jinguang Gu. An Evolutionary Schema for Metadata Description[J]. 数据分析与知识发现, 2020, 4(1): 76-88.
[14] Gang Li,Sijing Chen,Jin Mao,Yansong Gu. Spatio-Temporal Comparison of Microblog Trending Topics on Natural Disasters[J]. 数据分析与知识发现, 2019, 3(11): 1-15.
[15] Li He,Zhu Linlin,Yan Min,Liu Jincheng,Hong Chuang. Identifying Useful Information from Open Innovation Community[J]. 数据分析与知识发现, 2018, 2(12): 12-22.
  Copyright © 2016 Data Analysis and Knowledge Discovery   Tel/Fax:(010)82626611-6626,82624938   E-mail:jishu@mail.las.ac.cn