Commit 736df0dc authored by Bruno Guillaume's avatar Bruno Guillaume

grew_server

parent bb1d6ba3
......@@ -81,3 +81,11 @@ Tags = ["Development","golang"]
{{< large file="_sud_diff/fr-ud-dev_00131.svg" >}}
{{< large file="_ud_diff/fr-ud-dev_00131.svg" >}}
* `fr-ud-dev_00131`
{{< large file="_sud_diff/fr-ud-dev_00131.svg" >}}
{{< large file="_ud_diff/fr-ud-dev_00131.svg" >}}
* `fr-ud-dev_00190`
{{< large file="_sud_diff/fr-ud-dev_00190.svg" >}}
{{< large file="_ud_diff/fr-ud-dev_00190.svg" >}}
+++
Tags = ["Development","golang"]
Description = ""
menu = "main"
Categories = ["Development","GoLang"]
date = "2019-06-01T20:54:20+02:00"
title = "grew_server"
+++
# Use Grew as a server for the Arborator tool
The `grew_server` tool is a web server which manages set of annotated graphs with multiple annotations on the same sentence.
It is built to be used with the Arborator graph annotation tool.
Below, we suppose that the server is available on some `baseURL`.
For testing purpose, a demo server should be available at `http://arborator.grew.fr`.
(:warning: data stored on this server may be lost at any time).
Annotations are stored with the following hierarchy:
* the server manages any number of **projects**
* each project contains any number of **samples**
* each sample contains any number of **sentences**
* each sentence may be annotated by any number of **users**
We describe below the list of available services to deal with these levels.
All services are called with a base name and with POST parameters.
Two types of parameter are used: `<string>` and `<file>`.
All services reply with JSON data of one of this three forms:
* `{ "status": "OK", "data": … }` when the request was executed correctly, the content of the `data` field depends on the service.
* `{ "status": "WARNING", "messages": …, "data": "…" }` when the request can be partially executed; the `messages` fields contains a list of messages.
* `{ "status": "ERROR", "message": "…" }` when the request cannot be executed.
## Projects
### The `newProject` service
This service is used to initialise a new empty project. An error is returned if the project already exists.
* `(<string> project_id)`
### The `getProjects` service
This service returns the list of existing projects.
* `()`
### The `eraseProject` service
This service is used to remove a project. If the project does not exist, nothing append
* `(<string> project_id)`
## Samples
All services about samples return an error if the requested project does not exist.
### The `newSample` service
This service is used to initialise a new empty sample in a given project.
An error is returned if the sample already exists.
* `(<string> project_id, <string> sample_id)`
### The `getSamples` service
This service returns the list of existing samples in a given project.
* `(<string> project_id)`
### The `eraseSample` service
This service is used to remove a sample. If the sample does not exist, nothing append
* `(<string> project_id, <string> sample_id)`
## Annotations
### The `saveConll` service
* `(<string> project_id, <string> sample_id, <string> sent_id, <string> user_id, <file> conll_file)`
* `(<string> project_id, <string> sample_id, <string> sent_id, <file> conll_file)`
* `(<string> project_id, <string> sample_id, <string> user_id, <file> conll_file)`
* `(<string> project_id, <string> sample_id, <file> conll_file)`
* `(<string> project_id, <file> conll_file)`
### The `saveGraph` service
:question: remove ???
* `(<string> project_id, <string> sample_id, <string> sent_id, <string> user_id, <string> conll_graph)`
### The `getConll` service
* `(<string> project_id, <string> sample_id, <string> sent_id, <string> user_id)`
returns a `conll_string`
* `(<string> project_id, <string> sample_id, <string> sent_id)`
returns a dict `user_id` -> `conll_string`
* `(<string> project_id, <string> sample_id)`
returns a 2-levels dict `sent_id` -> `user_id` -> `conll_string`
### The `getSentences` service
:question: rename to `searchPattern`
* `(<string> project_id, <string> pattern)`
returns a list of dict `{'sample_id':…, 'sent_id':…, 'nodes':…, 'edges':…}`
### The `getUsers` service
* `(<string> project_id, <string> sample_id, <string> sent_id)`
* `(<string> project_id, <string> sample_id)`
* `(<string> project_id)`
### The `getSentIds` service
* `(<string> project_id)`
* `(<string> project_id, <string> sample_id)`
......@@ -99,12 +99,12 @@ For instance with our previous examples with 3 corpora, the configuration file l
}
```
In JSON, `groups` define the items in the top navbar and `corpora` the list of corpora in the left bar, maybe organised in folders (recursive folders are not handled).
You can look the [configuration file](https://gitlab.inria.fr/grew/grew_match/blob/master/corpora_for_website/groups.json) used on [Grew-match](match.grew.fr) for a larger example.
In JSON, `groups` defines the items in the top navbar and `corpora` the list of corpora in the left bar, maybe organised in folders (recursive folders are not handled).
You can look the [configuration file](https://gitlab.inria.fr/grew/grew_match/blob/master/corpora_for_website/groups.json) used on [Grew-match](http://match.grew.fr) for a larger example.
### Install
Edit the following installation script (update DEST definition and port number id needed).
Edit the following installation script (update `DEST` definition and port number if needed).
Run it from the place where you did the `git clone`.
```shell
......
......@@ -29,6 +29,9 @@ Note that if there is more than one negative matching, there are all interpreted
The basic syntax of patterns in grew can be learned using the tutorial part of the [Grew-match](http://match.grew.fr) tool.
See [here](../complex_edges#complex-edges-in-patterns) for dealing with complex edges in patterns.
## Positive pattern
## Negative pattern
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment