Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new API action for providing KonText defaults (namely "viewattrs" for now) #33

Open
tomachalek opened this issue Nov 7, 2022 · 0 comments
Labels
proposal Something not required explicitly but probably useful

Comments

@tomachalek
Copy link
Member

tomachalek commented Nov 7, 2022

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
  • look for defined tagsets (tables tagset and corpus_tagset) and use respective attributes
@tomachalek tomachalek added the enhancement New feature or request we definitely need/want label Nov 7, 2022
@tomachalek tomachalek added proposal Something not required explicitly but probably useful and removed enhancement New feature or request we definitely need/want labels Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Something not required explicitly but probably useful
Projects
None yet
Development

No branches or pull requests

1 participant