---
url: /manual-service-metamodel-definition.md
---
# Manual Definition of the *Service* Metamodel

In [*Asset -> Service*](./service-management.md) we saw how to define *Service Properties*
for the *Service* using the graphical interface. Behind the scenes, ALIDA converts what is entered
interactively into a JSON metamodel. This JSON can also be defined manually and
loaded from the UI.

To access the metamodel JSON editor, go to the *Service* registration panel and click
on **Service Definition**

![service-registration-form-with-json-service-definition-button-highlighted](/images/service-registration-form-with-json-service-definition-button-highlighted.png)

The editor for entering the metamodel will open:

![service-registration-json-service-definition-editor](/images/service-registration-json-service-definition-editor.png)

| Attribute | Description |
| ---- |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `name` | *Unique name of the Service* |
| `version` | *Version of the Service* |
| `description` | *Brief textual description of the Service* |
| `url` | The URL of the Docker image of the *Service*, with the `docker://` prefix and version tag. Example: `docker://dockerhub.alidalab.it/alida/restricted/services/great-expectations:1.1.0` |
| `accessLevel` | *Service visibility level* |
| `properties` | Array of `property` *(the list of Service parameters and I/O ports)* |
| `markDown` | Textual documentation in markdown format associated with the *Service* and displayed in the UI |

For the generic `property`, element of the `properties` array, the attributes are:

| Attribute | Description |
| --------- | ----------- |
| `key` | *Unique identifier of the property. Used as a reference in code and in UI* |
| `description` | *Descriptive text displayed in UI* |
| `type` | *Property type (application, resource, static). Determines the property behavior* |
| `mandatory` | *Indicates whether it is mandatory (true | false)* |
| `defaultValue` | *Default value. Always string/number; JSON serialized as string* |
| `valueType` | *Type of expected value (STRING | INT | DOUBLE | BOOLEAN | JSON)* |
| `presetValues` | *Array's of generic data (depending on valueType) that must be selected on workflow editor* |
| `invisible` | *Whether to display or not the property in UI (true | false). `true` for input/output ports* |
| `model` | *Additional info for Model ports (`input-model`, `output-model`). Declares the model format: `{ "format": "sklearn" }`. Allowed values: `sklearn`, `mlflow`, `huggingface`. **Do not declare `id`**: it is automatically injected by ALIDA at runtime.* |
| `extra` | *Additional info for streaming ports: `{ "datasetType": null, "mode": "streaming" }`. Mandatory to make the port Kafka-type; without it ALIDA provides Object Store references instead.* |

***

For more information visit [Service Development > Service Registration](service-registration.md)

::: tip General JSON syntax for the metamodel
![metamodel-in-ebnf](/images/metamodel-in-ebnf.png)
:::
