Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URLs are called with and without fragment identifier #139

Open
jeswr opened this issue Jun 17, 2024 · 0 comments
Open

URLs are called with and without fragment identifier #139

jeswr opened this issue Jun 17, 2024 · 0 comments

Comments

@jeswr
Copy link
Member

jeswr commented Jun 17, 2024

Issue type:

  • 🐌 Performance issue

Description:

Running

import { QueryEngine } from '@comunica/query-sparql-link-traversal';

const fetchFn = globalThis.fetch;

// @ts-ignore
globalThis.fetch = (...args) => {
    console.log(args[0]);
    if (args[0] === 'https://w3id.org/dpv') { 
        process.exit();
    }
    return fetchFn(...args);
}

async function run() {
    const engine = new QueryEngine();
    const res = await engine.queryQuads('CONSTRUCT WHERE { ?s ?p ?o . }', { sources: ['https://w3id.org/dpv#Purpose'], lenient: true });

    res.on('data', (quad) => {
    });
}

run();

Results in

$ npx ts-node lib/traverse.ts 
https://w3id.org/dpv#Purpose
https://w3id.org/dpv

Meaning that fetch is called twice on the https://w3id.org/dpv URL during traversal. I would expect the fragment part of the URL to have been stripped on the first call to the fetch function, and for the second call to not have been made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants