Build using the following command in the project directroy;
$ gradle build
Deploy locally;
$ java -jar build/libs/lexidb-2.0.jar /path/to/app.properties
You can test whether the server is running by making a simple API call in your browser; http://localhost:1189/api/test
Create a new corpus;
POST /mycorpus/create
{
"name": "tokens",
"sets": [
{
"name": "tokens",
"columns": [
{
"name": "token"
}
...
}
insert some files;
POST /mycorpus/myfile.xml/insert
token pos sem
When CS Z5
it PPH1 Z8
comes VVZ A4.1[i651.2.1
to II A4.1[i651.2.2
tropical JJ M7/B2-[i652.2.1
diseases NN2 M7/B2-[i652.2.2
, , PUNC
future JJ T1.1.3
scientific JJ Y1
research NN1 X2.4
...
finally save;
GET /mycorpus/save
A GET
request can be made to the endpoint http://localhost:1189/mycorpus/query. The body of the request should be in the form of a JSON query;
POST /mycorpus/query
{
"query": {
"tokens": "{\"pos\": \"JJ\"}"
}
}
This will query the "tokens"
table and the "pos"
(part-of-speech) column for the value "JJ"
and return the results in the form of a "kwic"
(keyword in context).