import fs from 'fs' ; import pkgDir from 'pkg-dir' ; import { join , resolve } from 'path' ; import type prefixes from '../prefixes' ; async function buildPath ( prefix ) { const rootDir = await pkgDir ( __dirname ) ; return resolve ( join ( rootDir ! , 'ontologies' , `${ prefix }.nq` ) ) ; } export async function loadDatasetStream ( prefix ) { return fs . createReadStream ( await buildPath ( prefix ) , { encoding : 'utf8' } ) ; }