w3c / vc-data-integrity

W3C Data Integrity Specification
https://w3c.github.io/vc-data-integrity/
Other
40 stars 18 forks source link

Ensure that base URL is set to null when processing as RDF. #185

Closed msporny closed 12 months ago

msporny commented 1 year ago

This PR attempts to address issue #180 by ensuring that the base URL is set to null when processing as RDF.


Preview | Diff

msporny commented 1 year ago

Do we make it invalid for someone to do this: the @base JSON-LD directive is ignored in an external context file, but it is valid this way...

Hrm, what we don't want to do is allow the BASE to be set by the processor based on where the document lives, IIUC. So, setting @base in the way that you showed in your example is fine -- because the BASE won't be mis-interpreted based on location, which is what this PR is attempting to fix. That said, processors that run in non-JSON-LD mode won't process that @base definition, leading to potential interop issues, so perhaps the guidance in this PR is best in order to increase interop.

iherman commented 1 year ago

Do we make it invalid for someone to do this: the @base JSON-LD directive is ignored in an external context file, but it is valid this way...

Hrm, what we don't want to do is allow the BASE to be set by the processor based on where the document lives, IIUC. So, setting @base in the way that you showed in your example is fine -- because the BASE won't be mis-interpreted based on location, which is what this PR is attempting to fix.

Ok, I understand

That said, processors that run in non-JSON-LD mode won't process that @base definition, leading to potential interop issues, so perhaps the guidance in this PR is best in order to increase interop.

Well, this PR does not cover this specific case. A non-JSON-LD processor will have no idea what to do with @base, and it might simply ignore it. But then there is a discrepancy. My proposal would be that, beyond the text you propose in the PR, we should disallow the @base statement for VC-s (I do not think it is frequently used, so it is not a major loss).

msporny commented 12 months ago

Well, this PR does not cover this specific case. A non-JSON-LD processor will have no idea what to do with @base, and it might simply ignore it.

Yes, exactly, which is why we should probably tell authors that they "SHOULD NOT use @base".

But then there is a discrepancy. My proposal would be that, beyond the text you propose in the PR, we should disallow the @base statement for VC-s (I do not think it is frequently used, so it is not a major loss).

I have raised https://github.com/w3c/vc-data-model/issues/1266 to track this issue.

msporny commented 12 months ago

Normative, multiple reviews, changes requested and made, issues raised for remaining concern, no objections, merging.