Skip to content

Instantly share code, notes, and snippets.

@jeswr
Last active July 31, 2022 08:29
Show Gist options
  • Save jeswr/c350295c199f2ab13c97d79b87568812 to your computer and use it in GitHub Desktop.
Save jeswr/c350295c199f2ab13c97d79b87568812 to your computer and use it in GitHub Desktop.
import { QueryEngine } from '@comunica/query-sparql-solid';
(async () => {
const qpfEndpoint = 'https://fragments.dbpedia.org/2016-04/en';
const myEngine = new QueryEngine();
const query = '?s ?p ?o'
const logStream = await myEngine.queryBindings(`
PREFIX dcterms: <http://purl.org/dc/terms/>
SELECT * WHERE {
?s ?p ?o
}`, {
sources: ['https://fragments.dbpedia.org/2016-04/en'],
});
console.log('awaiting data')
let i = 0;
logStream.on('data', d => {
console.log(`p: [${d.get('p').value}] ${i++}`);
});
await new Promise<void>(resolve => {
logStream.on('end', () => {
console.log('ended');
resolve();
});
})
console.log('done')
// The bug occurs on a *new QPF page*.
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment