Knowledge graph tools
MCP.Scientio.Com documentation

Knowledge graph

Every knowledge base has a knowledge graph: a network of nodes (the things the KBase knows about) joined by edges (the relationships between them). Nodes carry attributes holding values, and may carry an existence describing when the thing existed in time, which is read and written with the time tools. Nodes and edges are typed by a lineage drawn from a shared taxonomy of concepts.

The graph is built automatically as content is indexed, but these tools let an agent read it and curate it by hand.

Whole graph

Nodes

Node attributes

Place

Edges

GetGraph

read-only Try it

Gets the whole graph structure for a knowledge base.

Parameters

NameTypeDescription
indexIdstringThe Id of the KBase.

Returns

The graph as a set of nodes and edges in Cytoscape form, suitable for visualisation or traversal.

GetFilteredGraph

read-only Try it

Gets the graph as it stood at a particular moment: only the nodes that existed on the given date, according to their existence data, are returned.

Parameters

NameTypeDescription
indexIdstringThe Id of the KBase.
iso8601datestringAn ISO 8601 Extended date, where negative years are BCE dates.

Returns

The filtered graph, in the same form as GetGraph. An invalid or missing date fails with Invalid date.

GetLocations

read-only Try it

Gets the locations recorded for the nodes of a knowledge base. If a date is supplied, only the locations of nodes that existed on that date, according to their existence data, are returned.

Parameters

NameTypeDescription
indexIdstringThe Id of the KBase.
iso8601datestring (optional)An ISO 8601 Extended date, where negative years are BCE dates. Omit it to get every location.

Returns

A list of locations, or an empty list if none have been set. An unparseable date fails with Invalid date format. For the locations of a single node, use GetNodeLocations.

CreateNode

destructive

Creates a new node in the graph of a knowledge base.

Parameters

NameTypeDescription
indexIdstringThe Id of the KBase.
nodeNamestringThe name of the node.
lineagestringThe lineage that types the node. Find one with the lineage tools.

Returns

The Id of the new node. An unrecognised lineage is rejected.

GetNodeCore

Try it

Gets the core information for a node — its name, lineage and identity — without its attributes.

Parameters

NameTypeDescription
indexIdstringThe Id of the KBase.
nodeIdstringThe Id of the node.

Returns

The node's core record. An unknown node fails with Node not found.

GetGraphObject

Try it

Gets a complete graph object by its Id, including everything attached to it.

Parameters

NameTypeDescription
indexIdstringThe Id of the KBase.
objectIdstringThe Id of the graph object.

Returns

The complete graph object.

UpdateNode

destructive

Renames a node and/or changes the lineage that types it.

Parameters

NameTypeDescription
indexIdstringThe Id of the KBase.
nodeIdstringThe Id of the node to update.
nodeNamestringThe new name of the node.
lineagestringThe new lineage of the node.

Returns

true if the node was updated.

DeleteNode

destructive

Deletes a node from the graph.

Parameters

NameTypeDescription
indexIdstringThe Id of the KBase.
nodeIdstringThe Id of the node to delete.

Returns

true if the node was deleted; an unknown KBase or node fails with KBase or Node not found.

AnnotateNode

destructive

Annotates a node using a piece of text: the server reads the text and enriches the node with the attributes and relationships it finds there.

If the client supplies a progress token, progress updates are reported as MCP progress notifications while annotation runs.

Parameters

NameTypeDescription
indexIdstringThe Id of the KBase.
nodeIdstringThe Id of the node to annotate.
textstringThe text to annotate the node with.
linkedNodesbooleanWhether related nodes found in the text should also be created and linked to this node. Required: pass false to annotate this node only.
nodeTypesstring (optional)Which kinds of related node to create when linkedNodes is true: real, abstract or both.

Returns

The annotated graph object.

AnnotateNodeFromUrl

destructive

As AnnotateNode, but the text is fetched from a web page.

If the client supplies a progress token, progress updates are reported as MCP progress notifications while annotation runs.

Parameters

