# Data description (Final)

*English translation by SOTA – AI Community of the Russian original. Organisers who would like this translation removed can email sota.ai.community@gmail.com.*

## Data schema

```mermaid
erDiagram
    users {
        int user_id PK
        int gender
        int age
    }
    interactions {
        int user_id FK
        int edition_id FK
        int event_type
        float rating
        datetime event_ts
    }
    editions {
        int edition_id PK
        int book_id
        int author_id FK
        int publication_year
        int age_restriction
        int language_id
        int publisher_id
        string title
        string description
    }
    authors {
        int author_id PK
        string author_name
    }
    genres {
        int genre_id PK
        string genre_name
    }
    book_genres {
        int book_id FK
        int genre_id FK
    }

    users ||--o{ interactions : "user_id"
    editions ||--o{ interactions : "edition_id"
    authors ||--o{ editions : "author_id"
    editions ||--o{ book_genres : "book_id"
    genres ||--o{ book_genres : "genre_id"
```

---

## File descriptions

### `interactions.csv`

The observed log of user interactions after the partial loss of events. Each row is one event.

| Field | Description | Comment |
|-------|-------------|---------|
| `user_id` | user identifier (FK → `users.user_id`) | - |
| `edition_id` | edition identifier (FK → `editions.edition_id`) | - |
| `event_type` | event type: `1` — wishlist, `2` — read | - |
| `rating` | rating (only for `read`, otherwise `NULL`) | - |
| `event_ts` | date and time of the event | - |

### `targets.csv`

The list of users for whom the lost positive interactions must be restored.

| Field | Description | Comment |
|-------|-------------|---------|
| `user_id` | user identifier | a single column |

### `editions.csv`

Reference table of editions (edition-level). Each edition is linked to one book.

| Field | Description | Comment |
|-------|-------------|---------|
| `edition_id` | edition identifier (PK) | - |
| `book_id` | book identifier | - |
| `author_id` | author identifier (FK → `authors.author_id`) | - |
| `publication_year` | year of publication | of the edition, not of the book |
| `age_restriction` | age restriction | e.g. 18+ |
| `language_id` | language identifier | no reference table |
| `publisher_id` | publisher identifier | no reference table |
| `title` | title | - |
| `description` | description | text |

### `authors.csv`

Reference table of authors.

| Field | Description | Comment |
|-------|-------------|---------|
| `author_id` | author identifier (PK) | - |
| `author_name` | author name | full name or pseudonym |

### `genres.csv`

Reference table of genres.

| Field | Description | Comment |
|-------|-------------|---------|
| `genre_id` | genre identifier (PK) | - |
| `genre_name` | genre name | - |

### `book_genres.csv`

Many-to-many link between books and genres.

| Field | Description | Comment |
|-------|-------------|---------|
| `book_id` | book identifier | - |
| `genre_id` | genre identifier (FK → `genres.genre_id`) | - |

### `users.csv`

Reference table of users with demographic features.

| Field | Description | Comment |
|-------|-------------|---------|
| `user_id` | user identifier (PK) | - |
| `gender` | gender: `1`, `2` or `NULL` | - |
| `age` | age (may be `NULL`) | - |
