You now have a graph with data! You can run some queries using the built-in REST endpoint calls.
Get Vertex/Edge Statistics
Below we call two functions, stat_vertex_number and stat_edge_number to return the cardinality of each vertex and edge type.
REST endpoints return results in JSON format. JSON data are used for various purposes. But JSON data can’t be read easily from JSON file by using bash script like other normal files. jq tool is used to solve this problem
We recommend you install jq and redirect the REST call result to jq before it is output.
In similar fashion, we can see details about edges. To describe an edge, you name the types of vertices and edges in the two parts or three parts of a URL.
Linux Shell
#two partscurl -X GET"http://localhost:9000/graph/edges/{source_vertex_type}/{source_vertex_id}/{edge_type}/"#three partscurl -X GET "http://localhost:9000/graph/edges/{source_vertex_type}/{source_vertex_id}/{edge_type}/{target_vertex_type}/{target_vertex_id}"
Example. Find all friendship edges whose source vertex's primary_id is "Tom".