Hanzo AI
OpenapiGraph

Create communities

Partitions the edge graph into sets of entities more densely connected to each other than to the rest.

POST /v1/graph/communities

Addresshttps://api.hanzo.ai/v1/graph/communities
MethodPOST
OperationgraphCommunities
AuthAuthorization: Bearer $HANZO_API_KEY

Partitions the edge graph into sets of entities more densely connected to each other than to the rest.

The graph is the one a walk reads, direction dropped, and the partition is deterministic: the same graph at the same point numbers the same communities.

Time: as_of and as_known place the graph that is partitioned; either absent is now.

Request

4 fields, body application/json (required).

FieldInTypeRequiredDescription
as_knownbodystringAsKnown is how much this plane had heard, RFC 3339: the answer as it would have been given then, which is what makes a past answer reproducible.
as_ofbodystringAsOf partitions the graph as it stood at an instant of the world, RFC 3339: the edges that held then.
levelbodyinteger (int64)Level is how fine a partition to answer with.
relationbodystringRelation narrows the graph to one edge relation, by its key.

Response

StatusBodyMeaning
200graph.graphCommunitiesOutok
defaultproblem-detailsrefused

200 body — 14 fields.

FieldInTypeAlwaysDescription
as_knownbodystringAsKnown is the knowledge instant it was taken at, RFC 3339, the same way.
as_ofbodystringAsOf is the instant the graph was read at, RFC 3339: the one asked for, or the server's clock when none was.
boundbodyinteger (int64)Bound is the most members listed in one answer.
ceilingbodyinteger (int64)Ceiling is the most edge assertions one partition reads — every row, so an edge three sources asserted counts three times.
communitiesbodygraph.graphCommunity[]Communities are the communities, largest first.
communities[].idbodyinteger (int64)ID numbers the community by size, largest first, then by its lowest key.
communities[].membersbodystring[]Members are the entities in it, in key order.
communities[].sizebodyinteger (int64)Size is how many entities belong to it, whether or not all are listed.
edgesbodyinteger (int64)Edges is how many distinct undirected edges were partitioned.
entitiesbodyinteger (int64)Entities is how many entities the edge graph holds.
levelbodyinteger (int64)Level is the level answered.
levelsbodyinteger (int64)Levels is how many levels detection found.
modularitybodynumber (double)Modularity is Newman's Q of this level's partition, from -0.5 to 1: the share of edge weight inside communities, less what chance would put there.
truncatedbodybooleanTruncated says the member lists stop at Bound entities in all, filled in community order.

Failure carries the platform error shape — see Errors.

Examples

hanzo graph communities

Graph API · All Hanzo APIs · Interactive reference

How is this guide?

On this page