Bring one graph fact up to date for the signed-in user, under its recompute policy
const url = 'http://localhost:11044/api/v1/kg/graph-facts/refresh';const options = { method: 'POST', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>', 'Content-Type': 'application/json'}, body: '{"fact":"example","force":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:11044/api/v1/kg/graph-facts/refresh \ --header 'Content-Type: application/json' \ --header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \ --data '{ "fact": "example", "force": true }'Recomputes only if the graph the fact reads changed (or force is set), writes the derived results into the caller’s own scope, and names only the communities that changed. Answers what was decided and why, what changed, and the top results.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”The fact to refresh, by the name its declaration gives, and whether to ignore the recompute policy
Which graph fact to bring up to date.
object
The fact’s name as its declaration gives it, e.g. support/customer-groups.
Recompute even when the recompute policy says the graph has not changed enough. Defaults to false.
Example generated
{ "fact": "example", "force": true}Responses
Section titled “Responses”What the refresh decided and wrote
One refresh of one graph fact for the signed-in user: what was decided and why, what changed, and the top results.
object
The algorithm the fact runs, e.g. components.
The fact refreshed.
How much of the graph the fact read.
object
Edges between those nodes.
Nodes the fact’s declaration selected.
The Cypher that reads the whole result, to run through the ordinary query surfaces.
Why the policy recomputed or skipped, in words.
True when the algorithm ran; false when the policy found the graph unchanged and kept the stored result.
Community names and summaries brought up to date; absent for a fact with no reports.
object
Reports kept because their community had not changed.
The most model calls one refresh may make.
Reports left for a later refresh because the cap was reached.
Model calls this refresh made.
Reports written this refresh.
The top results as rows keyed by the fact’s read columns, at most ten.
object
Anything the refresh left out or could not do, e.g. nodes with no key; empty when nothing was.
What the refresh wrote into the caller’s scope.
object
Nodes, edges or properties newly written.
Ones the new result no longer holds, removed.
Ones that existed and changed.
Example generated
{ "algorithm": "example", "fact": "example", "projected": { "edges": 1, "nodes": 1 }, "read": "example", "reason": "example", "recomputed": true, "reports": { "cached": 1, "ceiling": 1, "deferred": 1, "modelCalls": 1, "written": 1 }, "top": [ { "additionalProperty": "example" } ], "warnings": [ "example" ], "writes": { "created": 1, "removed": 1, "updated": 1 }}Not authenticated
A refusal carrying only a human-readable reason.
object
What went wrong, in the terms the caller can act on.
Example generated
{ "error": "example"}The caller’s world declares no such fact; error names the ones it does
A refusal carrying only a human-readable reason.
object
What went wrong, in the terms the caller can act on.
Example generated
{ "error": "example"}The fact’s declaration cannot run as declared; error says why
A refusal carrying only a human-readable reason.
object
What went wrong, in the terms the caller can act on.
Example generated
{ "error": "example"}
