The content’s structure is scattered into Knowledge Nodes. Knowledge Nodes are the second objects to instantiate while setting up your content on our API.\\
{{ :api1:knowledge_structure:knowledge_nodes_v1.png?600 |Knowledge Nodes example}}
===Object resources===
^ Property ^ Type ^ Description ^
| knowledge_graph_id | Integer | The knowledge graph this knowledge node belongs to |
| name | String | Custom data |
| uid | String | The ID of this knowledge node in your Database |
| instance_id | Integer | The instance the knowledge graph belongs to |
| 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_nodes |
==Parameters (*Requiered parameters)==
^ Property ^ Type ^ Description ^
| knowledge_graph_id* | Integer | The knowledge graph this knowledge node belongs to |
| name* | String | Custom data |
| uid | String | The ID of this knowledge node in your Database. Useful if you cannot store the ID returned by the API |
==Send the request (JSON input example)==
{
knowledge_graph_id: 1,
name: “Financial asset”,
uid: “fin01”
}
==Get the response (JSON output example)==
{
id: 1,
name: “Financial asset”,
knowledge_graph_id: 1,
uid: “fin01”,
instance_id : 1,
created_at : 2014-09-17 09:21:03,
updated_at : 2014-09-17 09:21:03
}
===Fetch (GET)===
^ Method | GET |
^ URL | /knowledge_nodes/{knowledge_node_id %%||%% uid} |
If no knowledge_node_id or uid is provided it will fetch all the Knowledge Nodes for your instance.\\
==Get the response (JSON output example)==
**With ID provided**\\
{
id: 1,
name: “Financial asset”,
knowledge_graph_id: 1,
instance_id : 1,
uid: “fin01”,
created_at : 2014-09-17 09:21:03,
updated_at : 2014-09-17 09:21:03
}
**Without ID provided**\\
[{
id: 1,
name: « Financial asset »,
knowledge_graph_id: 1,
uid: “fin01”,
instance_id: 1,
created_at : 2014-09-17 09:21:03,
updated_at : 2014-09-17 09:21:03
},
{
id: 2,
name: « Liquid asset »,
knowledge_graph_id: 1,
uid: “liq01”,
instance_id: 1,
created_at : 2014-09-17 09:21:15,
updated_at : 2014-09-17 09:21:15
}]
===Fetch all Knowledge Nodes by Knowledge Graph===
You can get all Knowledge Nodes relative to a given Knowledge Graph.
^ Method | GET |
^ URL | /v2/knowledge_graphs/{knowledge_graph_id}/knowledge_nodes |
===EDIT (PUT)===
^ Method | PUT |
^ URL | /v2/knowledge_nodes/{knowledge_node_id %%||%% uid} |
==Editable parameters==
^ Property ^ Type ^ Description/expected values |
| name | String | Custom data (<255 chars) |
| uid | String | Custom data (<255 chars) |
==Send the request (JSON input example)==
{
name: « No more Financial asset »,
uid: “nofin01”
}
==Get the response (JSON output example)==
{
id: 1,
name: « No more Financial asset »,
instance_id: 1,
uid: “nofin01”,
created_at : 2014-09-17 09:21:03,
updated_at : 2014-09-17 11:21:03
}