The prerequisite relationship between Knowledge Nodes is symbolized by Knowledge Edges. Knowledge Edges are the last objects to instantiate to set up your knowledge’s structure on our API. The source of the edge correspond to the simplet concept, while the destination is the one necessiting prerequisite knowledge.

graph

Object resources

Property Type Description
id Integer identifier for the database of Domoscio's API
knowledge_graph_id Integer The knowledge graph the knowledge edge belongs to
source_node_id Integer The source node of the knowledge edge
destination_node_id Integer The destination node of the knowledge edge
created_at DateTime Date of creation of the object
updated_at DateTime Last time the object has been modified

Create (POST)

Method POST
URL /knowledge_edges
Parameters (*Requiered parameters)
Property Type Description
source_node_id* Integer The source node of the knowledge edge
destination_node_id* Integer The destination node of the knowledge edge
Send the request (JSON input example)
{
	source_node_id: 3169,
	destination_node_id: 3170
}
Get the response (JSON output example)
{
    "id": 3874,
    "knowledge_graph_id": 856,
    "destination_node_id": 3170,
    "source_node_id": 3169,
    "created_at": "2017-11-22T16:00:44.050Z",
    "updated_at": "2017-11-22T16:00:44.050Z"
}

Fetch (GET)

Method GET
URL /knowledge_edges/{knowledge_edge_id}

If no knowledge_edge_id is provided it will fetch all the Knowledge Edges for your instance. You can choose to filter the knowledge edges thanks to the following parameters:

Property Type Description
knowledge_graph_id Integer The knowledge graph the knowledge edge belongs to
source_node_id Integer The source node of the knowledge edge
destination_node_id Integer The destination node of the knowledge edge
Get the response (JSON output example)

With ID provided

{
    "id": 3874,
    "knowledge_graph_id": 856,
    "destination_node_id": 3170,
    "source_node_id": 3169,
    "created_at": "2017-11-22T16:00:44.050Z",
    "updated_at": "2017-11-22T16:00:44.050Z"
}

Without ID provided

[
    {
        "id": 3874,
        "knowledge_graph_id": 856,
        "destination_node_id": 3170,
        "source_node_id": 3169,
        "created_at": "2017-11-22T16:00:44.050Z",
        "updated_at": "2017-11-22T16:00:44.050Z"
    },
    {
        "id": 3347,
        "knowledge_graph_id": 782,
        "destination_node_id": 2716,
        "source_node_id": 2714,
        "created_at": "2017-09-20T14:35:38.890Z",
        "updated_at": "2017-09-20T14:35:38.890Z"
    }
]