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

Section 4 "Model" uses a non-robust Link detection algorithm which does not consider properties #637

Open
trwnh opened this issue Feb 9, 2025 · 2 comments
Labels
Needs primer page Need to add a page at https://www.w3.org/wiki/Activity_Streams/Primer on this topic Next version Things that should probably be resolved in a next version of AS2

Comments

@trwnh
Copy link

trwnh commented Feb 9, 2025

https://www.w3.org/TR/activitystreams-core/#model

A JSON object in the Activity Streams 2.0 document is a Link if either: (a) the object contains a type property whose value includes "Link" or (b) any of the types included in the value of the type property are defined as extensions of Link (see Mention for instance); otherwise the JSON object is considered an instance or extension of Object.

We should be able to infer that something is a Link if it has properties of a Link, mainly href. But as written above, the algorithm would declare the following to be an Object:

{
  "href": "https://example.com"
}

The algorithm described above also fails to account for logical inferencing, where the domain of href is specified to be Link.

I think that the paragraph here should be errata'd to add:

... or (c) the object contains a property whose domain is defined as "Link" (see href for instance)

@evanp
Copy link
Collaborator

evanp commented Feb 14, 2025

I understand the reasoning here; this appears to be a Link object with a missing type property. But, at least according to the language you quoted, it is an Object object with a disallowed href property.

{
  "href": "https://example.com"
}

If we want to make it have a different type, Link, in later versions, that would technically be a backwards-incompatible. Understandably, not a lot of processors are going to depend on this kind of lack of information and default processing, but it's technically a consistent rule within AS2 to have a default type of Object if none is provided.

The simple answer is to add the type property for clarity. Another answer would be to change the inference rules here, which we can consider in a next version.

@evanp
Copy link
Collaborator

evanp commented Feb 14, 2025

We have some problems when the untyped object has properties from both Link and Object:

{
  "href": "https://example.com",
  "generator": "https://software.example/application"
}

@evanp evanp added Needs primer page Need to add a page at https://www.w3.org/wiki/Activity_Streams/Primer on this topic Next version Things that should probably be resolved in a next version of AS2 labels Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs primer page Need to add a page at https://www.w3.org/wiki/Activity_Streams/Primer on this topic Next version Things that should probably be resolved in a next version of AS2
Projects
None yet
Development

No branches or pull requests

2 participants