@comunica/statistic-link-discovery
v4.0.2
Published
Comunica package that defines the statistic tracking link discovery events
Downloads
136
Readme
Comunica Statistic Link Discovery
A statistics tracker package for tracking discovered links during query execution in Comunica. This class must be added to the context with the key defined in the class.
This module is part of the Comunica framework,
Click here if you just want to query with Comunica.
Install
$ yarn add @comunica/statistic-link-discovery
Using the tracker
const QueryEngine = require('@comunica/query-sparql').QueryEngine;
const myEngine = new QueryEngine();
const statisticTracker = new StatisticLinkDiscovery();
// Print any data emitted by the tracker
statisticTracker.on((data) => console.log(data));
// Add the tracker to the context
let context = {sources: ['https://fragments.dbpedia.org/2015/en']};
context[statisticTracker.key.name] = statisticTracker;
// Execute the query
const bindingsStream = await myEngine.queryBindings(`
SELECT ?s ?p ?o WHERE {
?s ?p ?o
} LIMIT 10`, context);
bindingsStream.on('data', (binding) => {
console.log(binding.toString());
});