====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
api2:knowledge_structure:knowledge_edge [2017/10/13 11:31] maries |
api2:knowledge_structure:knowledge_edge [2017/11/22 17:08] (current) maries |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | The prerequisite relationship between Knowledge Nodes is symbolized by Knowledge Edges. Knowledge Edges are the last objects to instantiate while setting up your knowledge’s structure on our API.\\ | + | 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}} | {{:api2:knowledge_structure:graph.jpg?400|graph}} | ||
Line 5: | Line 5: | ||
===Object resources=== | ===Object resources=== | ||
^ Property ^ Type ^ Description ^ | ^ 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 | | | knowledge_graph_id | Integer | The knowledge graph the knowledge edge belongs to | | ||
| source_node_id | Integer | The source node of the knowledge edge | | | source_node_id | Integer | The source node of the knowledge edge | | ||
| destination_node_id | Integer | The destination 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)=== | ===Create (POST)=== | ||
Line 17: | Line 20: | ||
^ Property ^ Type ^ Description ^ | ^ 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 | | | source_node_id* | Integer | The source node of the knowledge edge | | ||
| destination_node_id* | Integer | The destination node of the knowledge edge | | | destination_node_id* | Integer | The destination node of the knowledge edge | | ||
Line 25: | Line 27: | ||
<code> | <code> | ||
{ | { | ||
- | knowledge_graph_id: 1, | + | source_node_id: 3169, |
- | source_node_id: 1, | + | destination_node_id: 3170 |
- | destination_node_id: 2 | + | |
} | } | ||
</code> | </code> | ||
Line 35: | Line 36: | ||
<code> | <code> | ||
{ | { | ||
- | id: 1, | + | "id": 3874, |
- | knowledge_graph_id: 1, | + | "knowledge_graph_id": 856, |
- | source_node_id: 1, | + | "destination_node_id": 3170, |
- | destination_node_id: 2 | + | "source_node_id": 3169, |
+ | "created_at": "2017-11-22T16:00:44.050Z", | ||
+ | "updated_at": "2017-11-22T16:00:44.050Z" | ||
} | } | ||
</code> | </code> | ||
Line 47: | Line 50: | ||
^ URL | /knowledge_edges/{knowledge_edge_id} | | ^ URL | /knowledge_edges/{knowledge_edge_id} | | ||
- | If no knowledge_edge_id is provided it will fetch all the Knowledge Edges for your instance. | + | 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)== | ==Get the response (JSON output example)== | ||
Line 55: | Line 62: | ||
<code> | <code> | ||
{ | { | ||
- | id: 1, | + | "id": 3874, |
- | knowledge_graph_id: 1, | + | "knowledge_graph_id": 856, |
- | source_node_id: 1, | + | "destination_node_id": 3170, |
- | destination_node_id: 2 | + | "source_node_id": 3169, |
+ | "created_at": "2017-11-22T16:00:44.050Z", | ||
+ | "updated_at": "2017-11-22T16:00:44.050Z" | ||
} | } | ||
</code> | </code> | ||
Line 66: | Line 75: | ||
<code> | <code> | ||
[ | [ | ||
- | { | + | { |
- | id: 1, | + | "id": 3874, |
- | knowledge_graph_id: 1, | + | "knowledge_graph_id": 856, |
- | source_node_id: 1, | + | "destination_node_id": 3170, |
- | destination_node_id: 2 | + | "source_node_id": 3169, |
- | }, | + | "created_at": "2017-11-22T16:00:44.050Z", |
- | { | + | "updated_at": "2017-11-22T16:00:44.050Z" |
- | id: 2, | + | }, |
- | knowledge_graph_id: 1, | + | { |
- | source_node_id: 1, | + | "id": 3347, |
- | destination_node_id: 3 | + | "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> | </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 | | ||