Collaborative Workspaces
Olytix Core Workspaces enable teams to collaborate on data analysis through shared query libraries, version control, comments, and seamless sharing capabilities.
Overview
┌─────────────────────────────────────────────────────────────────────┐
│ WORKSPACE ARCHITECTURE │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ ┌───────────────────────────────────────────────────────────── ┐ │
│ │ WORKSPACE │ │
│ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │
│ │ │ MEMBERS │ │ FOLDERS │ │ QUERIES │ │ │
│ │ │ │ │ │ │ │ │ │
│ │ │ Owner │ │ /analytics │ │ Revenue Q1 │ │ │
│ │ │ Admin │ │ /marketing │ │ User Growth │ │ │
│ │ │ Editor │ │ /finance │ │ Churn Rate │ │ │
│ │ │ Viewer │ │ │ │ │ │ │
│ │ └─────────────┘ └─────────────┘ └─────────────┘ │ │
│ └─────────────────────────────────────────────────── ──────────┘ │
│ │ │
│ ┌───────────────────┼───────────────────┐ │
│ ▼ ▼ ▼ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ VERSIONS │ │ COMMENTS │ │ SHARING │ │
│ │ │ │ │ │ │ │
│ │ v1 → v2 → │ │ Discussions │ │ Links │ │
│ │ Compare │ │ Mentions │ │ Permissions │ │
│ │ Rollback │ │ Threads │ │ Export │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────┘
Key Features
Team Workspaces
Organize work by team, project, or function:
| Workspace Type | Description | Use Case |
|---|---|---|
| Personal | Private to one user | Individual analysis |
| Team | Shared with a team | Department collaboration |
| Project | Focused on a project | Cross-functional initiatives |
| Public | Visible to all users | Company-wide resources |
Member Roles
| Role | Permissions |
|---|---|
| Owner | Full control, can delete workspace |
| Admin | Manage members, settings, all queries |
| Editor | Create, edit, delete own queries |
| Viewer | View queries and results only |
Query Library
- Save queries with descriptions and tags
- Organize in folders and subfolders
- Search across all workspace queries
- Star frequently used queries
- Track usage statistics
Version Control
- Automatic versioning on every save
- Compare versions side-by-side
- Rollback to previous versions
- Version notes for documentation
Collaboration Features
- Comments on queries with @mentions
- Threaded discussions for context
- Notifications for activity
- Activity feed for workspace
Usage
Creating a Workspace
from olytix-core.workspaces.service import WorkspaceService
from olytix-core.workspaces.core.models import WorkspaceType
service = WorkspaceService()
# Create a team workspace
workspace = await service.create_workspace(
name="Analytics Team",
owner_id="user_123",
workspace_type=WorkspaceType.TEAM,
description="Shared analytics queries and dashboards"
)
Managing Members
from olytix-core.workspaces.core.models import MemberRole
# Invite a member
member = await service.invite_member(
workspace_id=workspace.id,
user_id="analyst_456",
role=MemberRole.EDITOR,
invited_by="user_123"
)
# Update role
await service.update_member_role(
workspace_id=workspace.id,
user_id="analyst_456",
new_role=MemberRole.ADMIN,
updated_by="user_123"
)
# Remove member
await service.remove_member(
workspace_id=workspace.id,
user_id="analyst_456",
removed_by="user_123"
)
Saving Queries
from olytix-core.workspaces.core.models import SavedQuery
# Save a query
query = await service.save_query(
workspace_id=workspace.id,
name="Monthly Revenue by Region",
description="Shows revenue breakdown by region for the current month",
query_definition={
"measures": ["Orders.revenue"],
"dimensions": ["Orders.region"],
"timeDimensions": [{
"dimension": "Orders.created_at",
"granularity": "month",
"dateRange": "This month"
}]
},
folder_path="/finance/revenue",
tags=["revenue", "regional", "monthly"],
created_by="user_123"
)
Version Control
# Update a query (creates new version)
updated = await service.update_query(
query_id=query.id,
query_definition={...new definition...},
change_notes="Added year-over-year comparison",
updated_by="user_123"
)
# List versions
versions = await service.list_query_versions(query_id=query.id)
# Compare versions
diff = await service.compare_versions(
query_id=query.id,
version_a=1,
version_b=3
)
# Rollback to previous version
await service.rollback_query(
query_id=query.id,
target_version=2,
rolled_back_by="user_123"
)
Comments & Discussions
# Add a comment
comment = await service.add_comment(
query_id=query.id,
content="Great query! Can we add a filter for enterprise customers?",
author_id="analyst_456"
)
# Reply to a comment
reply = await service.add_comment(
query_id=query.id,
content="@user_123 Done! Added customer_segment filter.",
author_id="analyst_456",
parent_id=comment.id
)
# Get comments thread
comments = await service.get_comments(query_id=query.id)
Sharing
# Create a share link
link = await service.create_share_link(
query_id=query.id,
created_by="user_123",
expires_in_days=30,
allow_copy=True,
require_login=False
)
# Share with specific users
await service.share_with_users(
query_id=query.id,
user_ids=["external_user_789"],
permission="view",
shared_by="user_123"
)
Export
from olytix-core.workspaces.export.formats import ExportFormat
# Export query results
result = await service.export_query(
query_id=query.id,
format=ExportFormat.CSV,
include_metadata=True
)
# Available formats: CSV, JSON, XLSX, PDF
API Endpoints
Workspace Management
# Create workspace
POST /api/v1/workspaces
{
"name": "Analytics Team",
"type": "team",
"description": "Shared analytics workspace"
}
# List user's workspaces
GET /api/v1/workspaces
# Get workspace details
GET /api/v1/workspaces/<workspace_id>
# Update workspace
PATCH /api/v1/workspaces/<workspace_id>
# Archive workspace
POST /api/v1/workspaces/<workspace_id>/archive
Member Management
# List members
GET /api/v1/workspaces/<workspace_id>/members
# Invite member
POST /api/v1/workspaces/<workspace_id>/members
{
"user_id": "analyst_456",
"role": "editor"
}
# Update member role
PATCH /api/v1/workspaces/<workspace_id>/members/<user_id>
{
"role": "admin"
}
# Remove member
DELETE /api/v1/workspaces/<workspace_id>/members/<user_id>
Query Library
# List queries
GET /api/v1/workspaces/<workspace_id>/queries?
folder=/finance&
tags=revenue&
search=monthly
# Create query
POST /api/v1/workspaces/<workspace_id>/queries
{
"name": "Monthly Revenue",
"description": "...",
"query_definition": {...},
"folder_path": "/finance",
"tags": ["revenue"]
}
# Get query
GET /api/v1/workspaces/<workspace_id>/queries/<query_id>
# Update query
PATCH /api/v1/workspaces/<workspace_id>/queries/<query_id>
# Delete query
DELETE /api/v1/workspaces/<workspace_id>/queries/<query_id>
# Run query
POST /api/v1/workspaces/<workspace_id>/queries/<query_id>/run
Version Control
# List versions
GET /api/v1/queries/<query_id>/versions
# Get specific version
GET /api/v1/queries/<query_id>/versions/<version>
# Compare versions
GET /api/v1/queries/<query_id>/versions/compare?a=1&b=3
# Rollback
POST /api/v1/queries/<query_id>/rollback
{
"target_version": 2
}
Comments
# List comments
GET /api/v1/queries/<query_id>/comments
# Add comment
POST /api/v1/queries/<query_id>/comments
{
"content": "Great analysis!",
"parent_id": null
}
# Update comment
PATCH /api/v1/queries/<query_id>/comments/<comment_id>
# Delete comment
DELETE /api/v1/queries/<query_id>/comments/<comment_id>
Sharing
# Create share link
POST /api/v1/queries/<query_id>/share-links
{
"expires_in_days": 30,
"allow_copy": true
}
# List share links
GET /api/v1/queries/<query_id>/share-links
# Revoke share link
DELETE /api/v1/queries/<query_id>/share-links/<link_id>
# Access shared query
GET /api/v1/shared/<share_token>
Notifications
Users receive notifications for:
| Event | Recipients | Channel |
|---|---|---|
| Added to workspace | New member | Email, In-app |
| Query shared | Share recipients | Email, In-app |
| Comment added | Query creator, @mentioned | In-app |
| Query updated | Query followers | In-app |
| Role changed | Affected member | Email, In-app |
Notification Preferences
await service.update_notification_preferences(
user_id="user_123",
preferences={
"email_on_mention": True,
"email_on_share": True,
"email_digest": "daily", # none, daily, weekly
"in_app_all": True
}
)
Search & Discovery
Full-Text Search
results = await service.search_queries(
workspace_id=workspace.id,
query="revenue by region",
filters={
"tags": ["revenue"],
"folder": "/finance",
"created_after": "2024-01-01"
},
sort_by="relevance" # relevance, recent, popular
)
Query Discovery
# Get popular queries
popular = await service.get_popular_queries(
workspace_id=workspace.id,
time_period="last_30_days",
limit=10
)
# Get recent queries
recent = await service.get_recent_queries(
user_id="user_123",
limit=20
)
# Get recommended queries
recommended = await service.get_recommended_queries(
user_id="user_123",
based_on="usage_patterns"
)
Folder Organization
Workspace: Analytics Team
├── /revenue
│ ├── Monthly Reports
│ ├── Regional Analysis
│ └── Product Performance
├── /customers
│ ├── Segmentation
│ ├── Churn Analysis
│ └── Lifetime Value
├── /operations
│ ├── Inventory
│ └── Fulfillment
└── /archived
└── Q4 2023 Reports
Folder Operations
# Create folder
await service.create_folder(
workspace_id=workspace.id,
path="/revenue/quarterly",
created_by="user_123"
)
# Move query to folder
await service.move_query(
query_id=query.id,
new_folder="/revenue/quarterly"
)
# List folder contents
contents = await service.list_folder(
workspace_id=workspace.id,
path="/revenue"
)
Best Practices
Workspace Organization
- One workspace per team/project: Clear boundaries
- Consistent folder structure: Easy navigation
- Meaningful names: Descriptive query titles
- Tag consistently: Enable discovery
Collaboration
- Document queries: Add descriptions and notes
- Use version notes: Explain changes
- Comment proactively: Share context
- Review before sharing: Validate results
Security
- Least privilege: Start with viewer role
- Audit sharing: Review share links periodically
- Archive unused: Don't delete, archive
- Monitor access: Review member list regularly
Next Steps
- Query Assistant - Natural language querying
- Semantic Queries - Query fundamentals
- API Reference - Full API documentation