Skip to main content

Relations

We distinguish three types of relations:

  • Attribute relations – e.g., good in a good pizza or the pizza is good expresses an attribute of pizza.
  • Verbal relations – e.g., eat in John ate a pizza represents a relation between John and pizza.
  • Parent relations – e.g., beer is an alcoholic drink, which is a type of drink. (Note: This type of relation is available only to some accounts and generally requires access to the Geneea Knowledge Base.)

See the Relation object reference for more information.

Sample Call​

You can easily try it yourself:

curl -X POST https://api.geneea.com/v3/analysis \
-H 'Authorization: user_key <YOUR USER KEY>' \
-H 'Content-Type: application/json' \
-d '{
"id": "1",
"text": "The trip to London was amazing. But I would not recommend the food. Especially the pizza was terrible.",
"analyses": ["relations"],
"domain": "voc-hospitality"
}'

## On Windows, use \" instead of " and " instead of '

You should get the following response:

{
"version": "3.2.1",
"id": "1",
"language": {"detected": "en"},
"entities": [
{"id": "e0", "gkbId": "HSP-10210", "stdForm": "food", "type": "food"},
{"id": "e1", "gkbId": "HSP-1091", "stdForm": "pizza", "type": "food"}
],
"relations": [
{
"id": "r0", "name": "amazing", "textRepr": "amazing(trip)", "type": "ATTR",
"args": [{"type": "SUBJECT", "name": "trip"}],
"feats": {"negated": "false", "modality": ""}
},
{
"id": "r1", "name": "recommend", "textRepr": "would recommend-not(i,food)", "type": "VERB",
"args": [{"type": "SUBJECT", "name": "i"}, {"type": "OBJECT", "name": "food", "entityId": "e0"}],
"feats": {"negated": "true", "modality": "would"}
},
{
"id": "r2", "name": "terrible", "textRepr": "terrible(pizza)", "type": "ATTR",
"args": [{"type": "SUBJECT", "name": "pizza", "entityId": "e1"}],
"feats": {"negated": "false", "modality": ""}
}
],
"usedChars": 102
}

Since relations may reference entities, all relevant entities are automatically included in the response.