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

Test that every JSON-LD file has the minimum @context values #50

Open
jernst opened this issue May 1, 2024 · 4 comments
Open

Test that every JSON-LD file has the minimum @context values #50

jernst opened this issue May 1, 2024 · 4 comments
Labels
protocol-level A test that requires a Node that can craft / inspect in detail protocol-level data

Comments

@jernst
Copy link
Member

jernst commented May 1, 2024

@steve-bate
Copy link
Member

The "https://w3id.org/security/v1" @context is only required in the Mastodon-compatible Actor documents (and maybe other implementation variants that use those terms). It's not needed (for any implementation I know) in non-Actor documents.

There is no hard requirement for "https://www.w3.org/ns/activitystreams" to be in the @context or that there is any @context at all. AS2 Section 2.1:

When a JSON-LD enabled Activity Streams 2.0 implementation encounters a JSON document identified using the " application/activity+json" MIME media type, and that document does not contain a @context property whose value includes a reference to the normative Activity Streams 2.0 JSON-LD @context definition, the implementation must assume that the normative @context definition still applies.

The requirement for the explicit "https://www.w3.org/ns/activitystreams" URL is a Mastodon-ism, AFAICT. Mastodon requires that string in the @context section. IIRC, it does not check for "https://w3id.org/security/v1" and will successfully process actor documents without it.

Non-LD consumers should probably ignore the @context section. I haven't seen any evidence that using "https://stevebate.dev/ns/activitystreams" as a peusdo content type indicator (like Mastodon does) was the intent of the recommendation authors.

@jernst
Copy link
Member Author

jernst commented May 3, 2024

So is there a weaker form of the test we should do instead, and if so, which, or none at all?

@steve-bate
Copy link
Member

I’ll think about it. One option is to do JSON-LD expansion with the implicit context handling policy defined in AS2 and check for “blank node” properties that indicate they weren’t defined in any context entries. However, if the goal is to ensure Mastodon compatibility, we’d want to go ahead do the explicit context URL check.

@jernst
Copy link
Member Author

jernst commented May 3, 2024

Perfectly fine to leave this as an open issue, not everything has to be solved in the short term.

@jernst jernst added the protocol-level A test that requires a Node that can craft / inspect in detail protocol-level data label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
protocol-level A test that requires a Node that can craft / inspect in detail protocol-level data
Projects
None yet
Development

No branches or pull requests

2 participants