Semantic graph
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
nullOptional
need_documentsany ofOptionalDefault:
falsebooleanOptional
nullOptional
Responses
200
Successful Response
application/json
422
Validation Error
application/json
post
/identify-nodesPOST /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 all nodes
Body
offsetany ofOptionalDefault:
0integerOptional
nullOptional
limitany ofOptionalDefault:
50integerOptional
nullOptional
Responses
200
Successful Response
application/json
422
Validation Error
application/json
post
/nodesPOST /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
}
}
]
}label is the value of node_1 or node_2 in a semantic node
Body
labelany ofOptionalDefault:
""stringOptional
nullOptional
limitany ofOptionalDefault:
20integerOptional
nullOptional
offsetany ofOptionalDefault:
0integerOptional
nullOptional
Responses
200
Successful Response
application/json
422
Validation Error
application/json
post
/nodes-by-labelPOST /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
}
}
]
}to find nodes similar to node_1 or node_2 of a semantic node
Body
idstringRequired
Responses
200
Successful Response
application/json
422
Validation Error
application/json
post
/linked-nodes-by-idPOST /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