Metadata API development - serlo/documentation GitHub Wiki

Introduction

The Serlo Metadata API, described for users at this page allows downloading the metadata of Serlo content. It is mainly used by content aggregators like

  • WirLernenOnline.de
  • Bildungsserver.de
  • edutags.de
  • NBP Datenraum (not yet publicly accessible?)

that we want to support via our Metadata API so that teachers and students can find Serlo content on those pages.

The type of content returned by the Metadata API currently includes applets, articles, courses, text exercises and exercise groups as well as video.

Format

The metadata is provided in a standardized format called Allgemeines Metadatenprofil für Bildungsressourcen (AMB) which translates to "general metadata profile for educational resources". Serlo is also involved in the AMB standard committee.

The AMB standard uses vocabulary from the Schema.org standard with JavaSript Object Notation Linked Data (JSON-LD) encoding. You can learn more about JSON-LD here.

Source

The core logic of the implementation is in https://github.com/serlo/api.serlo.org/blob/staging/packages/server/src/schema/metadata/resolvers.ts with tests in https://github.com/serlo/api.serlo.org/blob/staging/tests/schema/metadata.ts.

The SQL query has a recursive part for two reasons. The first is to get the layer of taxonomy containing the subject, so we can map the Serlo subject to the right subject category given by the AMB standard. The second reason for the recursive query is that we want to exclude certain parts of Serlo in the metadata that are not useful to students. Examples for the things we want excluded are sandboxes, content not finished yet or the community area.

We currently have only images that we can return links to as thumbnail for 5 subjects and in German. For the others we display the default Serlo logo. This could be extended in the future.