Skip to content

Architecture Details

Eugen Kuksa edited this page Apr 15, 2018 · 23 revisions

Architecture Diagram

architecture

The above diagram displays the general architecture of the Ontohub Application. It presents all essential layers and components. The layers are the OOR architectural layers:

  • Presentation for user interaction
  • Integration and administration for controlling the whole application
  • Persistance for storing OMS data
  • Find for efficient searching
  • Parsing and static analysis and inference for evaluation of OMS.

The colours of the components have special meaning concerning the implementation:

  • Blue is for components to which we contributed a significant amount of code
  • Yellow is for external components that we use (only interface to)
  • Grey is for external components that are not a focus for the near future, but planned for the long term development
  • Opaque/solid is for components that we already started implementing
  • Transparent is for components that are planned but not implemented at all.

The farther to the right a component is, the closer it is to actual user interaction. Components on the left, however, are hidden from the end user.

Components

To the right of the diagram, there is the frontend which acts as the graphical user interface. It serves an HTML/Javascript Application in the user's browser and itself requests the data from the backend via HTTP/GraphQL.

The backend is the central component of Ontohub. It serves two APIs: GraphQL for read and write operations and JSON API for read operations. The backend controls all actions in the application. It is coupled to

  • git repositories for OMS files
  • a PostgreSQL database for user-specific and OMS-related data
  • an Elasticsearch Index for quick lookups during search queries
  • (via RabbitMQ) several instances of Hets for evaluation of OMS. This component handles users, repositories, permissions etc.

Each repository in the application is linked to one git repository that stores the versioned files.

The rest of the application data (users, OMS details etc.) are stored in a PostgreSQL database.

RabbitMQ recieves and queues jobs such that other components can take and perform a job.

Hets evaluates OMS and is invoked by the Hets-Agent because Hets itself is not aware of such a message broker. The Hets-Agent takes a job and assigns it to Hets properly. The OMS details that Hets produces are stored directly into the PostgreSQL database.

When Hets has finished performing an evaluation job, the OMS-Indexer fetches the OMS details from the database and stores them in the Elasticsearch index.

As the last component, there is the Git-Shell which is sitting between SSH and a git repository. It checks whether or not a user has permission to write to a git repository or to read from it.

Details

Ontohub-Models

Models for SQL databases according to the active record pattern. The persisted model classes of the Ontohub application are shared between different components (backend, OMS-Indexer), thus, they are developed in a separate library (ontohub-models).

Notable libraries used

  • rails: The base framework
  • sequel: A powerful database toolkit
  • devise: Authentication library

Ontohub-Backend

The main service that serves the data for the frontend and other clients via the GraphQL API and the JSON API.

Notable libraries used

  • rails: The base framework
  • ontohub-models to use the models.
  • chewy to search in the Elasticsearch index.
  • puma: Web-server
  • bringit: The git layer
  • active_model_serializers: The serialization library for JSON API
  • config allows to use settings.local.yml, settings/development.yml, settings/development.local.yml, etc.
  • jwt: Authentication library for the API
  • recaptcha: Helpers for Google's reCAPTCHA API
  • graphql: Library for GraphQL servers.
  • graphql-batch collects GraphQL queries and executes them batched to improve performance.

Ontohub-Frontend

The Web UI for the end user.

Notable libraries used

HetsAgent

This component listents to a specific queue of RabbitMQ. Whenever it receives a job, it sends the job to Hets, which in turn saves the result to the database. As soon as the Job completes, the HetsAgent sends a job to the OMS indexer (via RabbitMQ) to append data to the search index.

Notable libraries used

  • bunny to interface with RabbitMQ.

Indexer

It creates the index for the search engine Elasticsearch.

Notable libraries to be used

Ontohub-Git-Shell

Used for pulling and pushing of/to git repositories of Ontohub. Manages authorisation.

Models

Here is an overview of the models. It's not entirely correct, but tries to represent the backend view of the models. The greyed-out classes in the right are not yet implemented at all. Most of the other classes are in preparation, but don't have a public HTTP-API yet. models

Editing the Diagrams

The architecture diagram and the models class diagram are created with draw.io. You can edit them directly in this web application. Please pay attention when exporting the edited diagram to PNG and check the box "Include a copy of my diagram" (see the screenshot below). Otherwise, the resulting PNG file will not be editable with draw.io.

exporting the png