Skip to content

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

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

Open
pchampin opened this issue May 8, 2025 · 1 comment
Labels
class-4 Class-4 change

Comments

@pchampin
Copy link
Contributor

pchampin commented May 8, 2025

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
@pchampin pchampin added the class-4 Class-4 change label May 8, 2025
@dlongley
Copy link
Contributor

dlongley commented May 8, 2025

+1 for considering adding a contextLoader option that would only be used to load contexts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
class-4 Class-4 change
Projects
Status: No status
Development

No branches or pull requests

2 participants