def execute(self, query: str, *, infer: bool = True, multi: bool = False) -> Any:
"""Execute a Graql query against the knowledge base
:param query: the Graql query string to execute against the knowledge base
:param infer: enable inference
:param multi: treat this request as a list of queries
:return: a list of query results
:raises: GraknError, requests.exceptions.ConnectionError
"""
response = self._post(query, infer=infer, multi=multi)
if response.ok:
return response.json()
else:
raise GraknError(response.json()['exception'])
评论列表
文章目录