# HG changeset patch # User drewp@bigasterisk.com # Date 1642048017 28800 # Node ID 955cde1550c300708d20581203272cacc15d9407 # Parent 8db5ba7e12b9866b90dcf71fe48a18e8f5e1a8c4 start the View work: parse view document diff -r 8db5ba7e12b9 -r 955cde1550c3 demo/public/repos.n3 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/demo/public/repos.n3 Wed Jan 12 20:26:57 2022 -0800 @@ -0,0 +1,8 @@ +@prefix : . +@prefix demo: . +@prefix rdfs: . + + +<> a :View ; rdfs:label "repos" . +<> :table demo:table1 . +demo:table1 :showsType :Repo . diff -r 8db5ba7e12b9 -r 955cde1550c3 src/graph_view.ts --- a/src/graph_view.ts Wed Jan 12 16:53:44 2022 -0800 +++ b/src/graph_view.ts Wed Jan 12 20:26:57 2022 -0800 @@ -7,6 +7,7 @@ predsForSubj, TypeToSubjs, } from "./tabulate"; +import { View } from "./view_loader"; const { namedNode } = DataFactory; @@ -72,10 +73,12 @@ export class GraphView { url: string; + view: View; graph: Store; nodeDisplay: NodeDisplay; - constructor(url: string, graph: Store) { + constructor(url: string, viewUrl: string, graph: Store) { this.url = url; + this.view = new View(viewUrl); this.graph = graph; const labels = new SuffixLabels(); @@ -206,12 +209,18 @@ `; } - makeTemplate(): TemplateResult { + async makeTemplate(): Promise { + await this.view.ready; const { byType, typedSubjs, untypedSubjs } = groupByRdfType(this.graph); - + let viewTitle = html` (no view)`; + if (this.view.url) { + viewTitle = html` using view ${this.view.label()}`; + } return html`
-

Current graph (${this.url})

+

+ Current graph (${this.url})${viewTitle} +