A GraphQL interface for FIWARE context brokers
In the CAPRI project we are investigating how to enable cognitive capabilities in industrial software applications for the process industry, and an important ingredient for this is the provision of semantic information and other metadata along with raw datasets by an Industrial IoT platform. The FIWARE initiative and the ETSI committee on Context Information Management (CIM) have developed a specification for a software platform with REST-based application programming interfaces (APIs), called NGSI-LD, which offers a flexible data modeling approach and supports the integration of different domain-specific data models [1]. It is also at the core of CAPRI’s reference implementation for cognitive software platforms [2], in the form of the FIWARE context broker.
In order to improve the data model integration of the context broker by means of an adapted, domain-specific API, BFI has published a prototypical software component that enhances the context broker by means of a GraphQL interface [3]. GraphQL is an API technology originally invented by Facebook and now widely in use in the web, that allows developers to specify their data requirements in terms of templates, leading to very efficient request patterns and accelerated development cycles [4].
The generation of the GraphQL interface is implemented by parsing the data model specification of the FIWARE context broker and by analysing the possible data types that individual attributes can assume. In this way, an interface adapted to the application domain is created, that is perfectly suited to capture the graph-like structure of production chains often found in the process industries (see figure for an example from the CAPRI steel use case).
The ngsild-graphql software prototype has been published under the permissive open-source MIT license. Two sample data models come packaged with the software, and a publication describing the tool is planned.
References:
[1] ETSI, cross-cutting Context Information Management (CIM); NGSI-LD API v.1.6.1 (2022), https://www.etsi.org/deliver/etsi_gs/CIM/001_099/009/01.06.01_60/gs_CIM009v010601p.pdf
[2] Salis, A. et al.: An Edge-Cloud based Reference Architecture to support cognitive solutions in the Process Industry (2022). https://arxiv.org/abs/2202.06622
[3] BFI, ngsild-graphql (software), https://github.com/bfi-de/ngsild-graphql
[4] GraphQL website, https://graphql.org/