Skip to content

rootCollection follows arocapi: the top-level collection, across distributed crates #60

Closed

Description

@johnf

Parent

#52

What to build

rootCollection means what arocapi says: the top-level collection an entity sits under, empty on a top-level collection's own row. For a crate whose root's memberOf points outside the crate (a distributed collection), the indexer follows memberOf upward by reading each parent crate's metadata from the OCFL repository, cached for the run, until it reaches a root with no parent. It doesn't read parents from the database, so the answer is the same whatever order crates are indexed in. The search document's rootCollection uses the same value, so Oni's "Collection" facet shows a distributed collection once. A moved parent collection needs its children reindexed; that isn't handled in code.

Ships on the one #52 branch and PR, as its own commit. See #52 for the decisions behind it.

Acceptance criteria

  • Through the API, a top-level collection's rootCollection is empty
  • Entities of distributed_content_restricted and distributed_metadata_restricted have distributed_root as their rootCollection, whether the parent crate is indexed before or after them
  • Entities of a stand-alone crate have its root as their rootCollection
  • The "Collection" search facet lists distributed_root once for the whole distributed collection
  • Tested through the API with the test-data crates indexed in both orders
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions