architecture.md 2.97 KB
Newer Older
delanoe's avatar
delanoe committed
1

2 3 4 5
# Definitions and notation for the documentation (!= python notation)

## Node

sim's avatar
sim committed
6
The table (nodes) is a list of nodes: `[Node]`
7 8

Each Node has:
sim's avatar
sim committed
9

10 11 12 13 14 15 16
- a typename
- a parent_id
- a name


### Each Node has a parent_id

sim's avatar
sim committed
17 18 19
    Node A
    ├── Node B
    └── Node C
20 21 22 23 24 25

If Node A is Parent of Node B and Node C
then NodeA.id == NodeB.parent_id == NodeC.parent_id.

### Each Node has a typename

26
Notation: `Node["FOO"]("bar")` is a Node of typename "FOO" and with name "bar".
27 28 29

Then:

30 31 32
- Then Node[PROJECT] is a project.
- Then Node[CORPUS] is a corpus.
- Then Node[DOCUMENT] is a document.
sim's avatar
sim committed
33

34 35 36
The syntax of the Node here do not follow exactly Python documentation
(for clarity and to begin with): in Python code, typenames are strings
represented as UPPERCASE strings (eg. "PROJECT").
37

sim's avatar
sim committed
38
### Each Node as a typename and a parent
39

40 41 42 43 44 45
    Node[USER](name)
    ├── Node[PROJECT](myProject1)
    │   ├── Node[CORPUS](myCorpus1)
    │   ├── Node[CORPUS](myCorpus2)
    │   └── Node[CORPUS](myCorpus3)
    └── Node[PROJECT](myProject2)
46

47
/!\\ 3 ways to manage rights of the Node:
48

sim's avatar
sim committed
49 50 51 52 53
1. Then Node[User] is a folder containing all User projects and corpus and
   documents (i.e. Node[user] is the parent_id of the children).
2. Each node as a user_id (mainly used today)
3. Right management for the groups (implemented already but not
   used since not connected to the frontend).
54 55 56


## Global Parameters
delanoe's avatar
delanoe committed
57

sim's avatar
sim committed
58 59
Global User is Gargantua (Node with typename user).
This node is the parent of the other nodes for parameters.
60

61
    Node[USER](gargantua) (gargantua.id == Node[USER].user_id)
sim's avatar
sim committed
62
    ├── Node[TFIDF-Global](global) : without group
63 64 65 66
    │   ├── Node[TFIDF](database1)
    │   ├── Node[TFIDF](database2)
    │   └── Node[TFIDF](database3)
    └── Node[ANOTHERMETRIC](global)
67

sim's avatar
sim committed
68 69 70

[//]: # (Are there any plans to add user wide or project wide parameters or metrics?  For example TFIDF nodes related to a normal user -- ie. not Gargantua?)

71
Yes we can in the future (but we have others priorities before.
sim's avatar
sim committed
72 73 74

[//]: # (What is the purpose of the 3 child nodes of Node[TFIDF-Global]?  Are they TFIDF metrics related to databases 1, 2 and 3? If so, shouldn't they be children of related CORPUS nodes?)

75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
Node placement in the tree indicates the context of the metric: the
Metrics Node has parent the corpus Node to indicate the context of the
metrics.

Answer:

    Node[USER](foo)
    Node[USER](bar)
    ├── Node[PROJECT](project1)
    │   ├── Node[CORPUS](corpus1)
    │   │   ├── Node[DOCUMENT](doc1)
    │   │   ├── Node[DOCUMENT](doc2)
    │   │   └── Node[TFIDF-global](name of the metrics)
    │   ├── Node[CORPUS](corpus2)
    │   └── Node[CORPUS](corpus3)
    └── Node[PROJECT](project2)


sim's avatar
sim committed
93

94 95 96
## NodeNgram

NodeNgram is a relation of a Node with a ngram:
sim's avatar
sim committed
97 98 99 100

- documents and ngrams
- metrics  and ngrams (position of the node metrics indicates the
  context)
101

delanoe's avatar
delanoe committed
102 103 104 105 106 107 108 109 110


# Community Parameters


# User Parameters