Hanzo AI
OpenapiGraph

Create extract

Reads the relations a source states and returns them, recording nothing.

POST /v1/graph/extract

Addresshttps://api.hanzo.ai/v1/graph/extract
MethodPOST
OperationgraphExtract
AuthAuthorization: Bearer $HANZO_API_KEY

Reads the relations a source states and returns them, recording nothing.

A line relation:: value states one; a value written [[key]] names an entity and makes the relation an edge. The subject is the nearest heading above the line, or the request's subject until a heading names one.

What filing would refuse is returned apart, in refused: a declaration from a caller who is not an admin of the organization, and what the declared schema refuses, checked against the store and against the types and declarations the document itself states that the caller may file.

Time: it records nothing and takes no as_of or as_known; the schema is checked as of now.

Request

4 fields, body application/json (required).

FieldInTypeRequiredDescription
atbodystringAt is when what the source says was so, RFC 3339. Required by ingest — which records — and read by nothing in extract, which records nothing.
sourcebodystringyesSource names where the text came from — a URL, a document id, a page title.
subjectbodystringSubject is the entity the text is about before any heading names one.
textbodystringyesText is the document.

Response

StatusBodyMeaning
200graph.graphExtractOutok
defaultproblem-detailsrefused

200 body — 14 fields.

FieldInTypeAlwaysDescription
refusedbodygraph.graphTriple[]Refused are the relations found that filing would refuse — a subject or object whose type is not the relation's declared domain or range, or a declaration from…
refused[].namesbodybooleanNames is the author's declaration that Object is an entity and the assertion is an EDGE, written [[key]]. Absent, the relation is a property of Subject.
refused[].objectbodystringObject is what the relation points at.
refused[].predicatebodystringPredicate is the relation, exactly as the line spells it before the ::.
refused[].reasonbodystringReason is why filing it would be refused: the declared schema, or a declaration from a caller who is not an admin of the organization.
refused[].sectionbodyinteger (int64)Section is which section of the source stated it, counting from zero.
refused[].subjectbodystringSubject is the entity the statement is about: the nearest heading above the line, or the request's own subject where no heading has appeared yet.
triplesbodygraph.graphTriple[]Triples are the relations found that the caller may file, in the order the document states them.
triples[].namesbodybooleanNames is the author's declaration that Object is an entity and the assertion is an EDGE, written [[key]]. Absent, the relation is a property of Subject.
triples[].objectbodystringObject is what the relation points at.
triples[].predicatebodystringPredicate is the relation, exactly as the line spells it before the ::.
triples[].reasonbodystringReason is why filing it would be refused: the declared schema, or a declaration from a caller who is not an admin of the organization.
triples[].sectionbodyinteger (int64)Section is which section of the source stated it, counting from zero.
triples[].subjectbodystringSubject is the entity the statement is about: the nearest heading above the line, or the request's own subject where no heading has appeared yet.

Failure carries the platform error shape — see Errors.

Examples

hanzo graph extract

Graph API · All Hanzo APIs · Interactive reference

How is this guide?

On this page