Create
Create single/multiple documents (vertices/edges).
The Story So Far...
By now, Eric has realized the need for a full-fledged HRMS to keep track of payroll, reporting structure, etc. for his growing department, and has (wisely) selected a product that happens to use RecallGraph under the hood.
Org Info and Initial Employees
Initially, before Kenny is hired, the org structure looks something like this:

Initializing the Database
In order to represent the current state of the organization, we must first define the necessary collections in the database where RecallGraph is installed. This is done using the regular DB methods and does not need any RecallGraph-specific operations. The collections are:
departments(Vertex)employees(Vertex)reporting(Edge - Reporting relationships)membership(Edge - Employee-Department relationships)
After creation, the list of collections will look something like this (in the web console):

Our example HRMS does not track customer relations, but a real-world full-fledged ERP will (and can also theoretically use RecallGraph as a backend).
Entering Data
We start by entering data on the core entities (departments and employees), followed by defining the relations between them.
Core Entities
Department Information
We begin by entering data for the manufacturing department. In your web console, navigate to the services tab and click on the box that says /recallgraph (assuming you mounted the service at /recallgraph).

Now click on the API tab to access the Swagger interface.

Once inside, click on the first green bar _marked
in the _Documents category.

Once this tab is expanded, click on the
button. You will now be presented with a form containing fields that map to request parameters for the POST request.
In the collection field, fill in departments as we will enter the department first.

Next, jump straight to the body field and here we can fill in any valid JSON object. For this example, we use the following:
{
"name": "Manufacturing",
"org": "ACME Inc."
}
Next click on the Execute button and see the result. We should see a response similar to:

Note that the corresponding curl command is also shown for the request, and you can use it to achieve the same result.
The response body contains the _id of the newly created department object, and we make a note of it for reference later on:
Employee Information
We will use the bulk mode to create all employees in one go. The endpoint remains the same.
In the
collectionsfield, enteremployees.We want to map the generated document
_idsto the employee names. So we setreturnNewtotrue.In the
bodyfield, enter the following JSON array:[ { "first_name": "Eric", "last_name": "Cartman", "role": "Unit Supervisor" }, { "first_name": "Stan", "last_name": "Marsh", "role": "Plant Manager" }, { "first_name": "Kyle", "last_name": "Broflovski", "role": "Plant Manager" } ]Hit the
Executebutton to get a result similar to:
Relations
Membership
Now that employees have been added to the database, we need to make them all belong to the Manufacturing department. We will do this by inserting edges pointing from each employee to the Manufacturing department vertex created earlier.
Request similar to:
Param
Value
collection
membership
body
[
{
"_from": "employees/44794449",
"_to": "departments/44787802"
},
{
"_from": "employees/44794453",
"_to": "departments/44787802"
},
{
"_from": "employees/44794457",
"_to": "departments/44787802"
}
]
Response similar to:
Reporting
We need to add a couple of reporting relations to represent Kyle and Stan reporting to Eric. We do this as follows:
Request similar to:
Param
Value
collection
reporting
body
[
{
"_from": "employees/44794453",
"_to": "employees/44794449"
},
{
"_from": "employees/44794457",
"_to": "employees/44794449"
}
]
Response similar to:
Intermediate Result
After inserting all the above, we can get a view of the current state of all inserted objects and their relations by running the following graph query:
The result (in graph viewer) should look like this:

Adding Kenny
Now that the initial members and their relationships have been defined in the system, it is time to add details of the new hire - Kenny. This is done in steps similar to above:
Adding employee information
Adding department membership
Adding reporting relationship.
However, in a case of human error, Kenny was added as reporting to Kyle rather than Eric.

End Result
The end result is shown below:

Last updated