# HG changeset patch
# User drewp@bigasterisk.com
# Date 1647810656 25200
# Node ID 3584f24becf4e8f04da9b861c0022ccd02f1d2d8
# Parent a7519d92dbc63cd09c43ce213419053b12cacc82
cleanup
diff -r a7519d92dbc6 -r 3584f24becf4 src/layout/Layout.test.ts
--- a/src/layout/Layout.test.ts Sun Mar 20 13:33:51 2022 -0700
+++ b/src/layout/Layout.test.ts Sun Mar 20 14:10:56 2022 -0700
@@ -34,10 +34,10 @@
it("accepts a ViewConfig", async () => {
const vc = new ViewConfig();
await vc.readFromGraph(`
- @prefix ex: .
+ @prefix : .
@prefix rdfs: .
- <> a ex:View; rdfs:label "repos" .`);
+ <> a :View; rdfs:label "repos" .`);
const layout = new Layout(vc);
const lr = layout.plan(await twoStatements());
});
@@ -74,7 +74,6 @@
const vc = new ViewConfig();
await vc.readFromGraph(`
@prefix : .
- @prefix rdfs: .
<> a :View; :table [ :primaryType :T1 ] .`);
const layout = new Layout(vc);
@@ -115,8 +114,6 @@
it("makes two tables", async () => {
const vc = new ViewConfig();
await vc.readFromGraph(`
- @prefix ex: .
- @prefix rdfs: .
@prefix : .
<> a :View; :table [ :primaryType :T1 ], [ :primaryType :T2 ] .`);
@@ -146,7 +143,7 @@
]);
});
describe("joins multiple types into one table", () => {
- it("can simply merge types", async () => {
+ it("can simply display multiple types merged together", async () => {
const vc = new ViewConfig();
await vc.readFromGraph(`
@prefix ex: .
@@ -177,7 +174,7 @@
[[], [EX("big")]],
]);
});
- it("groups columns by type", async()=>{
+ it("groups columns by type", async () => {
const vc = new ViewConfig();
await vc.readFromGraph(`
@prefix ex: .
diff -r a7519d92dbc6 -r 3584f24becf4 src/layout/Layout.ts
--- a/src/layout/Layout.ts Sun Mar 20 13:33:51 2022 -0700
+++ b/src/layout/Layout.ts Sun Mar 20 14:10:56 2022 -0700
@@ -234,8 +234,7 @@
if (q.subject.equals(subj)) {
const p = q.predicate as NamedNode;
preds.push(p);
- po = po.set(p, po.get(p, []));
- po.get(p)?.push(q.object as Term);
+ po = addToValues(po, p, q.object as NamedNode);
}
});