Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion examples/demoCredential.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,22 @@ def exists_credential():
print(exists)


exists_credential()
# exists_credential()


def delete_all_tenant_credential():
litegraph.Credential.delete_all_tenant_credentials(
tenant_guid="00000000-0000-0000-0000-000000000000"
)
print("All tenant credentials deleted")


# delete_all_tenant_credential()


def retrieve_credential_by_bearer_token():
credential = litegraph.Credential.get_bearer_credentials(bearer_token="foobar")
print(credential)


retrieve_credential_by_bearer_token()
60 changes: 59 additions & 1 deletion examples/demoEdge.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,62 @@ def retrieve_first_edge():
print(graph)


retrieve_first_edge()
# retrieve_first_edge()


def get_all_graph_edges():
edges = litegraph.Edge.retrieve_all_graph_edges(
tenant_guid="00000000-0000-0000-0000-000000000000",
graph_guid="00000000-0000-0000-0000-000000000000",
)
print(edges)


get_all_graph_edges()


def get_all_tenant_edges():
edges = litegraph.Edge.retrieve_all_tenant_edges(
tenant_guid="00000000-0000-0000-0000-000000000000",
)
print(edges)


get_all_tenant_edges()


def delete_all_tenant_edges():
litegraph.Edge.delete_all_tenant_edges(
tenant_guid="00000000-0000-0000-0000-000000000000",
)
print("Edges deleted")


# delete_all_tenant_edges()


def delete_node_edges():
litegraph.Edge.delete_node_edges(
tenant_guid="00000000-0000-0000-0000-000000000000",
graph_guid="00000000-0000-0000-0000-000000000000",
node_guid="51c6bb09-76a5-45ce-b4a4-dcc902a383d3",
)
print("Edges deleted")


# delete_node_edges()


def delete_node_edges_bulk():
litegraph.Edge.delete_node_edges_bulk(
tenant_guid="00000000-0000-0000-0000-000000000000",
graph_guid="00000000-0000-0000-0000-000000000000",
node_guids=[
"51c6bb09-76a5-45ce-b4a4-dcc902a383d3",
"51c6bb09-76a5-45ce-b4a4-dcc902a383d3",
],
)
print("Edges deleted")


# delete_node_edges_bulk()
20 changes: 18 additions & 2 deletions examples/demoGraphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def retrieve_subgraph():
print(subgraph)


retrieve_subgraph()
# retrieve_subgraph()


def retrieve_subgraph_statistics():
Expand All @@ -178,4 +178,20 @@ def retrieve_subgraph_statistics():
print(statistics)


retrieve_subgraph_statistics()
# retrieve_subgraph_statistics()


def retrieve_all_tenant_graphs():
graphs = litegraph.Graph.retrieve_all_tenant_graphs()
print(graphs)


# retrieve_all_tenant_graphs()


def delete_all_tenant_graphs():
litegraph.Graph.delete_all_tenant_graphs()
print("All tenant graphs deleted")


# delete_all_tenant_graphs()
114 changes: 112 additions & 2 deletions examples/demoLabel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
sdk = litegraph.configure(
endpoint="http://YOUR_SERVER_URL_HERE:PORT",
tenant_guid="00000000-0000-0000-0000-000000000000",
graph_guid="00000000-0000-0000-0000-000000000000",
access_key="litegraphadmin",
)

Expand Down Expand Up @@ -66,7 +67,7 @@ def enumerate_with_query_label():
print(labels)


enumerate_with_query_label()
# enumerate_with_query_label()


def update_label():
Expand Down Expand Up @@ -111,4 +112,113 @@ def exists_label():
print(exists)


exists_label()
# exists_label()


def get_all_tenant_labels():
labels = litegraph.Label.retrieve_all_tenant_labels(
tenant_guid="00000000-0000-0000-0000-000000000000"
)
print(labels)


# get_all_tenant_labels()


