# HG changeset patch # User drewp@bigasterisk.com # Date 1577748563 28800 # Node ID 648bd89f9d47b91ca385de6a3d6294a2f7dcef63 # Parent f551a089a98f553487d93470a75cf2e11758aadc sloppy fix for type imports diff -r f551a089a98f -r 648bd89f9d47 src/graph_view.ts --- a/src/graph_view.ts Sun Dec 29 19:59:08 2019 -0800 +++ b/src/graph_view.ts Mon Dec 30 15:29:23 2019 -0800 @@ -1,16 +1,18 @@ import { html, TemplateResult } from 'lit-html'; -import { Quad, Term, NamedNode, N3Store } from 'n3'; +import { Quad, Term, N3Store } from 'n3'; import { DataFactory, Util } from 'n3'; const { namedNode } = DataFactory; +import * as RDF from "rdf-js"; +type NamedNode = RDF.NamedNode; import { SuffixLabels } from './suffixLabels'; // import ns from 'n3/src/IRIs'; // const { rdf } = ns; -const rdf = { type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" }; +const rdf = { type: namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")}; type TypeToSubjs = Map>; function groupByRdfType(graph: N3Store): { byType: TypeToSubjs, untyped: Set } { - const rdfType = namedNode(rdf.type); + const rdfType = rdf.type; const byType: TypeToSubjs = new Map(); const untyped: Set = new Set(); // subjs const internSubjs = new Map(); @@ -52,7 +54,7 @@ constructor(labels: SuffixLabels) { this.labels = labels; } - getHtml(n: Term): TemplateResult { + getHtml(n: Term|NamedNode): TemplateResult { if (n.termType == "Literal") { let dtPart: any = ""; if (n.datatype) { @@ -184,7 +186,7 @@ }, subj, null, null, null); }); const predsList = Array.from(preds); - predsList.splice(predsList.indexOf(new NamedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#type')), 1); + predsList.splice(predsList.indexOf(rdf.type), 1); // also pull out label, which should be used on 1st column predsList.sort();