User Tools

Site Tools


api1:knowledge_structure:knowledge_edge

====== Differences ====== This shows you the differences between two versions of the page.

Link to this comparison view

api1:knowledge_structure:knowledge_edge [2017/10/07 14:57]
127.0.0.1 external edit
api1:knowledge_structure:knowledge_edge [2017/10/17 10:22] (current)
maries
Line 1: Line 1:
 +The content’s structure is symbolized by knowledge edges. Knowledge edges are the last objects to instantiate while setting up your content on our API. It gives you a simple way to build your learning path.\\
 +
 +{{ :​api1:​knowledge_structure:​knolwedge_edge_v1.png?​600 | Knowledge Edge example}}
 +
 +
 +===Object resources===
 +^ 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 |
 +| instance_id | Integer | The instance the knowledge edge belongs to |
 +| direct | Boolean | A direct prerequisite link. If false, abstract link between source and destination nodes |
 +| hops | Integer | Number of links between source and destination nodes |
 +| distance | Integer | Number of nodes between source and destination nodes |
 +| created_at | Timestamp | The creation date of the object |
 +| updated_at | Timestamp | The last update date of the object |
 +
 +
 +===Create (POST)===
 +
 +^ Method | POST |
 +^ URL | /​knowledge_edges |
 +
 +==Parameters (*Requiered 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 |
 +
 +==Send the request (JSON input example)==
 +
 +<​code>​
 +{
 + knowledge_graph_id:​ 1,
 + source_node_id:​ 1,
 + destination_node_id:​ 2
 +}
 +</​code>​
 +
 +==Get the response (JSON output example)==
 +
 +<​code>​
 +{
 + id: 1,
 + knowledge_graph_id:​ 1,
 + source_node_id:​ 1,
 + destination_node_id:​ 2,
 + instance_id : 1,
 + created_at : 2014-09-17 09:21:03,
 + updated_at : 2014-09-17 09:21:03
 +}
 +</​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.
 +
 +==Get the response (JSON output example)==
 +
 +**With ID provided**\\
 +
 +<​code>​
 +{
 + id: 1,
 + knowledge_graph_id:​ 1,
 + source_node_id:​ 1,
 + destination_node_id:​ 2,
 + instance_id : 1,
 + direct: true,
 + hops: 1,
 + distance: 1,
 + created_at : 2014-09-17 09:21:03,
 + updated_at : 2014-09-17 09:21:03
 +}
 +</​code>​
 +
 +
 +**Without ID provided**\\
 +<​code>​
 +[
 + {
 + id: 1,
 + knowledge_graph_id:​ 1,
 + source_node_id:​ 1,
 + destination_node_id:​ 2
 + },
 + {
 + id: 2,
 + knowledge_graph_id:​ 1,
 + source_node_id:​ 1,
 + destination_node_id:​ 3
 + }
 +]
 +</​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 |
  
api1/knowledge_structure/knowledge_edge.1507381057.txt.gz · Last modified: 2017/10/07 14:57 by 127.0.0.1