NameTypeDescription
indexIdstringThe Id of the KBase.
nodeIdstringThe Id of the node to annotate.
urlstringThe URL whose content should be used.
nodeTypesstring (optional)Which kinds of related node to create and link: real, abstract, both, or none to annotate this node only. Defaults to none.

Returns

The annotated graph object.

AnnotateNodeFromFile

destructive

As AnnotateNode, but the text is taken from a PDF document held in file share or blob storage.

Parameters

NameTypeDescription
indexIdstringThe Id of the KBase.
nodeIdstringThe Id of the node to annotate.
fileNamestringThe file name of the document, which must be a PDF, for example handbook.pdf.
blobUrlstringThe URL of the document in a file share, blob storage and so on.
nodeTypesstring (optional)Which kinds of related node to create and link: real, abstract, both, or none to annotate this node only. Defaults to none.

Returns

The annotated graph object.

GetNodeAttributes

Try it

Gets all the attributes held by a node.

Parameters

NameTypeDescription
indexIdstringThe Id of the KBase.
nodeIdstringThe Id of the node.

Returns

A list of attributes, each with its Id, name, lineage, datatype and value.

UpsertNodeAttribute

destructive

Adds an attribute to a node, or updates it if an attribute with that Id already exists ("upsert").

Parameters

NameTypeDescription
indexIdstringThe Id of the KBase.
nodeIdstringThe Id of the node.
attributeIdstringThe Id of the new or existing attribute.
attributeValuestringThe value of the attribute.
attributeNamestringThe name of the attribute.
attributeLineagestringThe lineage that types the attribute.
attributeDatatypestringOne of numeric, categorical, textual, sequence, temporal, duration or markdown.

Returns

true if the attribute was written.

DeleteNodeAttribute

destructive

Deletes an attribute from a node.

Parameters

NameTypeDescription
indexIdstringThe Id of the KBase.
nodeIdstringThe Id of the node.
attributeIdstringThe Id of the attribute to delete.

Returns

true if the attribute was deleted.

GetNodeLocations

Try it

Gets the location data recorded for a single node: where in the world the thing it represents is, or was.

Parameters

NameTypeDescription
indexIdstringThe Id of the KBase.
nodeIdstringThe Id of the node.

Returns

A list of locations, each expressed as a fuzzy location, or an empty list if none have been set. An unknown KBase or node fails with Node or KBase not found. To get the locations of every node at once, use GetLocations.

UpdateNodeLocations

destructive

Replaces the locations held by a node with the ones supplied.

Parameters

NameTypeDescription
indexIdstringThe Id of the KBase.
nodeIdstringThe Id of the node.
newLocationsarrayThe new locations for the node, in the same fuzzy location form as those returned by GetNodeLocations.

Returns

true if the locations were updated; an unknown KBase or node fails with Node or KBase not found. Locations set here are what GetLocations reports on.

CreateEdge

destructive

Creates a new edge joining two existing nodes.

Parameters

NameTypeDescription
indexIdstringThe Id of the KBase.
sourceNodeIdstringThe Id of the node the edge starts from.
targetNodeIdstringThe Id of the node the edge points to.
edgeNamestringThe name of the edge.
lineagestringThe lineage that types the edge.

Returns

The Id of the new edge.

GetEdgeCore

Try it

Gets the core information for an edge.

Parameters

NameTypeDescription
indexIdstringThe Id of the KBase.
edgeIdstringThe Id of the edge.

Returns

The edge record, including the nodes it connects. An unknown edge fails with Edge not found.

UpdateEdge

destructive

Renames an edge and/or changes the lineage that types it.

Parameters

NameTypeDescription
indexIdstringThe Id of the KBase.
edgeIdstringThe Id of the edge to update.
edgeNamestringThe new name of the edge.
lineagestringThe new lineage of the edge.

Returns

true if the edge was updated.

DeleteEdge

destructive

Deletes an edge from the graph, leaving the nodes it joined in place.

Parameters

NameTypeDescription
indexIdstringThe Id of the KBase.
edgeIdstringThe Id of the edge to delete.

Returns

true if the edge was deleted; an unknown KBase or edge fails with KBase or Edge not found.