fep

FEP-2fa1: Federated Categories

Summary

This FEP defines a way to represent semantic categories on ActivityPub objects using Category objects within tag. Each category has a stable IRI and can be associated with a concept scheme. Categories can also link to equivalent or related categories in other vocabularies using semantic matching relationships, enabling applications to map, compare, and interpret classifications in federation.

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/fep/2fa1"
  ],
  "type": "Event",
  "id": "https://instance.example/event/1",
  "name": "Jazz evening",
  "tag": [
    {
      "type": "Category",
      "id": "https://instance.example/vocab/topic/music",
      "name": "Music",
      "summary": "Covers creative work or art using sound.",
      "inScheme": "https://w3id.org/fep/2fa1#Topic",
      "closeMatch": "https://events.example/vocab/category/music",
      "exactMatch": [
        "https://www.wikidata.org/entity/Q638",
        "https://app.example/vocab/topic/music"
      ]
    }
  ]
}

[!IMPORTANT] This FEP standardizes relationships between classifications, not authority over classification. A classification is a claim made by whoever publishes it, and each consumer decides how to interpret and act on that claim.

Rationale

Many Fediverse applications already have categories built in, and nobody should have to give theirs up. For example, PeerTube and Mobilizon have a predefined list of categories, and LAUTI separates event types from event topics, with lists configurable by each instance. What is missing is a common way for applications and instances to understand how categories used by others relate to their own.

Terminology & Requirements

In this FEP, a Category identifies a concept that has a particular meaning rather than merely providing a text label. The iCalendar specification RFC-5545 has a similar extension that addresses this problem: see RFC-9253 and SKOS.

The FEP uses the name Category rather than Concept because “Category” is a term already familiar to ActivityPub application developers and because it describes the application-level role of these objects. Technically, the properties defined for Category correspond to a subset of SKOS; the FEP provides some ActivityPub-friendly JSON-LD aliases via FEP-888d so that implementations can use the model without requiring pure SKOS terminology.

A shared vocabulary is a list of categories that an application or community publishes for others to reuse and map to.

The key words “MUST”, “MUST NOT”, “SHOULD”, “SHOULD NOT” and “MAY” are to be interpreted as described in RFC-2119. Boxes marked Note, Warning or Important are non-normative.

The Category Object

Implementers of this FEP SHOULD add the FEP’s context to their objects whenever the data contains a Category object.

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/fep/2fa1"
  ]
  ...
}

Category and its properties are aliases for the corresponding SKOS terms:

Property Any category Category of a shared vocabulary Meaning (SKOS term)
type MUST MUST Category (skos:Concept)
id MUST MUST, and publicly dereferenceable IRI identifying the category
nameMap / name MUST (nameMap preferred) MUST, as nameMap label (skos:prefLabel)
summary / summaryMap MAY SHOULD short description (skos:definition)
inScheme SHOULD SHOULD classification scheme (skos:inScheme)
exactMatch SHOULD SHOULD same meaning (skos:exactMatch)
closeMatch MAY SHOULD similar meaning (skos:closeMatch)
broader MAY MAY more general category (skos:broader)

Publishing categories

Tagging an object with categories

Consuming categories

A consumer

Vocabulary

Topic

URI
https://w3id.org/fep/2fa1#Topic
Label
Topic
Comment
A scheme of categories that say what an object is about: its subject matter. It contains no categories defined by this FEP; a category states its membership with inScheme.
Is defined by
FEP-2fa1

Form

URI
https://w3id.org/fep/2fa1#Form
Label
Form
Comment
A scheme of categories that say what kind of thing an object is within its own object type, such as a concert or a workshop for an event, or a documentary or a tutorial for a video. It contains no categories defined by this FEP; a category states its membership with inScheme.
Is defined by
FEP-2fa1

[!NOTE] Topic and Form are interoperability hints, not an ontology of the Fediverse. Whether something is a form, a genre or an object type is not decided here.

All following sections are non-normative.

Examples

Categories embedded within an object

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/fep/2fa1"
  ],
  "type": "Event",
  "id": "https://lauti.example/events/8010",
  "name": "Jazz evening",
  "tag": [
    {
      "type": "Category",
      "id": "https://lauti.example/vocab/type/concert",
      "nameMap": {
        "de": "Konzert",
        "en": "Concert"
      },
      "inScheme": "https://w3id.org/fep/2fa1#Form"
    },
    {
      "type": "Category",
      "id": "https://lauti.example/vocab/topic/jazz",
      "name": "Jazz",
      "inScheme": "https://w3id.org/fep/2fa1#Topic"
    },
    {
      "type": "Hashtag",
      "name": "#Saxophone"
    },
    {
      "type": "Hashtag",
      "name": "#Jazz"
    }
  ]
}

