From 45d5fae978fb757d4ac599d745d0c6b25adfc8c4 Mon Sep 17 00:00:00 2001 From: silverpill Date: Tue, 18 Mar 2025 20:27:18 +0000 Subject: [PATCH] FEP-2277: Improve Collection detection algorithm (#528) Reviewed-on: https://codeberg.org/fediverse/fep/pulls/528 Co-authored-by: silverpill Co-committed-by: silverpill --- fep/2277/fep-2277.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fep/2277/fep-2277.md b/fep/2277/fep-2277.md index 75a9a9a..04c776a 100644 --- a/fep/2277/fep-2277.md +++ b/fep/2277/fep-2277.md @@ -45,8 +45,8 @@ One way to divide objects into distinct classes is to look at their properties a - Object - Actor -- Activity -- Collection +- Activity (includes intransitive activities) +- Collection (includes collection pages) - Link The next section specifies an algorithm that classifies any ActivityPub object as one of these core types by analyzing object's shape. This technique is often referred to as [duck typing][DuckTyping]. @@ -58,7 +58,7 @@ The following algorithm can be used to determine the core type of the object: 1. If object has `href` property, return `Link`. 1. If object has `inbox` and `outbox` properties, return `Actor`. 1. If object has `actor` property, return `Activity`. -1. If object has `items`, `orderedItems` or `totalItems` property, return `Collection`. +1. If object has `items`, `orderedItems`, `totalItems`, `partOf`, `first`, `last`, `next`, `prev` or `current` property, return `Collection`. 1. Otherwise, return `Object`. Application of this algorithm results in non-overlapping core types. For example, an actor with `items` property is still an actor and not a collection.