Open
Description
PUT /corpora/{corpusId}/kontextDefaults
PUT /corpora/{subdir}/{corpusId}/kontextDefaults
The action should infer default view properties for a corpus, store them to the database.
A response should contain values stored to database and the format should be a JSON with the schema matching actual user-corpus options stored in db or like in case of default options stored for corpus in db (the discussed API function will actually serve as a source of those defaults).
For now, we are interested only in attrs
(i.e. positional attributes shown by default in concordances.
{
"viewattrs": {
"attrs": "word,lemma,tag"
}
}
The algorithm of selecting the attributes should be as follows:
- look for entries in
kontext_simple_query_default_attrs
- in case there are some, use those
- else
- select
word
- look for
lemma
- if exists, then select
- select
- look for defined tagsets (tables
tagset
andcorpus_tagset
) and use respective attributes