Skip to content

Failed to load remote context when trying to run ldo build on many shex shapes #43

@jeswr

Description

@jeswr

When trying to run npm run build on https://github.com/jeswr/microsoft-kg-as-rdf the following error consistently occurs:

> email_api_test@1.0.0 build
> ldo build --input ./shex --output ./ldo

◠ Generating LDO Documents/home/jeswr/Documents/GitHub/jeswr/email_api_test/node_modules/jsonld-context-parser/lib/ContextParser.js:722
            throw new ErrorCoded_1.ErrorCoded(`Failed to load remote context ${url}: ${e.message}`, ErrorCoded_1.ERROR_CODES.LOADING_REMOTE_CONTEXT_FAILED);
                  ^

ErrorCoded: Failed to load remote context http://www.w3.org/ns/shex.jsonld: fetch failed
    at ContextParser.load (/home/jeswr/Documents/GitHub/jeswr/email_api_test/node_modules/jsonld-context-parser/lib/ContextParser.js:722:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at runNextTicks (node:internal/process/task_queues:64:3)
    at listOnTimeout (node:internal/timers:540:9)
    at process.processTimers (node:internal/timers:514:7)
    at async ContextParser.parse (/home/jeswr/Documents/GitHub/jeswr/email_api_test/node_modules/jsonld-context-parser/lib/ContextParser.js:588:58) {
  code: 'loading remote context failed'
}

Node.js v20.11.0

I suspect the best fix would be to use a custom document loader to cache http://www.w3.org/ns/shex.jsonld and supply that context to jsonld-context-parser. A brief look indicates that the jsonld-context-parser call is coming from the https://github.com/o-development/jsonld2graphobject dependency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions