Semantic graph

identify nodes by a query

post

identify all nodes who is concerned by a query as context. Take care, if you select need_content=False, documents will retrieve you a List[str] who is a list of document ids. Else it will retrieve you a list of {id: str, content: List[str]} who represent the partial document involved by the node

Body
queryany ofOptional
stringOptional
or
nullOptional
need_documentsany ofOptionalDefault: false
booleanOptional
or
nullOptional
Responses
200
Successful Response
application/json
post
POST /api/semantic-graph/identify-nodes HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 39

{
  "query": "text",
  "need_documents": false
}
{
  "response": [
    {
      "id": "text",
      "node_1": "text",
      "node_2": "text",
      "edge": "text",
      "documents": [
        {
          "id": "text",
          "content": [
            "text"
          ]
        }
      ]
    }
  ]
}

list nodes

post

List all nodes

Body
offsetany ofOptionalDefault: 0
integerOptional
or
nullOptional
limitany ofOptionalDefault: 50
integerOptional
or
nullOptional
Responses
200
Successful Response
application/json
post
POST /api/semantic-graph/nodes HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 23

{
  "offset": 0,
  "limit": 50
}
{
  "response": [
    {
      "id": "text",
      "node_1": "text",
      "node_2": "text",
      "edge": "text",
      "extraproperties": {
        "documents": [
          "text"
        ],
        "chunks": [
          "text"
        ],
        "count": 1
      }
    }
  ]
}

list nodes by label

post

label is the value of node_1 or node_2 in a semantic node

Body
labelany ofOptionalDefault: ""
stringOptional
or
nullOptional
Responses
200
Successful Response
application/json
post
POST /api/semantic-graph/nodes-by-label HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 12

{
  "label": ""
}
{
  "response": [
    {
      "id": "text",
      "node_1": "text",
      "node_2": "text",
      "edge": "text",
      "extraproperties": {
        "documents": [
          "text"
        ],
        "chunks": [
          "text"
        ],
        "count": 1
      }
    }
  ]
}

Last updated