Schema Management Routes
This section documents the schema management API endpoints.
backend.routes.schema_routes
Functions
load_global_json(filename, fallback)
Load JSON from global schema directory
load_user_json(user_id: str, filename, fallback)
Load JSON from user schema directory
Source code in backend/routes/schema_routes.py
save_user_json(user_id: str, filename, data)
Save JSON to user schema directory
Source code in backend/routes/schema_routes.py
combine_schemas(global_data: List[dict], user_data: List[dict], key_field: str = 'name') -> List[dict]
Combine global and user schemas, with user schemas taking precedence
Source code in backend/routes/schema_routes.py
get_relation_names(user_id: str, graph_id: str)
Get all relation names (global + user)
Source code in backend/routes/schema_routes.py
get_attribute_names(user_id: str, graph_id: str)
Get all attribute names (global + user)
Source code in backend/routes/schema_routes.py
get_relation_types(user_id: str, graph_id: str)
Get all relation types (global + user)
Source code in backend/routes/schema_routes.py
create_relation_type(user_id: str, graph_id: str, rt: RelationType, user: User = Depends(current_active_user))
Create a new relation type in user space
Source code in backend/routes/schema_routes.py
update_relation_type(user_id: str, graph_id: str, name: str, rt: RelationType, user: User = Depends(current_active_user))
Update a relation type in user space
Source code in backend/routes/schema_routes.py
delete_relation_type(user_id: str, graph_id: str, name: str, user: User = Depends(current_active_user))
Delete a relation type from user space
Source code in backend/routes/schema_routes.py
get_attribute_types(user_id: str, graph_id: str)
Get all attribute types (global + user)
Source code in backend/routes/schema_routes.py
create_attribute_type(user_id: str, graph_id: str, item: AttributeType, user: User = Depends(current_active_user))
Create a new attribute type in user space
Source code in backend/routes/schema_routes.py
update_attribute_type(user_id: str, graph_id: str, name: str, item: AttributeType, user: User = Depends(current_active_user))
Update an attribute type in user space
Source code in backend/routes/schema_routes.py
delete_attribute_type(user_id: str, graph_id: str, name: str, user: User = Depends(current_active_user))
Delete an attribute type from user space
Source code in backend/routes/schema_routes.py
get_node_types(user_id: str, graph_id: str)
Get all node types (global + user)
Source code in backend/routes/schema_routes.py
create_node_type(user_id: str, graph_id: str, item: NodeType, user: User = Depends(current_active_user))
Create a new node type in user space
Source code in backend/routes/schema_routes.py
update_node_type(user_id: str, graph_id: str, name: str, item: NodeType, user: User = Depends(current_active_user))
Update a node type in user space
Source code in backend/routes/schema_routes.py
delete_node_type(user_id: str, graph_id: str, name: str, user: User = Depends(current_active_user))
Delete a node type from user space
Source code in backend/routes/schema_routes.py
get_global_schemas(user_id: str)
Get all global schemas (read-only reference)
Source code in backend/routes/schema_routes.py
get_user_schemas(user_id: str)
Get user's custom schemas
Source code in backend/routes/schema_routes.py
get_combined_schemas(user_id: str)
Get combined schemas (global + user)