Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Endpoints that return Saga configuration and build information
  • Endpoints to process text and return the interpretation graph





POST saga/_saga/processText


  • Will return a Saga interpretation graph in the format specified
  • By default, it returns the graph in HTML format which is used by the UI
  • It also can return JSON or plain text

...

{
  "_success": true,
  "data": {
    "line": [
      {
        "stage": "WhitespaceTokenizer",
        "confidence": 0.5,
        "match": "I",
        "flags": [
          "ORIGINAL",
          "ALL_UPPER_CASE",
          "TOKEN"
        ],
        "text": "I",
        "startPos": 0,
        "endPos": 1
      },
      {
        "stage": "WhitespaceTokenizer",
        "confidence": 0.5,
        "match": "like",
        "flags": [
          "ORIGINAL",
          "TOKEN",
          "ALL_LOWER_CASE"
        ],
        "text": "like",
        "startPos": 2,
        "endPos": 6
      },
      {
        "stage": "WhitespaceTokenizer",
        "confidence": 0.5,
        "match": "traveling",
        "flags": [
          "ORIGINAL",
          "TOKEN",
          "ALL_LOWER_CASE"
        ],
        "text": "traveling",
        "startPos": 7,
        "endPos": 16
      },
      {
        "stage": "WhitespaceTokenizer",
        "confidence": 0.4,
        "match": "with",
        "flags": [
          "ORIGINAL",
          "STOP_WORD",
          "TOKEN",
          "ALL_LOWER_CASE"
        ],
        "text": "with",
        "startPos": 17,
        "endPos": 21
      },
      {
        "components": [
          {
            "stage": "CaseAnalysis",
            "confidence": 0.45,
            "match": "Paris",
            "flags": [
              "ORIGINAL",
              "LOWERED",
              "TOKEN",
              "ALL_LOWER_CASE"
            ],
            "text": "paris",
            "startPos": 26,
            "endPos": 31
          }
        ],
        "stage": "DictionaryTagger",
        "confidence": 0.6975,
        "display": "Air Paris",
        "match": "Air Paris",
        "flags": [
          "SEMANTIC_TAG",
          "ENTITY"
        ],
        "text": "{airline}",
        "id": "34365531",
        "startPos": 22,
        "endPos": 31,
        "tags": [
          "airline"
        ]
      }
    ],
    "graph": " V-----------[I like traveling with Air Paris]-----------V \n ^-[I]-V-[like]-V-[traveling]-V-[with]-V-[Air]-V-[Paris]-^ \n ^-[i]-^                               ^-[air]-^-[paris]-^ \n                                       ^---[{airline}]---^ \n"
  }
}



POST saga/_saga/processBatch


  • Will return a Saga interpretation graph in the format specified
  • By default, it returns the graph in HTML format which is used by the UI
  • It also can return JSON or plain text

...

