Hanzo AI
OpenapiGraph

Create derive

Concludes what the organization's rules derive from the graph, with a proof for every conclusion: the rule, and each support as the assertion in force it…

POST /v1/graph/derive

Addresshttps://api.hanzo.ai/v1/graph/derive
MethodPOST
OperationgraphDerive
AuthAuthorization: Bearer $HANZO_API_KEY

Concludes what the organization's rules derive from the graph, with a proof for every conclusion: the rule, and each support as the assertion in force it rests on or as the derived atom it is.

The rules are assertions — (rule:<name>, rule, <text>), Datalog over the organization's relations, with recursion, stratified negation and the builtins = and != — and the graph is read the way resolve reads it, so a retraction, an until and a declared cardinality all apply. Nothing derived is stored unless an admin asks to file it. Without names assertions to derive without, and the answer then says what would be lost, and what gained, if they had never been filed.

Time: as_of and as_known place the graph and the rules it is read with, as they place a resolve; either absent is now. Filing takes neither: a filed conclusion holds from the instant it was derived.

Request

5 fields, body application/json (required).

FieldInTypeRequiredDescription
as_knownbodystringAsKnown is how much this plane had heard, RFC 3339 — of the statements and of the rules — so a past answer is reproducible.
as_ofbodystringAsOf derives from the graph as it stood at an instant of the world, RFC 3339: the statements that held then.
filebodybooleanFile files each tuple Derived lists as an assertion: (subject, predicate, object) from the instant it was derived at, open, its source the rule, its evidence…
predicatesbodystring[]Predicates are what to derive: every tuple the rules in force conclude of each, with its proof.
withoutbodystring[]Without is assertion IDs, of statements or of rules, to derive without as though they had never been filed.

Response

StatusBodyMeaning
200graph.graphDeriveOutok
defaultproblem-detailsrefused

200 body — 49 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 tuples one evaluation derives.
cutbodystringCut names the bound that stopped it: tuples, at Bound tuples derived, or steps, at Steps rows examined.
derivedbodygraph.graphConclusion[]Derived is every tuple of the predicates asked for that the rules derive, ordered by predicate, subject and object.
derived[].decaybodynumber (double)Decay is the product of the confidences of the distinct statements the proof rests on: how much certainty survives the derivation.
derived[].frombodystringFrom is the latest start among the statements the proof rests on, RFC 3339.
derived[].objectbodystringObject is its second argument.
derived[].predicatebodystringPredicate is the relation concluded.
derived[].rulebodystringRule is the rule that concluded it, rule:&lt;name&gt;.
derived[].rule_idbodystringRuleID is the ID of the assertion stating that rule's text as it was in force.
derived[].subjectbodystringSubject is the tuple's first argument.
derived[].supportsbodygraph.graphSupport[]Supports are the rule's positive atoms as they matched, in the order the rule writes them.
derived[].supports[].assertionbodystringAssertion is the ID of the statement in force the atom rests on.
derived[].supports[].objectbodystringObject is its second argument.
derived[].supports[].predicatebodystringPredicate is the relation the supporting atom is of.
derived[].supports[].subjectbodystringSubject is its first argument.
derived[].untilbodystringUntil is the earliest until any of those statements states, RFC 3339. Absent is open.
derived[].weakestbodystringWeakest is the ID of the statement with the lowest confidence among them, the first on a tie: the link the conclusion is only as strong as.
filedbodygraph.graphAssertOut
filed.duplicatebodyinteger (int64)Duplicate is how many members this plane already held.
filed.reasonsbodystring[]Reasons names why each refused member was refused, in the order sent.
filed.recordedbodyinteger (int64)Recorded is how many members became new rows.
filed.refusedbodyinteger (int64)Refused is how many members were turned away — a missing entity, a timestamp that is not RFC 3339, a confidence outside [0,1], a relation whose declared domain…
gainedbodygraph.graphAtom[]Gained is each that holds only without them — a negation those assertions had been refuting.
gained[].objectbodystringObject is its second argument.
gained[].predicatebodystringPredicate is the relation the tuple is of.
gained[].subjectbodystringSubject is its first argument.
lemmasbodygraph.graphConclusion[]Lemmas is every derived tuple of any other predicate a proof in Derived cites, in the same order, so every support that is not an assertion can be followed to…
lemmas[].decaybodynumber (double)Decay is the product of the confidences of the distinct statements the proof rests on: how much certainty survives the derivation.
lemmas[].frombodystringFrom is the latest start among the statements the proof rests on, RFC 3339.
lemmas[].objectbodystringObject is its second argument.
lemmas[].predicatebodystringPredicate is the relation concluded.
lemmas[].rulebodystringRule is the rule that concluded it, rule:&lt;name&gt;.
lemmas[].rule_idbodystringRuleID is the ID of the assertion stating that rule's text as it was in force.
lemmas[].subjectbodystringSubject is the tuple's first argument.
lemmas[].supportsbodygraph.graphSupport[]Supports are the rule's positive atoms as they matched, in the order the rule writes them.
lemmas[].supports[].assertionbodystringAssertion is the ID of the statement in force the atom rests on.
lemmas[].supports[].objectbodystringObject is its second argument.
lemmas[].supports[].predicatebodystringPredicate is the relation the supporting atom is of.
lemmas[].supports[].subjectbodystringSubject is its first argument.
lemmas[].untilbodystringUntil is the earliest until any of those statements states, RFC 3339. Absent is open.
lemmas[].weakestbodystringWeakest is the ID of the statement with the lowest confidence among them, the first on a tie: the link the conclusion is only as strong as.
lostbodygraph.graphAtom[]Lost is each tuple of the predicates asked for, asserted or derived, that holds with everything and not without the assertions Without names.
lost[].objectbodystringObject is its second argument.
lost[].predicatebodystringPredicate is the relation the tuple is of.
lost[].subjectbodystringSubject is its first argument.
stepsbodyinteger (int64)Steps is the most rows one evaluation's joins examine.
truncatedbodybooleanTruncated says a bound stopped the evaluation before its fixpoint.

Failure carries the platform error shape — see Errors.

Examples

hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.


Graph API · All Hanzo APIs · Interactive reference

How is this guide?

On this page