Downloads On-Demand from the Cessing) Description of Each Endpoint, Which Server
Total Page:16
File Type:pdf, Size:1020Kb
Моделі та засоби систем баз даних і знань UDC 004.724, 004.62 https://doi.org/10.15407/pp2018.04.059 Kyrylo Malakhov, Aleksandr Kurgaev, Vitalii Velychko MODERN RESTFUL API DLS AND FRAMEWORKS FOR RESTFUL WEB SERVICES API SCHEMA MODELING, DOCUMENTING, VISUALIZING The given paper presents an overview of modern RESTful API description languages (belongs to interface description languages set) – OpenAPI, RAML, WADL, Slate – designed to provide a structured description of a RESTful web APIs (that is useful both to a human and for automated machine processing), with related RESTful web API modelling frameworks. We propose an example of the schema model of web API of the service for pre-trained distributional semantic models (word embedding’s) processing. This service is a part of the “Personal Research Information System” services ecosystem – the “Research and Development Workstation Environment” class system for supporting research in the field of ontology engineering: the au- tomated building of applied ontology in an arbitrary domain area as a main feature; scientific and technical creativity: the automated preparation of application documents for patenting inventions in Ukraine. It also presents a quick look at the relationship of Service-Oriented Architecture and Web services as well as REST fundamentals and RESTful web services; RESTful API creation process. Key words: Service-Oriented Architecture, Web service, REST, RESTful API, OpenAPI, RAML, WADL, Slate. Introduction Databases, web sites, business applica- tivity: the automated preparation of applica- tions and services need to exchange data. This tion documents for patenting inventions in is accomplished by defining standard data Ukraine) with related RESTful web API formats such as Extensible Markup Language modelling frameworks. (XML) or JavaScript Object Notation (JSON), as well as transfer protocols or Web Service-Oriented Architecture style services such as the Simple Object Access and Web services Protocol (SOAP) or the more popular today – According to the Open Group [3] (a Representational State Transfer (REST). De- global consortium that develops open, ven- velopers often have to design their own Ap- dor-neutral information technology stand- plication Programming Interfaces (APIs) to ards), an SOA is an architectural style that make applications work while integrating supports service orientation. Service orienta- specific business logic around operating sys- tion is a way of thinking in terms of the out- tems, or servers. This paper introduces these comes of services, and how they can be de- concepts with a focus on the RESTful APIs veloped and combined. In this definition, a and presents an overview of modern RESTful service is a repeatable business activity that API description languages (RESTful API can be logically represented; the Open Group DLs): OpenAPI Specification, RAML, and gives the examples: “check customer credit,” the example of modeling the schema of web and “provide weather data.” Further, a service API of the service for pre-trained distribu- is self-contained, may be composed of other tional semantic models (word embeddings) services, and consumers of the service treat processing (is a part of the “Personal Re- the service as a black box. SOA is a distinct search Information System” [1] services eco- architectural style which is a major improve- system – the “Research and Development ment over earlier ideas, although it includes Workstation Environment” [2] class system some of the earlier ideas. Also, traditional ar- for supporting research in the field of ontolo- chitectural methods must be employed in or- gy engineering: the automated building of ap- der to obtain maximum benefit from using plied ontology in an arbitrary domain area as SOA. a main feature; scientific and technical crea- © Kyrylo Malakhov, Aleksandr Kurgaev, Vitalii Velychko, 2018 ISSN 1727-4907. Проблеми програмування. 2018. № 4 59 Моделі та засоби систем баз даних і знань Another definition of Service-Oriented Figure 1 uses a Venn diagram to illus- Architecture comes from [4]: a paradigm for trate the relationship between SOA and Web organizing and utilizing distributed capabili- services. The overlapping area in the center ties that may be under the control of different represents SOA using Web services for con- ownership domains. It provides a uniform nections. The nonoverlapping area of Web means to offer, discover, interact with and use services represents that Web services can be capabilities to produce desired effects con- used for connections, but connections alone sistent with measurable preconditions and ex- do not make for an SOA. The non- pectations. According to [4], the focus of overlapping area of SOA indicates that an SOAs is to perform a task (business function). SOA can use Web services as well as connec- This is different from some other paradigms, tions other than Web services (the original such as object-oriented architectures, where specifications of CORBA and DCOM are ex- the focus is more on structure of the solution amples). in the case of an object-oriented architecture, the focus is on how to package data inside an object. SOAs address ownership boundaries through service descriptions and service inter- faces. SOA provides reuse of externally de- veloped frameworks by providing easy in- teroperability between systems. Generally speaking, in order to perform a task, an SOA groups services on different systems, possibly running on different operating systems, possi- bly written using different programming lan- guages. Most current SOA-based applications employ an asynchronous client/server-type architectural style – asynchronous event- Figure 1. Relationship of Web services driven architectural style [5]. Event-driven and SOA SOA (also known as SOA 2.0) is the current Key to SOA is the identification and and advanced form of SOA. In this approach design of services. The idea is that services at present, unlike the older SOA approach should be designed in such a way that they where services used to be designed as pre- become components that can be assembled in defined processes, the events generally trigger multiple ways to support or automate business the execution of activities. The asynchronous functions. It is not necessarily easy to proper- event-driven architectural style is better for ly identify and design services. When done real time or proactive systems, since business well, the services allow an organization to processes are treated as a sequence of events, quickly assemble services – or modify the as- and therefore different business processes that sembly of services – of add or modify the sup- have little relationship with each other, except port or automation of business functions. Here for a few individual shared tasks, do not have are basic concepts related to services [8]. to obey the same kind of centralized man- agement. In an asynchronous event-driven Atomic service. An atomic service architecture, an event message carries a state is a well-defined, self-contained function that change to an event server. The event server does not depend on the context or state of passes these events along to the servers, pos- other services. Generally, an atomic service sibly with value added. Servers may then would be seen as fine grained or having a fin- generate messages for other event servers (of- er granularity. ten calls “publish/subscribe” architecture). Composite service. A composite More detailed in-depth look at the current service is an assembly of atomic or other state of SOA presented in [6, 7]. composite services. The ability to assemble 60 Моделі та засоби систем баз даних і знань services is referred to as composability. Com- He coined the term “REST” an architectural posite services are also referred to as com- style for distributed hypermedia systems. Put pound services. Generally, a composite ser- simply, REST (short for Representational vice would be seen as coarse grained or hav- State Transfer) is an architectural style de- ing a larger granularity. fined to help create and organize distributed Loosely coupled. This is a design systems. The key word from that definition concept where the internal workings of one should be “style,” because an important as- service are not “known” to another service. pect of REST is that it is an architectural style All that needs to be known is the external be- – not a guideline, not a standard, or anything havior of the service. This way, the underly- that would imply that there are a set of hard ing programming of a service can be modified rules to follow in order to end up having a and, as long as external behavior has not RESTful architecture. changed, anything that uses that service con- The RESTful architectural style con- tinues to function as expected. This is similar sists of constraints on data, constraints on the to the concept of information hiding that has interpretation of data, constraints on compo- been used in computer science for a long nents, and constraints on connectors between time. components. The RESTful architectural style pos- The design challenge is to find a bal- sesses the following constraints [9]. ance between fine-grained and coarse-grained services to minimize communication over- Client-Server. The separation of con- head yet keep the services loosely coupled. cerns is the core theme of the Web’s client- Services are assembled to support or server constraints. The Web is a client-server- automate business functions. Figure 2 illus- based system, in which clients and servers trates the assembly of services. This repre- have distinct parts to play. They may be im- sents an SOA. Web services are used to con- plemented and deployed independently, using nect the services in an SOA [8]. any language or technology, so long as they conform to the Web’s uniform interface. Services Stateless. The client-server interaction is stateless. There is no stored context on the Web services server. Any session information must be kept by the client. Cacheable. Data in a response (a re- sponse to a previous request) is labeled as cacheable or non-cacheable.