[
    {
        "data": {
            "line": [
                {
                    "stage": "WhitespaceTokenizer",
                    "confidence": 0.5,
                    "match": "I",
                    "flags": [
                        "ORIGINAL",
                        "ALL_UPPER_CASE",
                        "TOKEN"
                    ],
                    "text": "I",
                    "startPos": 0,
                    "endPos": 1
                },
                {
                    "stage": "WhitespaceTokenizer",
                    "confidence": 0.5,
                    "match": "like",
                    "flags": [
                        "ORIGINAL",
                        "ALL_LOWER_CASE",
                        "TOKEN"
                    ],
                    "text": "like",
                    "startPos": 2,
                    "endPos": 6
                },
                {
                    "stage": "WhitespaceTokenizer",
                    "confidence": 0.5,
                    "match": "traveling",
                    "flags": [
                        "ORIGINAL",
                        "ALL_LOWER_CASE",
                        "TOKEN"
                    ],
                    "text": "traveling",
                    "startPos": 7,
                    "endPos": 16
                },
                {
                    "stage": "WhitespaceTokenizer",
                    "confidence": 0.4,
                    "match": "with",
                    "flags": [
                        "ORIGINAL",
                        "STOP_WORD",
                        "ALL_LOWER_CASE",
                        "TOKEN"
                    ],
                    "text": "with",
                    "startPos": 17,
                    "endPos": 21
                },
                {
                    "components": [
                        {
                            "stage": "CaseAnalysis",
                            "confidence": 0.45,
                            "match": "Paris",
                            "flags": [
                                "ORIGINAL",
                                "ALL_LOWER_CASE",
                                "LOWERED",
                                "TOKEN"
                            ],
                            "text": "paris",
                            "startPos": 26,
                            "endPos": 31
                        }
                    ],
                    "stage": "DictionaryTagger",
                    "confidence": 0.6975,
                    "display": "Air Paris",
                    "match": "Air Paris",
                    "flags": [
                        "ENTITY",
                        "SEMANTIC_TAG"
                    ],
                    "text": "{airline}",
                    "id": "34365531",
                    "startPos": 22,
                    "endPos": 31,
                    "tags": [
                        "airline"
                    ]
                }
            ],
            "matches": [
                {
                    "components": [
                        {
                            "stage": "CaseAnalysis",
                            "confidence": 0.45,
                            "match": "Paris",
                            "flags": [
                                "ORIGINAL",
                                "ALL_LOWER_CASE",
                                "LOWERED",
                                "TOKEN"
                            ],
                            "text": "paris",
                            "startPos": 26,
                            "endPos": 31
                        }
                    ],
                    "stage": "DictionaryTagger",
                    "confidence": 0.6975,
                    "display": "Air Paris",
                    "match": "Air Paris",
                    "flags": [
                        "ENTITY",
                        "SEMANTIC_TAG"
                    ],
                    "text": "{airline}",
                    "id": "34365531",
                    "startPos": 22,
                    "endPos": 31,
                    "tags": [
                        "airline"
                    ]
                }
            ]
        }
    },
    {
        "data": {
            "line": [
                {
                    "stage": "WhitespaceTokenizer",
                    "confidence": 0.5,
                    "match": "I",
                    "flags": [
                        "ORIGINAL",
                        "ALL_UPPER_CASE",
                        "TOKEN"
                    ],
                    "text": "I",
                    "startPos": 0,
                    "endPos": 1
                },
                {
                    "stage": "WhitespaceTokenizer",
                    "confidence": 0.5,
                    "match": "enjoy",
                    "flags": [
                        "ORIGINAL",
                        "ALL_LOWER_CASE",
                        "TOKEN"
                    ],
                    "text": "enjoy",
                    "startPos": 2,
                    "endPos": 7
                },
                {
                    "stage": "WhitespaceTokenizer",
                    "confidence": 0.5,
                    "match": "traveling",
                    "flags": [
                        "ORIGINAL",
                        "ALL_LOWER_CASE",
                        "TOKEN"
                    ],
                    "text": "traveling",
                    "startPos": 8,
                    "endPos": 17
                },
                {
                    "stage": "WhitespaceTokenizer",
                    "confidence": 0.4,
                    "match": "with",
                    "flags": [
                        "ORIGINAL",
                        "STOP_WORD",
                        "ALL_LOWER_CASE",
                        "TOKEN"
                    ],
                    "text": "with",
                    "startPos": 18,
                    "endPos": 22
                },
                {
                    "stage": "WhitespaceTokenizer",
                    "confidence": 0.5,
                    "match": "Delta",
                    "flags": [
                        "ORIGINAL",
                        "TOKEN",
                        "TITLE_CASE"
                    ],
                    "text": "Delta",
                    "startPos": 23,
                    "endPos": 28
                }
            ],
            "matches": [
                {
                    "stage": "DictionaryTagger",
                    "confidence": 0.44999999999999996,
                    "display": "Delta Air Lines",
                    "match": "Delta",
                    "flags": [
                        "ENTITY",
                        "SEMANTIC_TAG"
                    ],
                    "text": "{airline}",
                    "id": "188920",
                    "startPos": 23,
                    "endPos": 28,
                    "tags": [
                        "airline"
                    ]
                }
            ]
        }
    }
]



GET saga/_saga/solution


  • Returns the information of the solution currently being used.
  • A solution is basically the set of Elasticsearch indices in use

...

"_success": true,
"elasticSearch": {
    "retries": 3,
    "delay": 5,
    "indexname": "saga",
    "nodeUrls": [
        "localhost:9200"
    ],
    "authentication": "none",
    "encryptionKey": "f123123##c#$#4GGVqFk7L9123123@*^",
    "timeout": 30
},
"display": "Saga"



GET saga/_saga/info


  • Returns build-specific and configuration information about Saga
  • Build information contains title, vendor, version, build revision and date
  • Configuration information contains the solution (Elastic index) and providers configured at the moment

...

"msg": "Saga API online",
"_success": true,
"buildInfo": {
    "Implementation-Title": "Saga Server",
    "Implementation-Build": "6b79d916e8ff9ad9efd742d4fbc8ce186f77c02d",
    "Implementation-Version": "1.3.1",
    "Implementation-Timestamp": "1609253821444",
    "Implementation-Vendor-Id": "com.accenture.saga",
    "Built-By": "jenkins",
    "Build-Jdk": "11.0.12",
    "Implementation-Branch": "develop"
},
"solutions": [
    {
        "elasticSearch": {
            "retries": 3,
            "delay": 5,
            "indexName": "saga",
            "nodeUrls": [
                "localhost:9200"
            ],
            "authentication": "none",
            "encryptionKey": "f123123##c#$#4GGVqFk7L9123123@*^",
            "timeout": 30
        },
        "display": "Saga"
    }
],
"exportSettings": {
    "maxSize": 40,
    "batchSize": 5000
},
"ssl": false,
"providers": [
    {
        "baseDir": "./config",
        "name": "filesystem-provider",
        "encryptionKey": "f123123##c#$#4GGVqFk7L9123123@*^",
        "type": "FileSystem"
    },
    {
        "indexName": "saga",
        "nodeUrls": [
            "localhost:9200"
        ],
        "name": "saga-provider",
        "exclude": [
            "updatedAt",
            "createdAt"
        ],
        "encryptionKey": "f123123##c#$#4GGVqFk7L9123123@*^",
        "type": "Elastic",
        "timestamp": "updatedAt",

        "authentication": "none"
    }
]



GET saga/_saga/stopServer


  • Stops the Saga Server

If you stop the server via HTTP request, it can only be restarted on-premise

...

curl --location --request GET 'http://localhost:8080/saga/_saga/stopServer'

Info
titleNotes
  • If you are not logged properly and try to use this request, it will return "Unauthorized" as response.
  • On Windows, change the single quotes for double quotes.

Response