RelationType (graph/relations.py)

AutoResearchClaw · researchclaw/knowledge/graph/relations.py · python · MIT
database, tag:knn-classified

Relation definitions for the research knowledge graph.

# Source: https://github.com/aiming-lab/AutoResearchClaw | License: MIT | Copyright 2026 Aiming Lab
# Provided via justclaw.it.com; keep this notice with the code.
"""Relation definitions for the research knowledge graph."""

from __future__ import annotations

from dataclasses import asdict, dataclass, field
from enum import Enum
from typing import Any


class RelationType(str, Enum):
    """Types of relations between entities."""

    CITES = "cites"
    EXTENDS = "extends"
    OUTPERFORMS = "outperforms"
    USES_DATASET = "uses_dataset"
    APPLIES_METHOD = "applies_method"
    EVALUATES_WITH = "evaluates_with"  # metric used for evaluation
    AUTHORED_BY = "authored_by"
    RELATED_TO = "related_to"


@dataclass
class Relation:
    """A directed edge in the knowledge graph.

    Attr

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key