mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 00:16:23 +02:00
* Changed schema for Value -> Term, majorly breaking change * Following the schema change, Value -> Term into all processing * Updated Cassandra for g, p, s, o index patterns (7 indexes) * Reviewed and updated all tests * Neo4j, Memgraph and FalkorDB remain broken, will look at once settled down
31 lines
861 B
Python
31 lines
861 B
Python
from dataclasses import dataclass, field
|
|
|
|
from ..core.primitives import Term, Triple
|
|
from ..core.metadata import Metadata
|
|
from ..core.topic import topic
|
|
|
|
############################################################################
|
|
|
|
# Entity context are an entity associated with textual context
|
|
|
|
@dataclass
|
|
class EntityContext:
|
|
entity: Term | None = None
|
|
context: str = ""
|
|
|
|
# This is a 'batching' mechanism for the above data
|
|
@dataclass
|
|
class EntityContexts:
|
|
metadata: Metadata | None = None
|
|
entities: list[EntityContext] = field(default_factory=list)
|
|
|
|
############################################################################
|
|
|
|
# Graph triples
|
|
|
|
@dataclass
|
|
class Triples:
|
|
metadata: Metadata | None = None
|
|
triples: list[Triple] = field(default_factory=list)
|
|
|
|
############################################################################
|