-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into COG-970-refactor-tokenizing
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from datetime import datetime, timezone | ||
|
||
from sqlalchemy import Column, DateTime, Float, Integer, ARRAY, UUID | ||
|
||
from cognee.infrastructure.databases.relational import Base | ||
from uuid import uuid4 | ||
|
||
|
||
class GraphMetricData(Base): | ||
__tablename__ = "graph_metric_table" | ||
|
||
# TODO: Change ID to reflect unique id of graph database | ||
id = Column(UUID, primary_key=True, default=uuid4) | ||
num_tokens = Column(Integer) | ||
num_nodes = Column(Integer) | ||
num_edges = Column(Integer) | ||
mean_degree = Column(Float) | ||
edge_density = Column(Float) | ||
num_connected_components = Column(Integer) | ||
sizes_of_connected_components = Column(ARRAY(Integer)) | ||
num_selfloops = Column(Integer, nullable=True) | ||
diameter = Column(Integer, nullable=True) | ||
avg_shortest_path_length = Column(Float, nullable=True) | ||
avg_clustering = Column(Float, nullable=True) | ||
|
||
created_at = Column(DateTime(timezone=True), default=lambda: datetime.now(timezone.utc)) | ||
updated_at = Column(DateTime(timezone=True), onupdate=lambda: datetime.now(timezone.utc)) |