comunica / comunica-feature-link-traversal

📬 Comunica packages for link traversal-based query execution
Other
8 stars 11 forks source link

Occasional incorrect result count in browser compared to Node #105

Open jeswr opened 1 year ago

jeswr commented 1 year ago

Issue type:


Description:

If I execute the following in node

import { QueryEngine } from '@comunica/query-sparql-link-traversal-solid';
import { Session } from '@inrupt/solid-client-authn-node';

async function main() {
  const session = new Session();

  await session.login({
    clientName: "comunica-link-traversal",
    clientId: CLIENT_ID,
    clientSecret: CLIENT_SECRET,
    oidcIssuer: "https://login.inrupt.com/"
  });

  const engine = new QueryEngine();

  const bindings = await engine.queryBindings('SELECT DISTINCT * WHERE { ?s ?p ?o }', {
    sources: [ 'https://id.inrupt.com/jeswrtest11' ],
    lenient: true,
  });

  let i = 0;

  bindings.on('data', d => { console.log(`[${i++}] [${d.get('s').value}] [${d.get('p').value}] [${d.get('o').value}]`) })
}

main();

Then the engine traverses outside my Pod and was up to 20_000 results before I stopped it.

In contrast executing https://comunica.github.io/comunica-feature-link-traversal-web-clients/builds/solid-default/#datasources=https%3A%2F%2Fid.inrupt.com%2Fjeswrtest11&query=SELECT%20DISTINCT%20*%20WHERE%20%7B%0A%20%20%20%20%3Fs%20%3Fp%20%3Fo%20.%0A%7D in the browser (whilst logged into the same account) terminates after returning the 165 triples in my Pod.


Environment:

Crash log:

github-actions[bot] commented 1 year ago

Thanks for reporting!

rubensworks commented 1 year ago

The order in which links are followed, and the order of results, are indeed non-deterministic. But the number of results shouldn't be indeed.

rubensworks commented 1 year ago

Also encountering this problem in the SolidBench browser tests that are run in the CI. Sometimes the actual number results are off by one compared to the expected count.

Note to self: once this is fixed, we should remove the workaround that ignores the exit code of the karma browser tests