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

Unify document loading in Context Processing? #584

Open
helins opened this issue Dec 11, 2023 · 4 comments
Open

Unify document loading in Context Processing? #584

helins opened this issue Dec 11, 2023 · 4 comments

Comments

@helins
Copy link

helins commented Dec 11, 2023

The Context Processing Algorithm deals with dereferencing remote documents at 2 occasions: 5.2 and 5.6. Both look very similar to the point where I do not understand why there are seemingly differences:

  • 5.2.1 details how resolving the context string against base URL might fail ; 5.6.3 does not mention anything about failure when resolving the value of @import against base URL
  • 5.2.4 is very explicit about not dereferencing a URL that has already been dereferenced ; 5.6.4 goes straight into dereferencing without any further consideration
@gkellogg
Copy link
Member

5.6.5 says what to do if loading the document fails; this would include cases where the URL is invalid.

5.2.4 is explicit about not dereferencing again, due to potential recursion loops. I don't think that the @import case had the same concern (@dlongley may recall), but implementations are generally encouraged to cache the result of retrieving external documents, which could be considered an expected optimization.

@helins
Copy link
Author

helins commented Dec 12, 2023

Thanks @gkellogg. I guess not but would it make sense at all to also replicate 5.2.3 in 6, WRT to remote contexts?

@pchampin pchampin moved this to Discuss-Call in JSON-LD Management May 15, 2024
@pchampin
Copy link
Contributor

5.6.5 says what to do if loading the document fails; this would include cases where the URL is invalid.

True, but that's a different error. 5.2.1 tells you what to do if the base URL is invalid, and therefore resolving the context URL against it is not possible. 5.6.3 does not tell you what to do in this situation... @helins has a point, we should probably render both steps more homogeneous.

implementations are generally encouraged to cache the result of retrieving external documents, which could be considered an expected optimization.

I agree, but again, the fact that it is explicitly mentioned in one part, and not in another, may confuse implementers (as demonstrated by this issue).

@gkellogg
Copy link
Member

Discussed on [today's call](https://json-ld.org/minutes/2024-07-10/#52)
#584 -> Issue 584 Unify document loading in Context Processing? (by helins) [spec:editorial] [ErratumRaised]
Gregg Kellogg: Perhaps a chance to DRY up the text.
Pierre-Antoine Champin: I'm hesitant to extract the common functionality, so maybe just go for consistency so as not to disrupt the flow of the document.

@gkellogg gkellogg moved this from Discuss-Call to Errata in JSON-LD Management Jul 24, 2024
@gkellogg gkellogg added the class-2 Class-2 change label Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Errata
Development

No branches or pull requests

3 participants