GET /console/lab/topic_relations
NO
Key | Type | Description | Match | Example |
---|---|---|---|---|
from_type |
string | type of from node | exact | Specific_Topic |
from_id |
integer | ID of from node | exact | 1 |
to_type |
string | type of to node | exact | Act |
to_id |
integer | ID of to node | exact | 2 |
search_directionally |
boolean | [1] | exact | false true |
[1]
當
search_directionally
為false
,則
from_type |
from_id |
to_type |
to_id |
WHERE |
---|---|---|---|---|
X |
- | - | - | from_type IS X OR to_type IS X |
- | 1 |
- | - | from_id IS 1 OR to_id IS 1 |
X |
1 |
- | - | EITHER ① from_type IS X AND from_id IS 1 OR ② to_type IS X AND to_id IS 1 |
X |
- | Y |
- | EITHER ① from_type IS X AND to_type IS Y OR ② vice versa |
X |
1 |
Y |
- | EITHER ① from_type IS X AND from_id IS 1 AND to_type IS Y OR ② from_type IS Y AND to_type IS X AND to_id IS 1 |
X |
1 |
Y |
2 |
EITHER ① from_type IS X AND from_id IS 1 AND to_type IS Y AND to_type IS 2 OR ② from_type IS Y AND from_id IS 2 AND to_type IS X AND to_type IS 1 |
當
search_directionally
為true
,則
from_type |
from_id |
to_type |
to_id |
WHERE |
---|---|---|---|---|
X |
- | - | - | from_type IS X |
- | 1 |
- | - | from_id IS 1 |
X |
1 |
- | - | from_type IS X AND from_id IS 1 |
X |
- | Y |
- | from_type IS X AND to_type IS Y |
X |
1 |
Y |
- | from_type IS X AND from_id IS 1 AND to_type IS Y |
X |
1 |
Y |
2 |
from_type IS X AND from_id IS 1 AND to_type IS Y AND to_type IS 2 |
{
rows: [
{
from_type
from_id
to_type
to_id
is_directional
weight
description
}
...
]
totalRowCount
}
GET /console/lab/topic_relations/:id
NO
{
from_type
from_id
to_type
to_id
is_directional
weight
description
}
POST /console/lab/topic_relations
NO
Key | Type | Description |
---|---|---|
from_type |
string | 關係起點節點類型 |
from_id |
integer | 關係起點節點 ID |
to_type |
string | 關係終點節點類型 |
to_id |
integer | 關係終點節點 ID |
is_directional |
boolean | 關係是否為單向? |
weight |
integer | 關係權重 |
description |
string | 關係敘述 |
{
"from_type": "Specific_Topic",
"from_id": 1,
"to_type": "Act",
"to_id": 2,
"is_directional": false,
"weight": 42,
"description": "Lorem ipsum."
}
Returns the newly created topic_relation
PATCH /console/lab/topic_relations/:id
NO
DELETE /console/lab/topic_relations/:id
NO
204 No Content