w3c / w3c/json-ld-api

should we have a `contextLoader` option, distinct from the `documentLoader`?

Open
#658 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

substantive:class 4
Dominant language
HTML
Stars
106
Forks
40
PR merge metrics
No merged PRs in 30d

Description

Currently, the JsonLdOptions has a single loader configured, called documentLoader, which is used for two different purposes:

  • load the JSON-LD documents to be processed
  • load the contexts, when referenced by IRIs, that those documents contain

It is generally agreed that fetching arbitrary contexts from the Web is often not a good idea (as pointed out in the security and privacy considerations of JSON-LD), but this often overlooked by newcomers or even implementers.

I would argue that the conflation of the document loader and the context loader contributes to this, and that separating them in JsonLdOptions could help get the message through. In particular, it would be specified that

  • the default document loader fetches any IRI from the web
  • the default context loader does not fetch anything from the web, but may have cached version of some well-known contexts

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the JsonLdOptions definition in the JSON-LD API specification and review the linked security and privacy considerations. Determine how separate documentLoader and contextLoader options should be specified, including their defaults and handling of well-known cached contexts. Done means the API behavior and security expectations are unambiguous.

Written by the indexing model from the issue text.

Assessment

Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.