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
/identify-nodes
POST /api/semantic-graph/identify-nodes HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 39

{
  "query": "text",
  "need_documents": false
}
{
  "response": {
    "semantic_nodes": [
      {
        "node_1": "text",
        "node_2": "text",
        "edge": "text",
        "documents": [
          "text"
        ]
      }
    ],
    "documents_contents": [
      {
        "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
/nodes
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
limitany ofOptionalDefault: 20
integerOptional
or
nullOptional
offsetany ofOptionalDefault: 0
integerOptional
or
nullOptional
Responses
200

Successful Response

application/json
post
/nodes-by-label
POST /api/semantic-graph/nodes-by-label HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 34

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

list linked nodes by a given id

post

to find nodes similar to node_1 or node_2 of a semantic node

Body
idstringRequired
Responses
200

Successful Response

application/json
post
/linked-nodes-by-id
POST /api/semantic-graph/linked-nodes-by-id HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 13

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

Last updated