RDF, Typescript and Deno - Part 3a: all ahead stop

Believing I had supernatural powers
I slammed into a brick wall
(Paul Simon - Gumboots)

I had hoped to get Part 3 of this mini-series on RDF, Typescript and Deno out by now. The concepts aren’t hard to explain, and the code isn’t that complicated. But what has proved to be extremely complicated is getting the NPM library rdflib.js to import into my code.

There are various ways to use NPM modules in a Deno app. I’ve tried various approaches. None have worked so far, but the furthest I’ve got is:

// rdf-generation.ts
import { Namespace } from 'https://dev.jspm.io/npm:rdflib@2.2.7/esm'

But when I try to cache the import:

$ deno --unstable cache rdf-generation.ts
Download https://dev.jspm.io/npm:rdflib@2.2.7/esm
Download https://dev.jspm.io/npm:rdflib@2.2.7/esm/fetcher.js
Download https://dev.jspm.io/npm:rdflib@2.2.7/esm/query-to-sparql.js
Download https://dev.jspm.io/npm:rdflib@2.2.7/esm/variable.js
[... lots more downloads ...]
Download https://dev.jspm.io/npm:rdflib@2.2.7/esm/factories/factory-types.js
Check file:///home/ian/projects/personal/deno-experiments/rdf-generation.ts
error: TS2502 [ERROR]: 'thisArg' is referenced directly or indirectly in its own type annotation.
    bind<T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>;
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at asset:///lib.es5.d.ts:350:22

I think I’m going to have to seek some help!

· index · older