KnowledgeOS API Reference
Preparing search index...
graph/src
KnowledgeGraphAPI
Class KnowledgeGraphAPI
Index
Constructors
constructor
Accessors
graph
Id
state
Methods
activate
add
Edge
add
Edge
Label
add
Node
add
Node
Label
begin
Transaction
commit
deregister
Participant
get
Edge
get
Edges
get
Edges
For
Node
get
Neighbors
get
Node
get
Nodes
init
lookup
neighborhood
path
register
Participant
remove
Edge
remove
Edge
Label
remove
Node
remove
Node
Label
rollback
shutdown
subscribe
subscribe
All
suspend
traversal
update
Edge
Properties
update
Node
Properties
Constructors
constructor
new
KnowledgeGraphAPI
(
graphId
?:
string
)
:
KnowledgeGraphAPI
Parameters
Optional
graphId
:
string
Returns
KnowledgeGraphAPI
Accessors
graph
Id
get
graphId
()
:
string
Returns
string
state
get
state
()
:
RuntimeState
Returns
RuntimeState
Methods
activate
activate
()
:
GraphResult
<
void
>
Returns
GraphResult
<
void
>
add
Edge
addEdge
(
participantId
:
string
,
params
:
AddEdgeParams
)
:
GraphResult
<
Edge
>
Parameters
participantId
:
string
params
:
AddEdgeParams
Returns
GraphResult
<
Edge
>
add
Edge
Label
addEdgeLabel
(
participantId
:
string
,
edgeId
:
string
,
label
:
string
,
)
:
GraphResult
<
Edge
>
Parameters
participantId
:
string
edgeId
:
string
label
:
string
Returns
GraphResult
<
Edge
>
add
Node
addNode
(
participantId
:
string
,
params
:
AddNodeParams
)
:
GraphResult
<
Node
>
Parameters
participantId
:
string
params
:
AddNodeParams
Returns
GraphResult
<
Node
>
add
Node
Label
addNodeLabel
(
participantId
:
string
,
nodeId
:
string
,
label
:
string
,
)
:
GraphResult
<
Node
>
Parameters
participantId
:
string
nodeId
:
string
label
:
string
Returns
GraphResult
<
Node
>
begin
Transaction
beginTransaction
(
participantId
:
string
)
:
GraphResult
<
string
>
Parameters
participantId
:
string
Returns
GraphResult
<
string
>
commit
commit
(
participantId
:
string
)
:
GraphResult
<
void
>
Parameters
participantId
:
string
Returns
GraphResult
<
void
>
deregister
Participant
deregisterParticipant
(
participantId
:
string
)
:
GraphResult
<
void
>
Parameters
participantId
:
string
Returns
GraphResult
<
void
>
get
Edge
getEdge
(
id
:
string
)
:
GraphResult
<
Edge
|
undefined
>
Parameters
id
:
string
Returns
GraphResult
<
Edge
|
undefined
>
get
Edges
getEdges
()
:
GraphResult
<
Edge
[]
>
Returns
GraphResult
<
Edge
[]
>
get
Edges
For
Node
getEdgesForNode
(
nodeId
:
string
,
direction
?:
Direction
)
:
GraphResult
<
Edge
[]
>
Parameters
nodeId
:
string
Optional
direction
:
Direction
Returns
GraphResult
<
Edge
[]
>
get
Neighbors
getNeighbors
(
nodeId
:
string
,
direction
?:
Direction
)
:
GraphResult
<
Node
[]
>
Parameters
nodeId
:
string
Optional
direction
:
Direction
Returns
GraphResult
<
Node
[]
>
get
Node
getNode
(
id
:
string
)
:
GraphResult
<
Node
|
undefined
>
Parameters
id
:
string
Returns
GraphResult
<
Node
|
undefined
>
get
Nodes
getNodes
()
:
GraphResult
<
Node
[]
>
Returns
GraphResult
<
Node
[]
>
init
init
()
:
GraphResult
<
void
>
Returns
GraphResult
<
void
>
lookup
lookup
(
id
:
string
)
:
GraphResult
<
Node
|
undefined
>
Parameters
id
:
string
Returns
GraphResult
<
Node
|
undefined
>
neighborhood
neighborhood
(
query
:
NeighborhoodQuery
,
filter
?:
Filter
,
)
:
GraphResult
<
NeighborhoodResult
>
Parameters
query
:
NeighborhoodQuery
Optional
filter
:
Filter
Returns
GraphResult
<
NeighborhoodResult
>
path
path
(
query
:
PathQuery
)
:
GraphResult
<
PathResult
>
Parameters
query
:
PathQuery
Returns
GraphResult
<
PathResult
>
register
Participant
registerParticipant
(
participantId
:
string
,
metadata
?:
Record
<
string
,
unknown
>
,
)
:
GraphResult
<
void
>
Parameters
participantId
:
string
Optional
metadata
:
Record
<
string
,
unknown
>
Returns
GraphResult
<
void
>
remove
Edge
removeEdge
(
participantId
:
string
,
edgeId
:
string
)
:
GraphResult
<
Edge
>
Parameters
participantId
:
string
edgeId
:
string
Returns
GraphResult
<
Edge
>
remove
Edge
Label
removeEdgeLabel
(
participantId
:
string
,
edgeId
:
string
,
label
:
string
,
)
:
GraphResult
<
Edge
>
Parameters
participantId
:
string
edgeId
:
string
label
:
string
Returns
GraphResult
<
Edge
>
remove
Node
removeNode
(
participantId
:
string
,
nodeId
:
string
,
)
:
GraphResult
<
{
cascadeEdges
:
string
[]
;
node
:
Node
}
>
Parameters
participantId
:
string
nodeId
:
string
Returns
GraphResult
<
{
cascadeEdges
:
string
[]
;
node
:
Node
}
>
remove
Node
Label
removeNodeLabel
(
participantId
:
string
,
nodeId
:
string
,
label
:
string
,
)
:
GraphResult
<
Node
>
Parameters
participantId
:
string
nodeId
:
string
label
:
string
Returns
GraphResult
<
Node
>
rollback
rollback
(
participantId
:
string
)
:
GraphResult
<
void
>
Parameters
participantId
:
string
Returns
GraphResult
<
void
>
shutdown
shutdown
()
:
GraphResult
<
void
>
Returns
GraphResult
<
void
>
subscribe
subscribe
(
type
:
string
,
handler
:
(
event
:
GraphEvent
)
=>
void
)
:
()
=>
void
Parameters
type
:
string
handler
:
(
event
:
GraphEvent
)
=>
void
Returns
()
=>
void
subscribe
All
subscribeAll
(
handler
:
(
event
:
GraphEvent
)
=>
void
)
:
()
=>
void
Parameters
handler
:
(
event
:
GraphEvent
)
=>
void
Returns
()
=>
void
suspend
suspend
()
:
GraphResult
<
void
>
Returns
GraphResult
<
void
>
traversal
traversal
(
query
:
TraversalQuery
,
filter
?:
Filter
)
:
GraphResult
<
TraversalResult
>
Parameters
query
:
TraversalQuery
Optional
filter
:
Filter
Returns
GraphResult
<
TraversalResult
>
update
Edge
Properties
updateEdgeProperties
(
participantId
:
string
,
edgeId
:
string
,
params
:
UpdatePropertiesParams
,
)
:
GraphResult
<
Edge
>
Parameters
participantId
:
string
edgeId
:
string
params
:
UpdatePropertiesParams
Returns
GraphResult
<
Edge
>
update
Node
Properties
updateNodeProperties
(
participantId
:
string
,
nodeId
:
string
,
params
:
UpdatePropertiesParams
,
)
:
GraphResult
<
Node
>
Parameters
participantId
:
string
nodeId
:
string
params
:
UpdatePropertiesParams
Returns
GraphResult
<
Node
>
Settings
Member Visibility
Inherited
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Accessors
graph
Id
state
Methods
activate
add
Edge
add
Edge
Label
add
Node
add
Node
Label
begin
Transaction
commit
deregister
Participant
get
Edge
get
Edges
get
Edges
For
Node
get
Neighbors
get
Node
get
Nodes
init
lookup
neighborhood
path
register
Participant
remove
Edge
remove
Edge
Label
remove
Node
remove
Node
Label
rollback
shutdown
subscribe
subscribe
All
suspend
traversal
update
Edge
Properties
update
Node
Properties
KnowledgeOS API Reference
Loading...