Full category object

Taken from a potential shared vocabulary of an application:

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/fep/2fa1"
  ],
  "type": "Category",
  "id": "https://video-application.example/vocab/category/music",
  "nameMap": {
    "en": "Music",
    "de": "Musik",
    "fr": "Musique"
  },
  "summary": "Covers creative work or art that is using sound or music.",
  "inScheme": "https://w3id.org/fep/2fa1#Topic",
  "closeMatch": "https://event-application.example/vocab/category/music",
  "exactMatch": [
    "https://event-application.example/vocab/topic/jazz",
    "http://www.wikidata.org/entity/Q638"
  ]
}

Taken from an instance of an application:

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/fep/2fa1"
  ],
  "type": "Category",
  "id": "https://event-instance.example/vocab/topic/jazz",
  "name": "Jazz",
  "summary": "Jazz music and events.",
  "inScheme": "https://w3id.org/fep/2fa1#Topic",
  "exactMatch": [
    "https://event-application.example/vocab/topic/jazz",
    "http://www.wikidata.org/entity/Q8341"
  ],
  "broader": "http://www.wikidata.org/entity/Q638"
}

Security considerations

Appendix

Appendix A: How this FEP can help federated categories grow, even if sparsely implemented

This FEP is designed so that an application can adopt it incrementally, without replacing its existing category system.

Example: a video platform with predefined categories

Suppose a Fediverse video application (https://videoapplication.example) already has a fixed list of category-terms such as HOWTO, MUSIC, NEWS, SPORTS and so on. They have no stable identifiers and no defined meaning beyond the application’s own world within the Fediverse.

The application can adopt this FEP step by step:

  1. Give existing categories stable IRIs.

    A category can initially be published as a small resource containing only its type, IRI and name. Each instance of that application uses their own id with an exactMatch to the applications IRI.

    {
      "@context": [
        "https://www.w3.org/ns/activitystreams",
        "https://w3id.org/fep/2fa1"
      ],
      "type": "Category",
      "id": "https://video-instance.example/vocab/category/HOWTO",
      "name": "How-to",
      "exactMatch": "https://video-application.example/vocab/category/HOWTO",
    }
    
  2. Add translations and descriptions.

    The application can add nameMap and summaryMap.

  3. State the classification scheme.

    For example, categories describing what a video is about can use inScheme with the FEP’s Topic scheme, while categories describing what kind of video it is can use Form, use other existing ConceptSchemes, or invent something new like https://videoapplication.example/vocab/scheme/Genre or https://videoapplication.example/vocab/scheme/MovieType.

  4. Relate categories to other Fediverse vocabularies.

    The application can add exactMatch, closeMatch or broader relationships to categories used by other applications. A category can thus be related to a category from another application’s vocabulary where their meanings overlap.

  5. Relate them to public vocabularies.

    Where useful, the same categories can also be related to established public concepts such as Wikidata.

Example: an instance-configured category system

When creating a new category on an instance an administrator may provide mappings from a community vocabulary. This allows interoperability to grow from existing category systems rather than requiring a universal taxonomy first. Small community calendars can converge on a regional vocabulary, namely the one that most of them map to. Nothing in this FEP requires or names such a vocabulary or its curator, and anyone can publish one.

Appendix B: Sharing category mappings

For sharing category mappings a community in the Fediverse could utilize “Simple Standard for Sharing Ontological Mappings” (SSSOM), which are collaboratively maintained and may get trusted my instance moderators.

Appendix C: Category as an Actor

ActivityPub does not require actors to have a particular type. An object can act as an ActivityPub Actor by providing the actor interface, including inbox and outbox.

A Category can therefore also be an Actor by providing these properties. This is not required by this FEP, but could be useful when a category should boost activities of its own.

Appendix D: Categories as Collections

A Category might additionally be typed as an ActivityStreams Collection or OrderedCollection. In this use, the collection contains objects that the application or instance has classified with that category. For example:

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/fep/2fa1"
  ],
  "type": ["Category", "Collection"],
  "id": "https://example.org/categories/music",
  "name": "Music",
  "inScheme": "https://w3id.org/fep/2fa1#Topic",
  "exactMatch": "http://www.wikidata.org/entity/Q638",
  "totalItems": 42,
  "items": [
    "https://example.org/events/1",
    "https://example.org/videos/2",
    ...
  ]
}

References

CC0 1.0 Universal (CC0 1.0) Public Domain Dedication

To the extent possible under law, the authors of this Fediverse Enhancement Proposal have waived all copyright and related or neighboring rights to this work.