mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-03 23:11:00 +02:00
Merge commit 'deff028fed' as 'ai-context/trustgraph-client'
This commit is contained in:
commit
05d87964c2
27 changed files with 6278 additions and 0 deletions
40
ai-context/trustgraph-client/src/models/Triple.ts
Normal file
40
ai-context/trustgraph-client/src/models/Triple.ts
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
// Term type discriminators matching the wire format
|
||||
// i = IRI, b = BLANK node, l = LITERAL, t = TRIPLE (reified)
|
||||
export type TermType = "i" | "b" | "l" | "t";
|
||||
|
||||
export interface IriTerm {
|
||||
t: "i";
|
||||
i: string;
|
||||
}
|
||||
|
||||
export interface BlankTerm {
|
||||
t: "b";
|
||||
d: string;
|
||||
}
|
||||
|
||||
export interface LiteralTerm {
|
||||
t: "l";
|
||||
v: string;
|
||||
dt?: string; // datatype
|
||||
ln?: string; // language
|
||||
}
|
||||
|
||||
export interface TripleTerm {
|
||||
t: "t";
|
||||
tr?: Triple;
|
||||
}
|
||||
|
||||
export type Term = IriTerm | BlankTerm | LiteralTerm | TripleTerm;
|
||||
|
||||
export interface PartialTriple {
|
||||
s?: Term;
|
||||
p?: Term;
|
||||
o?: Term;
|
||||
}
|
||||
|
||||
export interface Triple {
|
||||
s: Term;
|
||||
p: Term;
|
||||
o: Term;
|
||||
g?: string; // graph (renamed from direc to match backend)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue