w3c / activitystreams

Activity Streams 2.0
https://www.w3.org/TR/activitystreams-core/
Other
285 stars 60 forks source link

Document usage of Link in places where it is not semantically clear #572

Closed trwnh closed 3 months ago

trwnh commented 11 months ago

Please Indicate One:

Please Describe the Issue:

During issue triage, a possible usage of Link was cited as describing the actor of a tweet, as a sort of way of porting in data from non-AS2 sources. There are several places where Link is allowed, typically denoted by a range of Object | Link or similar. It would be a good idea to review such uses of Link and provide guidance, because some of them can be unexpected and confusing.

trwnh commented 11 months ago

the ones that definitely make sense

the ones that might make sense

the ones that need to be clarified

steve-bate commented 11 months ago

the ones that might make sense

  • ...
  • closed

I'm curious, what's the intended use case for Object | Link for closed? Someone asked about this on the Fediverse and I didn't know the answer. It's not consistent with the normative AP/AS2 JSON-LD context.

the ones that need to be clarified

  • actor (how does a Link perform an activity?)
  • audience / bto / bcc / cc / to (what does it mean to address a Link?)
  • current / next / prev / first / last (generally supposed to be CollectionPage)
  • partOf (generally supposed to be Collection)

In general, can't a Link be used anywhere an Object reference could be used? A Link is an "indirect, qualified reference to a resource" (emphases mine). If one wants to add properties to an Object URI, then a Link represents the reified form of that reference where additional information can be included (the reference can be qualified). As an indirect reference, it's not correct to think of the Link as equivalent to the referent. With actor, for example, it's not the Link that acted, it's the referent. Maybe there are multiple actors for an activity, a primary one and others playing secondary roles. Link entities could be used to qualify those roles (co-author, editor, ...).

The Link.href is xsd:anyURI data type so it may or may not refer to an AS2 Object. However, this can be disambiguated by specifying the mediaType. In most of the examples you gave, I'd think it's an error if it's not qualified as an AS2 mime type (referencing an Object).

trwnh commented 10 months ago

the issue with closed is described in #542 -- the intent is to allow marking which resource is the reason something was closed, rather than just a timestamp or a boolean. for example, "issue 123 was closed by pr 124"

as for Link being indirect and qualified, my understanding is that the primary use case of a Link is to provide metadata about that reference, such as the link relation in rel. but aside from that, it's still unclear how to interpret or handle encountering a Link in those properties. pointing directly to a graph node makes sense, but indirectly pointing to some resource makes you wonder why the indirection even exists. see also #498 for ambiguity around Links

steve-bate commented 10 months ago

the issue with closed is described in #542 -- the intent is to allow marking which resource is the reason something was closed, rather than just a timestamp or a boolean. for example, "issue 123 was closed by pr 124"

(Note that closed is only defined for Question. I assume "issue" is being modeled as a Question in your example.)

Based on the vocabulary document commit history, when closed was added to the rec, only Object | Link was specified as the range in the Vocabulary document and xsd:dateString was defined as the @type in the JSON-LD context (commit). The discussion in the related issue only mentions a closed timestamp. Based on this, it seems like the initialObject | Link range may have been a mistake.

Years later, xsd:dateTime | xsd:boolean was added (commit). It was added without any issue reference and I can't find any related discussion in the WG transcripts. However, it's relatively easy to guess the rational (at least, for adding xsd:dateTime).

I think it would be better to fix the property range definition rather than trying to find a JSON-LD kludge to compensate for what appears to be a mistake. The xsd:dateTime type in the JSON-LD context is consistent with the AS2 Vocabulary definition of similar properties like published, updated, etc. One option is to make the Vocabulary consistent with these similar properties and with the JSON-LD context and define a new property (not aliased), closedBy (or closeReason or whatever), that supports an Object|Link reference.

makes you wonder why the indirection even exists

I gave an example earlier of where it could potentially be used with Actor resources. The fact that Object | Link is so prevalent in the Vocabulary ranges strongly implies to me that indirect Links to Objects (resources) was the primary (but not exclusive) intent.

cristianolongoodhl commented 10 months ago
* `audience` / `bto` / `bcc` / `cc` / `to` (what does it mean to address a Link?)

I don't know if it is the most appropriate place for these questions, however I think it is closely related to this issue. Suppose that we have an activity a linked to a resource l of type Link through the property to. Now let l has the property href with a resource r as value. Then l should be considered a member of the primary audience of a? And r?

evanp commented 10 months ago

I think the best case here is to discuss at a high level why and how we would use Link objects for these parts of AS2. I'll add a primer page.

https://www.w3.org/wiki/Activity_Streams/Primer/Link_type

cristianolongoodhl commented 10 months ago

Thus, excluding image and icon, when a Link instance is used as value (object) for a core property does it means that the main object is connected with an unknown one, which in turn is connected to the resource specified via href with a unknown property? For example, when an agent receive the activity

{
   "@context": "https://www.w3.org/ns/activitystreams",
   "type": "Create",
   "to": {
     "type": "Link",
     "href": "https://twitter.com/dril"
   }
}

may it consider this activity equivalent to the following one?

{
   "@context": "https://www.w3.org/ns/activitystreams",
   "type": "Create",
   "to": {
      "owl:topObjectProperty": "https://twitter.com/dril"
    }
 }

In the example, owl:topObjectProperty is used as a place holder for some property (which we don't know). If so I think that should be more safe removing the following paragraf from the primer document, just because we can't say anything about the property connecting the object with the resource specified by href:

If you see Link objects for "core" activity properties like actor, object, to, you can treat them as unique by href.

evanp commented 3 months ago

we are closing this