public class QueryClient extends Client
A client for sending Graql queries to the GRAKN.AI Engine. Queries are formulated as Graql strings and the format of the response is configured as JSON, JSON+HAL or plain text.
| Constructor and Description |
|---|
QueryClient()
Default constructor - do not rely on the default values, plus use fluid setter methods to
initialize the host name and port.
|
QueryClient(String host,
int port)
Construct a query client against the given host and port number.
|
| Modifier and Type | Method and Description |
|---|---|
String |
host() |
QueryClient |
host(String host) |
String |
keyspace() |
QueryClient |
keyspace(String keyspace) |
static void |
main(String[] argv) |
int |
port() |
QueryClient |
port(int port) |
mjson.Json |
query(String query) |
mjson.Json |
query(String keyspace,
String query,
boolean infer,
boolean materialise)
Send a query to the server against the specifying keyspace.
|
String |
scheme() |
QueryClient |
scheme(String scheme) |
convert, exceptionFrom, serverIsRunningpublic QueryClient()
grakn and the
default protocol is http.public QueryClient(String host, int port)
host - Just the host name, with the schema or port etc.port - The port number to use.public String scheme()
public QueryClient scheme(String scheme)
public String host()
public QueryClient host(String host)
public String keyspace()
public QueryClient keyspace(String keyspace)
public int port()
public QueryClient port(int port)
public mjson.Json query(String query)
public mjson.Json query(String keyspace, String query, boolean infer, boolean materialise)
Send a query to the server against the specifying keyspace.
keyspace - The keyspace (database name) holding the knowledge graph.query - A valid Graqlq query.infer - Whether to use inference while performing the query.materialise - Whether to save all inferences method during the query process.public static void main(String[] argv)
Copyright © 2017 Grakn Labs Ltd. All rights reserved.