def get_all_graph_labels():
labels = litegraph.Label.retrieve_all_graph_labels(
tenant_guid="00000000-0000-0000-0000-000000000000",
graph_guid="00000000-0000-0000-0000-000000000000",
)
print(labels)


# get_all_graph_labels()


def get_node_labels():
labels = litegraph.Label.retrieve_node_labels(
tenant_guid="00000000-0000-0000-0000-000000000000",
graph_guid="00000000-0000-0000-0000-000000000000",
node_guid="bd74d996-4a2d-48e0-9e93-110d19dd7fb2",
)
print(labels)


# get_node_labels()


def get_edge_labels():
labels = litegraph.Label.retrieve_edge_labels(
tenant_guid="00000000-0000-0000-0000-000000000000",
graph_guid="00000000-0000-0000-0000-000000000000",
edge_guid="4015a4e1-b744-4727-ab7e-cd0fbc7fd8b8",
)
print(labels)


# get_edge_labels()


def delete_all_tenant_labels():
litegraph.Label.delete_all_tenant_labels(
tenant_guid="00000000-0000-0000-0000-000000000000"
)
print("All tenant labels deleted")


delete_all_tenant_labels()


def delete_all_graph_labels():
litegraph.Label.delete_all_graph_labels(
tenant_guid="00000000-0000-0000-0000-000000000000",
graph_guid="00000000-0000-0000-0000-000000000000",
)
print("All graph labels deleted")


delete_all_graph_labels()


def delete_graph_labels():
litegraph.Label.delete_graph_labels(
tenant_guid="00000000-0000-0000-0000-000000000000",
graph_guid="00000000-0000-0000-0000-000000000000",
)
print("Graph labels deleted")


delete_graph_labels()


def delete_node_labels():
litegraph.Label.delete_node_labels(
tenant_guid="00000000-0000-0000-0000-000000000000",
graph_guid="00000000-0000-0000-0000-000000000000",
node_guid="17155e85-9c9d-481e-a4e2-14d386fbe225",
)
print("Node labels deleted")


# delete_node_labels()


def delete_edge_labels():
litegraph.Label.delete_edge_labels(
tenant_guid="00000000-0000-0000-0000-000000000000",
graph_guid="00000000-0000-0000-0000-000000000000",
edge_guid="dbafd244-bd7d-4668-bf1d-ca773d93058b",
)
print("Edge labels deleted")


# delete_edge_labels()


def get_graph_labels():
labels = litegraph.Label.retrieve_graph_labels()
print(labels)


# get_graph_labels()
53 changes: 53 additions & 0 deletions examples/demoNode.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,56 @@ def delete_all_node():


# delete_all_node()


def delete_all_tenant_nodes():
litegraph.Node.delete_all_tenant_nodes(
tenant_guid="00000000-0000-0000-0000-000000000000"
)
print("All tenant nodes deleted")


# delete_all_tenant_nodes()


def retrieve_all_tenant_nodes():
nodes = litegraph.Node.retrieve_all_tenant_nodes(
tenant_guid="00000000-0000-0000-0000-000000000000"
)
print(nodes)


# retrieve_all_tenant_nodes()


def retrieve_all_graph_nodes():
nodes = litegraph.Node.retrieve_all_graph_nodes(
tenant_guid="00000000-0000-0000-0000-000000000000",
graph_guid="00000000-0000-0000-0000-000000000000",
)
print(nodes)


# retrieve_all_graph_nodes()


def retrieve_most_connected_nodes():
nodes = litegraph.Node.retrieve_most_connected_nodes(
tenant_guid="00000000-0000-0000-0000-000000000000",
graph_guid="00000000-0000-0000-0000-000000000000",
)
print(nodes)


# retrieve_most_connected_nodes()


def retrieve_least_connected_nodes():
nodes = litegraph.Node.retrieve_least_connected_nodes(
tenant_guid="00000000-0000-0000-0000-000000000000",
graph_guid="00000000-0000-0000-0000-000000000000",
)
print(nodes)


# retrieve_least_connected_nodes()
Loading