---
title: "%onesaitplatform Interpreter Reference"
canonical: "https://onesaitplatform.refined.site/space/DOCT/2220805206/%25onesaitplatform%20Interpreter%20Reference"
format: markdown
---
This notebook contains documentation related to the interpreter group `%onesaitplatform` of Apache Zeppelin. This document details the functionalities of the interpreters within the group.

> Macro (toc)

# ﹪onesaitplatform

This interpreter provides communication functionalities with the IoT-Broker module, which is used to query and insert data into ontologies.

| Functionality | Syntax | Example | Description |
| --- | --- | --- | --- |
| Show help | help | help | Show interpreter help information |
| Debug mode | setDebugMode(<true / false>) | setDebugMode(true) | Enable debug mode to display the debug trace |
| Start connection | initConnection("<iot_client>", "<iot_client_token>") | initConnection("ExampleClient", "674a6e03348a418787e5af4hcdf5b3df") | Initiate the connection to the IoT-Broker using an authorized Digital Client |
| SQL query | select * from <ontology> (SQL) | select * from Restaurants limit 3 | Query using SQL syntax |
| Native query | db.<ontology>.find(); (MongoDB) | db.Restaurants.find().limit(3) | Query using MongoDB syntax |
| Query as Zeppelin table | asZTable(<query>) | asZTable(select c.Restaurant.borough, c.Restaurant.grades[0].score from Restaurants AS c) | Query in Zeppelin table format from a query |
| Insert values into context | z.put("<key>", <query>) | z.put("testZ", select * from Restaurants limit 1) | Save the results of a query into a context variable |
| Retrieve values from context | z.get("<key>") | z.get("testZ") | Retrieve the data from a context variable |
| Insert values into ontology | insert("<ontology>", z.get("<key>")) | insert("Restaurants",z.get("testZ")) | Insert values into an ontology |
| Paginated query | paginatedQuery(<query>) | z.put("paginated_query", paginatedQuery(select * from Restaurants)) | Perform requests in configurable batches from the interpreter manager |
| File generation | queryFile("<ontology>", "<query>", "<queryType>", "<responseType(DISK/S3_MINIO/URL)>") | queryFile("Restaurants", "select * from Restaurants", "SQL", "S3_MINIO") | Generate a file from a query |
| Check queryFile status | queryFileStatus("<query_id>") | queryFileStatus("f20fe86f-e691-4b2c-872f-079bc517e8d2") | Check the status (Finished/In progress) of the queryFile using the specified queryId |

# ﹪onesaitplatform.apimanager

This interpreter provides communication functionalities with the Api Manager module, which is used to manage and use the platform's REST APIs.

| Functionality | Syntax | Example | Description |
| --- | --- | --- | --- |
| Show help | help | help | Show interpreter help information |
| Debug mode | setDebugMode(<true / false>) | setDebugMode(true) | Enable debug mode to display the debug trace |
| Set token | setToken("<user_token>") | setToken("07619411b8b68fe4942c2kb0344a72d5") | Set the user token required for the calls |
| List user APIs | listAPIS("<user>"/ empty) | listAPIS("user") | List the basic information of the user's APIs <user> |
| Insert values into context | z.put("<key>", <data>) | z.put("apis_user", listAPIS("user")) | Save a dataset in a context variable |
| Retrieve values from context | z.get("<key>") | z.get("apis_user")[0] | Retrieve the data from a context variable |
| Search for information of an API | findAPI("<api_name>", "<api_version>") | findAPI("ExampleAPI", "1") | Retrieve the detailed information of an API |
| Create an API | createAPI(“<json_object>“) |  | Create a new API with the inserted json_object |
| Delete an API | deleteAPI("<api_name>", "<api_version>") | deleteAPI("ExampleAPI", "1") | Delete the API with the specified identifier and version |
| Call an API | callAPI("<api_path>", "<method>", "<body>") | z.put("test_Call", callAPI("v1/exampleAPI", "GET", "null")) | Make a call to a platform API |

To see an example of how to use the interpreters, go to [https://onesaitplatform.atlassian.net/wiki/spaces/DOCT/pages/2220804904](https://onesaitplatform.atlassian.net/wiki/spaces/DOCT/pages/2220804904)