Analysis requests repository

A repository of analysis requests specific to your project is an excellent way to share example requests with other members of your team. The JSON Sandbox makes these example requests available for editing and execution.

To add example requests to your project, perform these steps:

  1. Create the web/ subdirectory under your project folder (next to your project descriptor). This directory contains static files served by Lingo4G server.

  2. Create the requests/ subdirectory under the web/ directory. For each analysis request JSON in your project, create one corresponding file under the web/requests directory. The JSON Sandbox app displays these requests in the order of their file names so you can use a numeric prefix to order them to prioritize more common or important requests.

    For example, you may create a file called documents-by-query.json with the following contents:

    {
      "name": "Documents by query",
      "comment": "Retrieves identifiers of documents that match the provided search query. This request is useful as a building block for larger requests, such as 'Documents by query with contents' or 'Labels from documents'.",
      "stages": {
        "documents": {
          "type": "documents:byQuery",
          "query": {
            "type": "query:string",
            "query": ""
          },
          "limit": 1000
        }
      }
    }
    Document your requests.

    To make the request repository easier to understand for other users, document the requests and their variables using the name and comment tags. The JSON sandbox app can search names and comments of the requests in the repository.

    Reloading of the request repository.

    If you make any edits in any of the requests in the the web/requests directory, reload Lingo4G Explorer in your browser to see the changes. There is no need to restart Lingo4G server.

  3. Lingo4G merges all requests from individual files you created in the web/requests directory into one JSON array. To retrieve this aggregated array, use a HTTP GET request to fetch http:​//localhost:​8080/requests.json (when you run Lingo4G server with one project) or http:​//localhost:​8080/project-id/requests.json (when you run Lingo4G server with multiple projects at once).