User Tools

Site Tools


api2:tag_system:tag_edges

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

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

To create a link between two Tags because one includes the other, you can create a Tag Edge from one to the other. As such you are creating a DAG (directed acyclic graph) of Tags. For performance purposes, when you create an Edge we will create a bunch of indirect edges to fully describe the graph.\\ ===Object resources=== ^ Property ^ Type ^ Description ^ | ancestor_id | Integer | The target Tag of the current Edge | | descendant_id | Integer | The source Tag of the current Edge | | tag_set_id | Integer | The Tag Set the Tag Edge belongs to | | direct | Boolean | If the edge is direct or indirect | ===Create (POST)=== ^ Method | POST | ^ URL | /tag_edges | ==Parameters (*Requiered parameters)== ^ Property ^ Type ^ Description ^ | ancestor_id* | Integer | The target Tag of the current Edge | | descendant_id* | Integer | The source Tag of the current Edge | | tag_set_id | Integer | The Tag Set the Tag Edge belongs to | ==Send the request (JSON input example)== <code> { ancestor_id: 3, descendant_id: 1 } </code> ==Get the response (JSON output example)== <code> { id: 1, ancestor_id: 3, descendant_id: 1, tag_set_id:1, direct: true } </code> ===Fetch (GET)=== ^ Method | GET| ^ URL | /tag_edges/{tag_edge_id} | If no tag_edge_id is provided it will fetch all Tag Edges for your instance. Be aware that for each Edge you created, we also created a lot of indirect Edges to build the graph. Hence, you will have fetch your “direct” Edges but also the “indirect” Edges. ==Get the response (JSON output example)== **With ID provided**\\ <code> { id:1, ancestor_id: 3, descendant_id: 1, direct: true, tag_set_id: 1 } </code> **Without ID provided**\\ <code> [{ id:1, ancestor_id: 3, descendant_id: 1, direct: true, tag_set_id: 1 }, { id:1, ancestor_id: 3, descendant_id: 2, direct: false, tag_set_id: 1 }] </code>

api2/tag_system/tag_edges.1507899757.txt.gz · Last modified: 2017/10/13 15:02 by maries