import { IActorRdfDereferenceOutput } from "@comunica/bus-rdf-dereference" ; import { join } from "path" ; import * as RDF from "@rdfjs/types" ; import { IDereferenceOptions , RdfDereferencerBase } from "./RdfDereferencerBase" ; /**
 * An RdfDerefencer can dereference URLs to RDF streams, using any RDF serialization.
 */ export class RdfDereferencer < Q extends RDF . BaseQuad = RDF . Quad > extends RdfDereferencerBase < Q > { param { string } url param { IDereferenceOptions } options return { IActorRdfDereferenceOutput } public dereference ( url , options = { } ) { if ( ! url . startsWith ( 'http' ) ) { if ( ! options . localFiles ) { return Promise . reject ( new Error ( 'Tried to dereference a local file without enabling localFiles option: ' + url ) ) ; } else if ( ! url . startsWith ( '/' ) ) { url = join ( process . cwd ( ) , url ) ; } } return super . dereference ( url , options ) ; } }