Orpheus API Reference
Search As You Type
POST Search As You Type
https://api.wisecube.ai/orpheus/graphql
Allows users to search for entities matching the query term from the knowledge graph
BODY graphql
QUERY
query searchEntity($searchText: String) {
searchAsYouType(
searchInput: { searchText: $searchText, type: SEARCH_LABEL }
) {
description
type
data {
__typename
... on SearchLabels {
searchLabels {
qid
text
nodeTypes
}
}
}
}
}
GRAPHQL VARIABLES
{ "searchText" : "diabetes" }
Example Request: Search Entities
POST /orpheus/graphql HTTP/1.1
Host: api.wisecube.ai
Content-Type: application/json
Content-Length: 381
{"query":"query searchEntity($searchText: String) {\n searchAsYouType(\n searchInput: { searchText: $searchText, type: SEARCH_LABEL }\n ) {\n description\n type\n data {\n __typename\n ... on SearchLabels {\n searchLabels {\n qid\n text\n nodeTypes\n }\n }\n }\n }\n}","variables":{"searchText":"diabetes"}}
Example response
{
"data": {
"searchAsYouType": {
"description": null,
"type": "SEARCH_LABEL",
"data": {
"__typename": "SearchLabels",
"searchLabels": [
{
"qid": "http://www.wikidata.org/entity/Q3025883",
"text": "type 2 diabetes",
"nodeTypes": [
"DISEASE"
]
},
{
"qid": "http://www.wikidata.org/entity/Q124407",
"text": "type-1 diabetes",
"nodeTypes": [
"DISEASE"
]
},
{...},
{...}
]
}
}
}
}