User Tools

Site Tools


api2:knowledge_structure:knowledge_edge

**This is an old revision of the document!** ----

A PCRE internal error occured. This might be caused by a faulty plugin

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.\\ {{:api2:knowledge_structure:graph.jpg?400|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)== <code> { source_node_id: 3169, destination_node_id: 3170 } </code> ==Get the response (JSON output example)== <code> { "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" } </code> ===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**\\ <code> { "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" } </code> **Without ID provided**\\ <code> [ { "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" } ] </code> ===Fetch Knowledge Edges by Knowledge Node (GET)=== You can get all related Knowledge Edges for a given Source Knowledge Node\\ ^ Method | GET | ^ URL | /knowledge_nodes/{knowledge_node_id}/knowledge_edges |

api2/knowledge_structure/knowledge_edge.1511366786.txt.gz · Last modified: 2017/11/22 17:06 by maries