Skip to content

Commit

Permalink
add id attr
Browse files Browse the repository at this point in the history
  • Loading branch information
shahules786 committed Jun 18, 2024
1 parent c8e94be commit c417a61
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ragas/testsetv3/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,17 @@ class Relationship(ObjectType):
for relationship in node if target.id == node.id then it means that the relationship is incoming to the node
"""

id = String(required=True)
source = Field(lambda: Node)
target = Field(lambda: Node)
label = String()
properties = Field(JSONString)

def __init__(self, id=None, **kwargs):
if id is None:
id = str(uuid.uuid4())
super().__init__(id=id, **kwargs)


class Node(ObjectType):
"""Represents a node in a graph with associated properties.
Expand Down

0 comments on commit c417a61

Please sign in to comment.