102
|
1 import { Util } from "n3";
|
|
2 import { ViewConfig } from "./ViewConfig";
|
|
3
|
|
4 describe("ViewModel", () => {
|
|
5 it("gets a table description", async () => {
|
|
6 const vc = new ViewConfig();
|
|
7
|
|
8 await vc.readFromGraph(`
|
|
9 @prefix ex: <http://example.com/> .
|
|
10 @prefix demo: <http://example.com/demo/> .
|
|
11 @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
12 @prefix : <http://bigasterisk.com/netRoutes/ns#> .
|
|
13
|
|
14 <> a ex:View ; rdfs:label "repos" .
|
|
15 <> ex:table demo:table1 .
|
|
16 demo:table1
|
|
17 ex:primaryType :FilteredNic;
|
|
18 ex:joinType :Traffic .
|
|
19 `);
|
|
20 const NET = Util.prefix("http://bigasterisk.com/netRoutes/ns#");
|
|
21
|
|
22 expect(vc.tables[0].primary).toEqual(NET("FilteredNic"));
|
|
23 expect(vc.tables[0].joins).toEqual([NET("Traffic")]);
|
|
24 });
|
|
25 });
|