The resource configruation file is the file that is given when creating a new lexicon:
resource create <path-to-config.json>
It contains settings for the resource and descriptions of the fields used in the resource's entries.
The following settings are available:
key | JSON type |
---|---|
resource_id |
string |
resource_name |
string |
fields |
object |
id |
string |
sort |
string |
additionalProperties |
boolean |
We need to define the resource_id
for our resource, this will be used when we call the api.
The resource_id
can't contain whitespace and should preferrable only contain lowercase letters.
{
"resource_id": "parolelexplus"
}
We could also define the resource_name
for our resource, if not the resource_id
will be used.
{
"resource_id": "parolelexplus",
"resource_name": "parolelexplus"
}
Here we define the fields that the entries in the resource will have.
The fields are defined by "<field_name>": {"type": "<field_type>"}
where field_type can be any of:
field_type | python_type | comment |
---|---|---|
string |
str |
|
boolean |
bool |
|
integer |
int |
|
number |
float |
|
object |
dict |
requires the field fields that define fields |
If the field is a collection (i.e. array), add: "collection": true
to the field
description.
{
"resource_id": "parolelexplus",
"fields": {
"paroleID": { "type": "string", "required": true },
"wordform": { "type": "string", "required": true },
"partOfSpeech": { "type": "string" },
"valency": { "type": "string" },
"saldo": { "type": "string", "collection": true }
}
}
Currently not used, but required to set.
Specifies the default field the results will be sorted by.
If true
, only entries where all fields described in the configuration are accepted
when creating/modifying entries. Default: false