SERVICES OF MARINE GEOLOGY DATA RESOURCE DIRECTORY BASED ON REST AND ODATA
-
摘要:
为解决对分布式海洋地质数据资源快速访问和有效融合问题,满足数据资源共享和未来构建大数据应用的需求,提出一种基于REST架构模式和OData开放数据协议的海洋地质数据资源目录服务方案。首先探讨了基于REST和OData设计海洋地质数据资源目录服务的基本原则、关键环节,然后分别从目录服务资源实体识别、资源标识、实体数据模型、资源操作等方面进行了详细阐述,最后以ASP.NET WebAPI框架为基础说明了实现要点。结果表明,基于REST和OData设计的数据资源目录服务,使得用户可以快速获取分布式海洋地质数据资源,适用于海洋地质数据资源的组织、标识、获取和服务,该成果对促进地质数据资源的共享融合具有一定借鉴意义。
Abstract:In order to make more rapid visit and efficient integration of distributed marine geology data resources to meet the demand of data sharing and large data application, a marine geological data resource catalog service directory based on REST and OData is proposed in this paper. First of all, we discussed the basic principles and key links of directory services, and then elaborated in details the aspects of resource entity identification, resource identification, entity data model and resource operation. Finally, the key points for implementation are explained based on ASP.NET WebAPI framework. The results show that the data resources directory services based on REST and OData, will enable users to a quick access to distributed data resources and is applicable to the organization, identification, acquisition and service of marine geological data resources. This achievement is of significance to the sharing and integration of geological data resources.
-
-
表 1 资源标识示例
Table 1. Example of resource identification
资源实体 URL示例 服务文档 //serviceRoot,服务根目录 目录 //serviceRoot/Catalogs 选定条目 //serviceRoot/Catalogs('6F9619FF-8B86-D011-B42D-00C04FC964FF') 按发布机构汇总的条目 //serviceRoot/Catalogs?$apply=groupby((Agency), aggregate(Catalogs/$count as CatalogsCount)) 选定条目的相关资源集合 //serviceRoot/Catalogs('6F9619FF-8B86-D011-B42D-00C04FC964FF')/Resources 选定条目PDF //serviceRoot/ 格式资源 Catalogs('6F9619FF-8B86-D011-B42D-00C04FC964FF')/Resources?filter=toupper(Format) eq 'PDF' 选定条目点击量 //serviceRoot/ Catalogs ('6F9619FF-8B86-D011-B42D-00C04FC964FF')/Hits 标签集合 //serviceRoot/Tags 表 2 资源CRUD基本操作示例
Table 2. Example of resource CRUD basic operation
资源 URI HTTP方法 //serviceRoot(服务根目录) GET PUT/PATCH POST DELETE 目录 Catalogs 返回所有条目 条目 Catalog 返回选定条目 更新条目信息 添加新条目及其关联资源 删除某条目(将级联删除条 目关联资源) 目录相关资源 Catalogs(entityKey)/Resources(SeqNO) 返回选定条目的某一资源 no no no 目录查询
结果示例Catalogs?$expand=resources 返回目录及其关联资源 no no no Catalogs?$filter= contains(Title, @Keywords) 返回标题含搜索关键词的目录 no no no Catalogs?$filter={expression}& $orderby= SubmitDate) 返回按发布日期排序的目录 no no no 条目点击量 Catalogvisits(entityKey)/Hits no 更新点击量 no no 标签集合 Tags 返回所有标签 no 添加新标签 no 标签相关目录 Tags(entityKey)/CatalogsByTag() 返回标签相关目录 no no no -
[1] 戴勤奋.海洋地质大数据信息服务体系建设[J].海洋地质前沿,2017,33(11)67-70. http://www.wanfangdata.com.cn/details/detail.do?_type=perio&id=hydzdt201711010
[2] 苏国辉.海洋地质数据集成中的关键问题和方案[J].海洋地质前沿,2011,27(11)51-54. http://www.wanfangdata.com.cn/details/detail.do?_type=perio&id=hydzdt201111009
[3] Fielding R T. Architectural styles and the design of network-based software architectures[D]. Irvine:University of California, 2000.
[4] Pizzo M, Handl R, Zurmuehl M. OData Version 4.0. Part 1: Protocol. [R/OL]. http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.pdf, 02 June 2016.
[5] 詹 骞.基于Ajax/REST的GIS WEB服务研究与实现[D].北京:中国地质大学,2008.
[6] Zhang X W, Lei W M, Zhang W. Using P2P network to transmit media stream in SIP-based system[C]//Proc of the International Conference for Young Computer Scientists(ICYCS 2008), 2008: 362-367.
[7] Wang X L, Sun X M, Yang H F. An anonymity and authentication mechanism for internet of things[J].Convergence Information Technology, 2011, 6(3): 98-105. doi: 10.4156/jcit.vol6.issue3.11
[8] 林金鹏.基于REST架构的WEB服务的设计与测试研究[D].厦门:厦门大学, 2011.
[9] Pizzo M, Handl R, Zurmuehl M. OData Version 4.0. Part 2: URL[R/OL].http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part2-url-conventions.pdf , 02 June 2016.
[10] Pizzo M, Handl R, Zurmuehl M. OData Version 4.0. Part 3: CSDL. [R/OL].http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part3-csdl.pdf , 02 June 2016.
[11] ISO/IEC 20802-1:2016.Information technology—Open data protocol (OData) v4.0—Part 1: Core[S].2016.
[12] ISO/IEC 20802-2:2016. Open data protocol (OData) v4.0—Part 2: OData JSON Format[S].2016.
[13] 唐旭华,邹峥嵘. 基于RESTful Web Services的空间数据共享[J].测绘科学,2010, 35(4):122-124. http://www.wanfangdata.com.cn/details/detail.do?_type=perio&id=chkx201004042
[14] Garrett J J. Ajax: A New Approach to Web Applications[EB/OL].http://www.adaptivepath.com/ideas/essays/archives/000385.php, 2005.
-