Abstract
One of the key benefits of the MAMS [13, 14, 19] architecture is to allow agents to make use of the software engineering community’s industry standard technology while being deployed in a microservices architecture. This paper is going to showcase a tool that allows MAMS agents to utilise an industry standard discovery tool to interact with a microservice based on the OpenAPI Specification document that describes the service. This interaction will be based on the “shape” of the service which is identified by the accepted HTTP verbs at the various endpoints. This tool also identifies the pitfalls associated with the current industry standard with regard to service descriptions and how they could be improved through the introduction of Linked Data and use of specifications such as Hydra and Hypermedia Controls Ontology (HCTL) to make a push from machine-readable towards machine-understandable .
Access provided by Autonomous University of Puebla. Download conference paper PDF
Similar content being viewed by others
Keywords
1 Introduction
One of the key concepts in a microservice (MS) architecture, is the notion of bounded context. This states that each MS, following the Domain Driven Design [5, 7] principle, is to provide a singular ‘business’ functionality. With the shift in software engineering from monolithic software structures towards service-oriented architectures, the integration of microservices is a key issue. The standard specification for describing an API is currently the OpenAPI specification (OAS)Footnote 1. These descriptions, although defined as being “machine-readable” are available in formats that provide no context. The documents themselves are geared towards the consumer having a level of tacit knowledge with regards to integrating the services and the protocols and domain knowledge associated with doing so. The main goal of this research is to allow agents to situate themselves in a microservices ecosystem, and through the use of a service-discovery tool, each service can make itself known on the network, describe itself to possible consumers of the service and provide a description so that any and all consumers can learn how to interact with this service solely based on it’s description.
We have built a tool that allows agents deployed in a MS context to consume the OAS document of a service registered with an industry standard service-discovery tool in order to facilitate interaction between software agents and a service in a more generalised form in order to conform to the loose-coupling principle of a microservice architecture. Through the use of this tool, we can see that from an agent perspective, this standard is not fit for purpose as it does not provide enough context with regards to the interaction which led to the implementation of vocabularies such as Hydra [11] and Hypermedia Controls Ontology (HCTL)Footnote 2. The paper is laid out as follows, Sect. 2 will discuss the related work in this area and why this work is relevant. Section 3 will discuss the implementation of our tool, followed by our conclusion.
2 Related Work
Roy Fielding stated in [2] “RESTful applications are, at all times, encouraged to use human-meaningful, hierarchical identifiers, in order to maximise the serendipitous use of the information beyond what is anticipated by the original application.” If we provide semantically enriched, “machine-understandable” descriptions of services and imbue agents with the ability to integrate them how they deem fit, then we can also’maximise the serendipitous use of’ the applications themselves. We present work that has been done on extending service descriptions in order to facilitate interaction and ease of integration. The research presented by Yang et al. in [20] presents a tool called D2Spec that iterates through a Web API specification and determines the number of characteristics that the specification includes. These characteristics include the Base IRI of the Application, the HTTP methods used within the application and also generates path templates to be utilised. Guo et al. [8] have established a service called APIphany which tries to achieve type directed program synthesis by semantically describing the types required and returned by APIs. They manage to achieve this by means of two methods; firstly, they create witnesses from the OAS document of the API and run a test suite in a sandbox environment and secondly, they observe live API traffic. From here, they rank the APIs suitability to that of the user’s needs.
In [3], Ciortea et al. present research that proposes agents creating a mashup of services and devices as a result of their goal-driven behaviour. Agents are initialised with pre-compiled mashups and cooperate at runtime in order to achieve their goals. This work showcases a similar goal of enabling agents with enough information at runtime to achieve their goals, but in an IoT context. The research presented in [16] presents a system that parses an OAS document, generates an OWL-S ontology for each service that is present in the OAS document. This research shows the necessity for such translations and the need for a parallel standard to exist in order to establish machine-understandability. Furthermore, the work presented in [12] showcases a system that consumes OAS documents, stores them in a relational database and uses RDRML in order to convert the relational database entries into RDF format in order to be stored in a knowledge graph. The work detailed in [9] shows an attempt to bridge the gap between Linked Data and REST-based architectures, using the OAS document as the medium. Furthermore, Espinoza et al. [4] have implemented a system that translates from the Web Ontology Language (OWL) into OAS document (OAS document) documents in order to facilitate ease of use between web developers and users of the semantic web. These works show the level of importance being placed on introducing Linked Data concepts to API descriptions.
As mentioned by Bogner et. al in their paper entitled “Industry practices and challenges for the evolvability assurance of microservices”, one of the biggest challenges with regards to building Microservices architectures and assuring their sustainability is Microservices Integration, according to industry practitioners. This is where we see an opportunity for agents that are able to consume service description documents, such as the OAS document, and interact with resources in an ad-hoc manner to act as a bridge between services in order to enhance loose-coupling and evolvability of individual services.
3 Demonstrating the Approach
In order to allow an agent to reason about a given service, it is essential that it first be able to develop a logical depiction of that service. The shape of a resource is created based on the IRI of each of the APIs endpoints and the HTTP verbs accepted at each of these endpoints, as described in the associated OAS document. The {\ldquo}paths{\rdquo} section of the OAS document provides this information, an example of which is displayed below:
The logical model is generated by parsing the associated OAS document for each application, should it be present. It takes the form of a series of beliefs based on the following formats:
The last two belief formats are used to clarify whether or not the service has an OAS document. If it has one, then the hasXXX(...) beliefs are used to describe the service’s endpoints. For these beliefs, the first ’string’ parameter is the service’s unique identifier and the second ’string’ parameter is composed of the base IRI of the application, followed by the endpoint which is being described. This allows the agent to believe that the endpoint identified by a given IRI will accept a GET request.
In the context of the Web of Things, the ’shape’ of a resource is described by the ThingDescription (TD) [1], which has attributes such as ’readProperty’ and ’writeProperty’, and is utilized widely in the Web of Things as an enabler of interoperability [10]. An OAS document can also be seen as being quite similar to the Web of Things TD. Tzavaras et. al, in [17] showcase a comparison of both OpenAPI and ThingDescriptions based on their capacity to describe Things, stating that there is a great deal of crossover between the two. Both OAS and TD give high-level static descriptions of the underlying APIs, where as Signifiers, as defined in [18] as first class abstractions in a hypermedia environment provide a more suitable solution for providing hypermedia descriptions as they can provide contextual hypermedia based on the state of the resource (see the HATEOAS principle as defined in [6]), but also the capabilities of the agent in question. This work was a move towards internalising work similar to Signifiers within the agent based on OAS documents in a Microservices environment in an attempt to bridge the gap between the current industry standard and the hypermedia rich environment we are striving for.
3.1 Experimental Setup
As a means of evaluating this approach, we propose a game of High/Low. This game will operate with the agent requesting a number and guessing whether the next number will be higher or lower than the received number. In order to achieve this we needed to not only facilitate interaction between software agents and microservices, but we also wanted to conform to the current standards of software engineering, as well as utilising components designed for and used by the microservices community. The goal of this experiment is to get an autonomous agent to participate in a game of high-low by identifying the correct microservice and interacting with that resource based on its shape that is identified by parsing the OAS documents of each service.
We created three applications and registered them with a service-discovery tool as Application 1, Application 2 and Application 3. The purpose of this naming convention is to enforce the anonymity of the service that we are trying to allow the agent to discover and utilize. A layout of the system can be found in Fig. 1. One of these applications is an implementation of a very simple, REST compliant, game of High/Low. By utilising CArtAgO [15] Artifacts to implement this tool, it remains agent programming language agnostic. This system is composed of three different agents, the Main Agent queries the service-discovery instance and creates an Application Agent that is instantiated with the IRI of each application registered. Once the Application Agent been created, this agent will then visit the base IRI of the application, at the /api-docs endpoint to view the OAS document. Once the Application Agent has determined that the application has an OAS document, it begins to create a logical depiction of the resource it has been tasked with identifying. Should this application match the shape of the application it will create High/Low Agent to interact with the resource. The High/Low Agent has a logical depiction of how to play the High/Low game based on the “shape” of the service. Figure 1 describes the layout of the system. The code is available at the Git repo https://gitlab.com/eoin.o-neill.3/longlivedwebopenapi with instructions on how to run it.
4 Conclusion
In conclusion, by building this tool we have identified some of the pitfalls that exist with the current standard of service descriptions when exposing them to Web-enabled intelligent software agents and the tacit knowledge that is required when integrating microservices with one another. Section 2 has identified the integration issues that face the software engineering community when building systems of decoupled services that are required to interact in an ad-hoc manner. In order to facilitate agents being able to have a profound impact, the incorporation of Linked Data within service descriptions to define domain specific knowledge, while also providing explicit interaction definitions using vocabularies such as Hydra and Hypermedia Controls Ontology (HCTL), is paramount.
The work being done on signifiers as a first class abstraction [18] shows a path forward with regards to implementing these types of systems by providing enough context for agents at runtime to determine how to utilise a service and what the request and response requirements are in order to become the integrating bodies of these environments. As microservices architectures grow and systems begin to be made up of loosely-coupled, independently evolving services, the need for continuous, contextual integration that aligns with higher level goals provides an opportunity for hypermedia enabled agents to play a significant role. The goal of this research in the future is to implement this tool in a scenario where services are being developed and managed independent of each other with hypermedia representations providing enough contextual information for autonomous agents to act as the integrating intermediaries, a context such as large scale, smart agriculture, smart building or smart city scenario which provides enough variability and change to effectively test this tool at scale.
References
Web of things (wot) thing description. https://www.w3.org/TR/wot-thing-description/
Yahoo \(|\) mail, weather, search, politics, news, finance, sports & videos. http://groups.yahoo.com/group/rest-discuss/message/3232
Ciortea, A., Boissier, O., Zimmermann, A., Florea, A.M.: Responsive decentralized composition of service mashups for the internet of things. In: Proceedings of the 6th International Conference on the Internet of Things, pp. 53–61 (2016)
Espinoza-Arias, P., Garijo, D., Corcho, O.: Mapping the web ontology language to the OpenApi specification. In: Grossmann, G., Ram, S. (eds.) ER 2020. LNCS, vol. 12584, pp. 117–127. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-65847-2_11
Evans, E., Evans, E.J.: Domain-Driven Design: Tackling Complexity in the Heart of Software. Addison-Wesley Professional, Boston (2004)
Fielding, R.T.: REST: Architectural Styles and the Design of Network-based Software Architectures. Doctoral dissertation (2000). http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm
Fowler, M.: Domain driven design (2020). https://www.martinfowler.com/bliki/DomainDrivenDesign.html
Guo, Z., Cao, D., Tjong, D., Yang, J., Schlesinger, C., Polikarpova, N.: Type-directed program synthesis for restful APIs. arXiv preprint arXiv:2203.16697 (2022)
Idehen, K.U.: Swagger, the API economy, rest, linked data, and a semantic web (2018). https://medium.com/openlink-software-blog/swagger-the-api-economy-rest-linked-data-and-a-semantic-web-9d6839dae65a. Accessed 07 Apr 2022
Kaebisch, S., Anicic, D.: Thing description as enabler of semantic interoperability on the web of things. In: Proceedings of the IoT Semantic Interoperability Workshop, pp. 1–3 (2016)
Lanthaler, M., Gütl, C.: Hydra: a vocabulary for hypermedia-driven web APIs. LDOW 996, 35–38 (2013)
Muhamad, W., Bandung, Y., et al.: Transforming OpenAPI specification 3.0 documents into RDF-based semantic web services. J. Big Data 9(1), 1–24 (2022)
O’Neill, E., Lillis, D., O’Hare, G.M.P., Collier, R.W.: Delivering multi-agent MicroServices using CArtAgO. In: Baroglio, C., Hubner, J.F., Winikoff, M. (eds.) EMAS 2020. LNCS (LNAI), vol. 12589, pp. 1–20. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-66534-0_1
O’Neill, E., Lillis, D., O’Hare, G.M., Collier, R.W.: Explicit modelling of resources for multi-agent microservices using the CArtAGo framework. In: Proceedings of the 18th International Joint Conference on Autonomous Agents and Multi-Agent Systems, Auckland, NZ, 2020. International Foundation for Autonomous Agents and MultiAgent Systems (IFAAMAS) (2020)
Ricci, A., Viroli, M., Omicini, A.: CArtA gO: a framework for prototyping artifact-based environments in MAS. In: Weyns, D., Parunak, H.V.D., Michel, F. (eds.) E4MAS 2006. LNCS (LNAI), vol. 4389, pp. 67–86. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-71103-2_4
Silva, S.: REST service discovery based on ontology model. Ph.D. thesis (2021)
Tzavaras, A., Mainas, N., Petrakis, E.G.: OpenAPI framework for the web of things. Internet Things 21, 100675 (2023)
Vachtsevanou, D., Ciortea, A., Mayer, S., Lemée, J.: Signifiers as a first-class abstraction in hypermedia multi-agent systems. arXiv preprint arXiv:2302.06970 (2023)
W Collier, R., O’Neill, E., Lillis, D., O’Hare, G.: MAMS: multi-agent microservices. In: Companion Proceedings of The 2019 World Wide Web Conference, pp. 655–662. ACM (2019)
Yang, J., Wittern, E., Ying, A.T., Dolby, J., Tan, L.: Towards extracting web API specifications from documentation. In: 2018 IEEE/ACM 15th International Conference on Mining Software Repositories (MSR), pp. 454–464. IEEE (2018)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
O’Neill, E., Collier, R.W. (2023). Exploiting Service-Discovery and OpenAPI in Multi-Agent MicroServices (MAMS) Applications. In: Ciortea, A., Dastani, M., Luo, J. (eds) Engineering Multi-Agent Systems. EMAS 2023. Lecture Notes in Computer Science(), vol 14378. Springer, Cham. https://doi.org/10.1007/978-3-031-48539-8_5
Download citation
DOI: https://doi.org/10.1007/978-3-031-48539-8_5
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-48538-1
Online ISBN: 978-3-031-48539-8
eBook Packages: Computer ScienceComputer Science (R0)