Graph API
The graph endpoint returns a graph defined in your model as one set of nodes and edges. A client gets a whole ownership structure or organisation chart in one request, instead of paging through the list endpoints of every class involved.
GET /graphs/{tenant}/{graph}
{graph} is the graph's REST name: the name part of its id. The graph entityhub.governance is at /graphs/{tenant}/governance. An unknown graph gives 404 Not Found.
The endpoint requires authentication like every other data endpoint (see Authentication), and the reader's rights apply to everything it returns (see Access control).
You rarely need to build this URL yourself. A GRAPH layout item publishes the complete URL in the metadata, or names the link on the current object that holds it.
Modes
The endpoint selects edges in one of two ways. Both return the same response shape.
| Mode | Selects | Use it for |
|---|---|---|
SCOPE (default) | Every edge whose object matches the filters, or relates to one given object, plus the nodes at their ends. | "All shareholdings of this group", "the whole organisation". |
CONNECTED | Everything reachable from a center node, following edges in both directions, again and again. | "Everything this company is connected to": parents, subsidiaries, co-shareholders and their other holdings. |
CONNECTED follows edges in both directions, so from a subsidiary it reaches its parent, and from there the parent's other subsidiaries. A separate structure with no connection to the center is not included.
Query parameters
| Parameter | Mode | Description |
|---|---|---|
mode | both | SCOPE (default) or CONNECTED. |
center | both | An object's _self href, e.g. /data/{tenant}/companies/{id}. Required in CONNECTED mode, where it is the start node. In SCOPE mode the server ignores it; it only tells a client where to open. |
scope | SCOPE | An object's _self href. Limits the edges to those whose edge object relates to this object, e.g. all shareholdings of a group. |
fromClass | SCOPE | Plural REST name of the class through which the edges relate to scope. Defaults to the class in the scope href. Needed when the relation is to a role or ancestor class of the object, e.g. scope=/data/{tenant}/companies/{id}&fromClass=entities. Only valid together with scope. |
edges | both | Comma-separated edge kinds to include, e.g. shareholding,directorship. Default: all kinds of the graph. In CONNECTED mode it also limits what is reachable. |
date | both | ISO date (2024-06-30). Keeps only the edges that hold on that day, and leaves out nodes that then have no edge (the center excepted). |
| any other | SCOPE | A column filter in the list conventions, applied to the edge objects of every selected kind. |
center and scope take an href of the request's own tenant. A malformed href, or an href of another tenant, gives 400 Bad Request, as do an unknown edge kind, scope in CONNECTED mode, CONNECTED without center, and fromClass without scope.
Filters and edge kinds. A column filter is applied to every selected kind. When a filter only makes sense for one kind, select that kind with edges:
GET /graphs/{tenant}/governance?edges=shareholding&financialInterest_from=0.5
Edge kinds in CONNECTED mode. Restricting the kinds also restricts how far the graph reaches. Looking at ownership only, a company that is connected to the center only through a shared director is not included:
GET /graphs/{tenant}/governance?mode=CONNECTED¢er=/data/{tenant}/companies/{id}&edges=shareholding
Encode the href values in a query string as usual (/ as %2F); the examples on this page show them unencoded for readability.
Response
{
"nodes": [
{
"href": "/data/{tenant}/companies/7f3c…",
"class": "companies",
"name": "Acme Holding B.V.",
"attributes": { "country": "NL", "legalForm": "BV" }
},
{
"href": "/data/{tenant}/companies/a91e…",
"class": "companies",
"name": "Acme Nederland B.V.",
"attributes": { "country": "NL", "legalForm": "BV" }
},
{
"href": "/data/{tenant}/persons/4b07…",
"class": "persons",
"name": "Jane Smith",
"attributes": {}
}
],
"edges": [
{
"href": "/data/{tenant}/shareholdings/c2d0…",
"edge": "shareholding",
"label": null,
"source": "/data/{tenant}/companies/7f3c…",
"target": "/data/{tenant}/companies/a91e…",
"validFrom": "2019-01-01",
"validUntil": null,
"attributes": { "financialInterest": 1.0, "votingInterest": 1.0 }
},
{
"href": "/data/{tenant}/directorships/e815…",
"edge": "directorship",
"label": "Statutory director",
"source": "/data/{tenant}/persons/4b07…",
"target": "/data/{tenant}/companies/7f3c…",
"validFrom": "2020-05-01",
"validUntil": null,
"attributes": { "position": "Statutory director" }
}
]
}
Node
| Property | Description |
|---|---|
href | The object's _self href. Edges refer to nodes by this href. |
class | The object's basic class, by plural REST name (as _class on an object). |
name | The object's display name. |
attributes | The fields of the node's view that have a value. Empty when the graph declares no view for the class. |
Edge
| Property | Description |
|---|---|
href | The edge object, e.g. the shareholding. null for a relation edge, which has no object of its own. |
edge | The edge kind. |
label | The value of the kind's label field, or null. |
source | The href of the node the edge starts at. |
target | The href of the node the edge ends at. |
validFrom | From when the edge holds; null for "since always" and for relation edges. |
validUntil | Until when the edge holds; null for "still holds" and for relation edges. |
attributes | The kind's attribute fields that have a value. |
Values in attributes and label are formatted as in an object's own response (see JSON representation): list values are translated, a PERCENTAGE is a fraction, hidden and SECRET fields are never sent. Every edge's source and target are in nodes.
History
By default the response contains all edges, past, current and future, each with validFrom and validUntil. A client can then move through time without a new request. In CONNECTED mode, reachability is also computed over all time.
Pass date to get the structure as it was on one day. Both bounds are inclusive; an empty bound is open:
GET /graphs/{tenant}/governance?mode=CONNECTED¢er=/data/{tenant}/companies/{id}&date=2020-12-31
Relation edges have no validity and are always included.
Access control
The graph shows nothing the reader could not read through the data endpoints:
- A node is returned only when the reader may read the object.
- An edge is returned only when the reader may read the edge object (for an edge class) and both nodes at its ends. An edge to a hidden node would reveal that the node exists.
- In
CONNECTEDmode, the graph is only followed through readable nodes and edges. What lies behind a hidden node is not reached, even when the reader could read it. - An unknown or unreadable
centerorscopegives an empty graph, not an error, so the response never confirms that a hidden object exists:
{ "nodes": [], "edges": [] }
See Access control for how read rights are determined.
Examples
All shareholdings of one group — the edges whose shareholding relates to the group:
GET /graphs/{tenant}/governance?scope=/data/{tenant}/groups/{groupId}&edges=shareholding
Everything connected to one company, ownership and management:
GET /graphs/{tenant}/governance?mode=CONNECTED¢er=/data/{tenant}/companies/{companyId}
The whole organisation chart:
GET /graphs/{tenant}/organisation
Shareholdings that started in or after 2020, using an ordinary column filter on the edge class:
GET /graphs/{tenant}/governance?edges=shareholding&activeDate_from=2020-01-01