Create WhyHow Graph from a Knowledge Table¶
In [ ]:
Copied!
# Import required libraries
import os
from whyhow import WhyHow
# Import required libraries
import os
from whyhow import WhyHow
In [ ]:
Copied!
# Define constants
FILEPATH = "../data/knowledge_table_export.json"
WORKSPACE_NAME = "knowledge_table"
GRAPH_NAME = "knowledge_table_graph"
# Define constants
FILEPATH = "../data/knowledge_table_export.json"
WORKSPACE_NAME = "knowledge_table"
GRAPH_NAME = "knowledge_table_graph"
In [ ]:
Copied!
# Initialize WhyHow client
client = WhyHow(api_key=os.environ.get("WHYHOW_API_KEY"))
# Initialize WhyHow client
client = WhyHow(api_key=os.environ.get("WHYHOW_API_KEY"))
In [ ]:
Copied!
# Create graph from knowledge table
graph_id = client.create_graph_from_knowledge_table(
file_path=FILEPATH,
workspace_name=WORKSPACE_NAME,
graph_name=GRAPH_NAME
)
# Print the created graph ID
print(f"Created graph with ID: {graph_id}")
# Create graph from knowledge table
graph_id = client.create_graph_from_knowledge_table(
file_path=FILEPATH,
workspace_name=WORKSPACE_NAME,
graph_name=GRAPH_NAME
)
# Print the created graph ID
print(f"Created graph with ID: {graph_id}")