Versions Compared

Key

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

This REST Handler contains general/utility functionality

Table of Contents
maxLevel2

Saga_rest_endpoint
EndpointprocessText

Will return Saga interpretation graph in the format specified.

By default it returns the graph in HTML format which is the one used by the UI. It also can return JSON or plain text.

Parameters

  • Parameter
    summaryThis is the text to process
    nameq
    requiredtrue
  • Parameter
    summaryList of tags to use to process the text
    nametags
    typestring array
    requiredtrue
  • Parameter
    summarySpecifies the regex to use to split text into TEXT_BLOCKs
    default[\r |\n ]+
    namesplitRegex
  • Parameter
    summarySpecifies the format of the results. It could be one of these values: "ux", "text" or "json"
    defaultux
    nametype
  • Parameter
    summaryUsed to pretty format the JSON result
    defaultfalse
    namepretty
    typeboolean

Request Examples

Code Block
languagepowershell
themeFadeToGrey
curl -X ${method} \
  http://localhost:${port}/${url} \
  -H 'Content-Type: application/json' \
  -d '
{
    "q": "I like traveling with Air Paris",
	"tags": ["airline"],
	"splitRegex": "[\r|\n]+",
	"type": "text",
	"pretty": true
}'

Response

Saga_json
{
    "_success": true,
    "data": {
        "line": [
            {
                "character": "0:1",
                "components": [
                    "I like traveling with Air Paris"
                ],
                "stage": "WhitespaceTokenizer",
                "confidence": 0.5,
                "flags": [
                    "TOKEN",
                    "ALL_UPPER_CASE",
                    "ORIGINAL"
                ],
                "_item": "I",
                "matching": "I"
            },
            {
                "character": "2:6",
                "components": [
                    "I like traveling with Air Paris"
                ],
                "stage": "WhitespaceTokenizer",
                "confidence": 0.5,
                "flags": [
                    "TOKEN",
                    "ALL_LOWER_CASE",
                    "ORIGINAL"
                ],
                "_item": "like",
                "matching": "like"
            },
            {
                "character": "7:16",
                "components": [
                    "I like traveling with Air Paris"
                ],
                "stage": "WhitespaceTokenizer",
                "confidence": 0.5,
                "flags": [
                    "TOKEN",
                    "ALL_LOWER_CASE",
                    "ORIGINAL"
                ],
                "_item": "traveling",
                "matching": "traveling"
            },
            {
                "character": "17:21",
                "components": [
                    "I like traveling with Air Paris"
                ],
                "stage": "WhitespaceTokenizer",
                "confidence": 0.4,
                "flags": [
                    "TOKEN",
                    "ALL_LOWER_CASE",
                    "SKIP",
                    "ORIGINAL"
                ],
                "_item": "with",
                "matching": "with"
            },
            {
                "character": "22:31",
                "stage": "DictionaryTagger",
                "display": "Air Paris",
                "patterns": [
                    "Air Orly",
                    "Air Paris"
                ],
                "confidence": 0.6975,
                "flags": [
                    "SEMANTIC_TAG",
                    "ENTITY"
                ],
                "id": "34365531",
                "_item": "{airline}",
                "matching": "Air Paris",
                "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"
    }
}
Saga_rest_endpoint
Endpointsolution
MethodGET

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

Request Examples

Code Block
languagepowershell
themeFadeToGrey
curl -X ${method} \
  http://localhost:${port}/${url} \
  -H 'Content-Type: application/json' \
  -d '
{
}'

Response

Saga_json
    	"_success": true,
    "elasticSearch": {
        "scrollTimeout": "1m",
        "hostname": "localhost",
        "debug": false,
        "scheme": "http",
        "size": 100,
        "port": 9200,
        "maxResults": 100000,
        "	"indexName": "sagaair"
    },
    "display": "Saga - EN"