Query Level Options
A typical query contains the source vertex as a starting point, a list of labels to traverse, and optional filters or weights for unwanted results and sorting respectively. Query requests are structured as follows:
Field Name | Definition | Data Type | Example | Remarks |
---|---|---|---|---|
srcVertices | Starting point(s) of the traverse. | JSON (array of vertex representations that includes "serviceName", "columnName", and "id" fields.) | [{"serviceName": "kakao", "columnName": "account_id", "id":1}] |
Required. |
steps | A list of labels to traverse. | JSON (array of a step representation) | [[{"label": "graph_test", "direction": "out", "limit": 100, "scoring":{"time": 0, "weight": 1}}]] |
Explained below. |
removeCycle | When traversing to next step, disregard vertices that are already visited. | Boolean | "true"/ "false" | "Already visited" vertices are decided by both label and vertex. If a two-step query on a same label "friends" contains any source vertices, removeCycle option will decide whether or not these vertices will be included in the response. Default is "true". |
select | Edge data fields to include in the query result. | JSON (array of strings) | ["label", "to", "from"] | |
groupBy | S2Graph will group results by this field. | JSON (array of strings) | ["to"] | |
filterOut | Give a nested query in this field, and it will run concurrently. The result will be a act as a blacklist and filtered out from the result of the outer query. | JSON (query format) | ||
filterOutFields | which fields on each edge would be considered for filterOut | JSON (array of String) | ["_from", "label", "_to"] | default is ["_to"] |
step: Each step tells S2Graph which labels to traverse in the graph and how to traverse them. Labels in the very first step should be directly connected to the source vertices, labels in the second step should be directly connected to the result vertices of the first step traversal, and so on. A step is specified with a list of query params which we will cover in detail below.