From e2fce855c58c8280627b73e44e58bee28a50d57b Mon Sep 17 00:00:00 2001 From: Bruno Guillaume Date: Sun, 24 Nov 2019 08:48:10 +0100 Subject: [PATCH] add clustering features for search functions --- content/grew_server.md | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/content/grew_server.md b/content/grew_server.md index be9d719..4fb521a 100644 --- a/content/grew_server.md +++ b/content/grew_server.md @@ -79,15 +79,16 @@ This service returns the list of existing samples in a given project. ### The `eraseSample` service -This service is used to remove a sample. If the sample does not exist, nothing happens +This service is used to remove a sample. If the sample does not exist, nothing happens. * `( project_id, sample_id)` ### The `renameSample` service +An error is returned either if `sample_id` does not exist or if `new_sample_id` already exists in `project_id`. + * `( project_id, sample_id, new_sample_id)` -An error is returned either if `sample_id` does not exist or if `new_sample_id` already exists in `project_id`. ## Sentences @@ -142,10 +143,30 @@ An error is returned either if `sample_id` does not exist or if `new_sample_id` ### The `searchPatternInSentences` service - * `( project_id, pattern)` - returns a list of dict `{'sample_id':…, 'sent_id':…, 'nodes':…, 'edges':…}` +This service returns occurrences of some pattern in a project. +Each occurrence is described by a dict `{'sample_id':…, 'sent_id':…, 'nodes':…, 'edges':…}`. + + * `( project_id, pattern)` returns a list of occurrences. + + * :new: `( project_id, pattern, clusters)` + where `clusters` is a list of cluster keys, separated by `;`. + This returns nested dictionaries (the depth being equals to the length of the cluster key list). + The set of occurrences of the `pattern` in `project_id` are clustered with the first key of the list; + each clusters is further clustered recursively with the remaining keys. + For instance: + + * If the length of the cluster keys list is 1, the behaviour is similar the the *clustering* feature available in **Grew-match**. + * Data presented in **Relations tables** in **Grew match** can be obtained (for the `obj` relation in the example) with the arguments: + + * `pattern`: `pattern { G -[obj]-> D }` + * `clusters`: `G.upos; D.upos` ### The `searchPatternInGraphs` service - * `( project_id, pattern)` - returns a list of dict `{'sample_id':…, 'sent_id':…, 'user_id':…, 'nodes':…, 'edges':…}` +This service returns occurrences of some pattern in a project, for a given user. +Each occurrence is described by a dict `{'sample_id':…, 'sent_id':…, 'user_id':…, 'nodes':…, 'edges':…}`. + + * `( project_id, pattern)` returns a list of occurrences. + + * :new: `( project_id, pattern, clusters)` + Nested dictionaries are returned with the same structure as in the case of `searchPatternInSentences` above. -- GitLab