Skip to content

Commit c5958fb

Browse files
authored
Update and rename CNLTF.md to CanonLT.md
1 parent cce32d9 commit c5958fb

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

doc/CNLTF.md doc/CanonLT.md

+25
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,31 @@
1212
- **Direct Reference by Identifier:**
1313
Nodes with unique identifiers can be directly referenced using their identifier.
1414

15+
```typescript
16+
17+
// A type alias for values that can either be a URI or a Node.
18+
type NodeOrRef = URI | Node;
19+
20+
// A type alias for node entries which may be a single NodeOrRef or an array of them.
21+
type NodeEntry = NodeOrRef | NodeOrRef[];
22+
23+
interface CanonLT {
24+
// The root can be a single NodeOrRef or an array of NodeOrRef.
25+
root: NodeOrRef | NodeOrRef[];
26+
27+
// A mapping of terms to their corresponding Node objects.
28+
nodes: Map<URI, Node | Node[]>;
29+
}
30+
31+
interface Node {
32+
// The type of the node, represented as a single URI.
33+
type: URI;
34+
35+
// A mapping of URIs to node entries, which can be direct node references, URIs, or arrays thereof.
36+
entries: Map<URI, NodeEntry>;
37+
}
38+
39+
```
1540

1641
```json
1742
{

0 commit comments

Comments
 (0)