Open learner-long-life opened 2 months ago
Working with @pointmeathesky , adding a new table to the schema may be on the way to solving this
model Edge {
id Int @id @default(autoincrement())
parentId Int
childId Int
startIndex Int
endIndex Int
// edgeString EdgeStringFragment[]
SubTree SubTree? @relation(fields: [subTreeId], references: [id])
subTreeId Int?
}
// One row per character of input string
model InputCharacters {
id Int @id @default(autoincrement())
character String
}
model SubTree {
id Int @id @default(autoincrement())
edges Edge[]
}
running npx prisma format
and npx prisma validate
to add the opposite relation between Edge
and SubTree
. There may be a better name than SubTree
.
In constructing the following tree:
The edge going from 6 to 2, which string
bxac
, and the edge going from 1 to 4, with the same string, are stored as duplicate edges in the database.How to denote that these two edges are suffix links of identical subtrees, for purposes of visual rendering? (And possibly some other purpose).