Last active
July 31, 2022 08:29
-
-
Save jeswr/c350295c199f2ab13c97d79b87568812 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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