# SubVocabulary model

Working rule for v2:

```text
Nach außen: Type für OpenRefine.
Innen: Vocabulary + SubVocabulary.
Bei xTree: SubVocabulary.id = Einstiegspunkt im Baum.
```

## Vocabulary

A `Vocabulary` corresponds zum Vokabular -> concept scheme, for example MCT.

```php
new Vocabulary(
    key: 'mct',    # key noch klären
    id: 'http://matcult-the.vocnet.org',
    label: 'MCT',
    provider: 'xtree'
);
```

## SubVocabulary

A `SubVocabulary` is a configured search and mapping domain inside a vocabulary.
For the current xTree prototype, its `id` is sufficient: it is interpreted as the tree entry point.

```php
new SubVocabulary(
    id: 'http://matcult-the.vocnet.org/00000375',
    label: 'MCT: Personen nach Beruf',
    conceptSchemeId: 'http://matcult-the.vocnet.org'
);
```

No `selectionType` / `selectionValue` is used yet. If later needed, selection strategies can be added without changing the OpenRefine contract.

## OpenRefine mapping

OpenRefine kennt nur reconciliation `type` entries im manifest:

```json
{
  "id": "http://matcult-the.vocnet.org/00000375",
  "name": "MCT: Personen nach Beruf"
}
```

When OpenRefine sends this `type` in a POST request, v2 resolves it internally to:

```text
Vocabulary: MCT
SubVocabulary: MCT: Personen nach Beruf
SubVocabulary.id: http://matcult-the.vocnet.org/00000375
```
