Skip to content

URLs are called with and without fragment identifier #139

@jeswr

Description

@jeswr

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions