diff --git a/doc/Entity.md b/doc/Entity.md new file mode 100644 index 0000000000000000000000000000000000000000..c2ff4acc733638f964f6d6343ef4dfd4db05ebc1 --- /dev/null +++ b/doc/Entity.md @@ -0,0 +1,190 @@ +Version: 0.1.0r1 + +Author: Timm Fitschen + +Email: timm.fitschen@ds.mpg.de + +Date: 2017-12-17 + +# Introduction + +CaosDB is a database management system that stores it's data into `Entities`. An `Entity` can be thought of as the equivalent to tables, rows, columns and the tuples that fill the tables of a traditional RDBMS. Entities are not only used to store the data they also define the structure of the data. + +# Formal Definition + +An `Entity` may have + +* a `domain` +* an `id` +* a `role` +* a `name` +* a `data type` +* a `Set of Values` +* a `Set of Properties` +* a `Set of Parents` + +A `domain` contains an `Entity`. + +An `id` is an arbitrary string. + +A `role` is an arbitrary string. Especially, it may be one of the following strings: + +* `RecordType` +* `Record` +* `Relation` +* `Property` +* `File` +* `QueryTemplate` +* `Domain` +* `Unit` +* `Rule` +* `DataType` +* `Remote` + +A `name` is an arbitrary string. + +A `data type` contains an `Entity`. Note: this is not necessarily a `Data Type`. + +## Set of Values + +A `Set of Values` is a mapping from a `indices` to a finite set of `Values`. + +An `index` is an interval of non-negative integers starting with zero. + +### Value + +A `Value` may have a `data type` and/or a `unit`. + +A `data type` is an `Entity`. Note: this is not necessarily a `Data Type`. + +A `unit` is an arbitrary string. + +## Data Type + +A `Data Type` is an `Entity` with role `DataType`. + +### Reference Data Type + +A `Reference Data Type` is a `Data Type`. It may have a `scope`. + +A `scope` contains an `Entity`. + +### Collection Data Type + +A `Collection Data Type` is a `Data Type`. It may have an ordered set of `elements`. + +## Record Type + +A `Record Type` is an `Entity` with role `RecordType`. + +## Record + +A `Record` is an `Entity` with role `Record`. + +## Relation + +A `Relation` is an `Entity` with role `Relation`. + +## Property + +A `Property` is an `Entity` with role `Property`. It is also refered to as `Abstract Property`. + +## File + +A `File` is an `Entity` with role `File`. + +A `File` may have + +* a `path` +* a `size` +* a `checksum` + +A `path` is an arbitrary string. + +A `size` is a non-negative integer. + +A `checksum` is an ordered pair (`method`,`result`). + +A `method` is an arbitrary string. + +A `result` is an arbitrary string. + +## QueryTemplate + +A `QueryTemplate` is an `Entity` with role `QueryTemplate`. + +## Domain + +A `Domain` is an `Entity` with role `Domain`. + +## Unit + +A `Unit` is an `Entity` with role `Unit`. + +## Rule + +A `Rule` is an `Entity` with role `Rule`. + +## Remote + +A `Remote` is an `Entity` with role `Remote`. + +## Set of Parents + +A `Set of Parents` is a set of `Parents`. + +### Parent + +A `Parent` may contain another `Entity`. + +A `Parent` may have an `affiliation`. + +An `affiliation` may contain of the following strings: + +* `subtyping` +* `instantiation` +* `membership` +* `parthood` +* `realization` + +## Set of Properties + +A `Set of Properties` is a tripple (`index`, set of `Implemented Properties`, `Phrases`). + +An `index` is a bijective mapping from an interval of non-negative integer numbers starting with zero to the set of `Implemented Properties`. + +### Implemented Property + +An `Implemented Property` contains another `Entity`. + +An `Implemented Property` may have an `importance`. + +An `Implemented Property` may have a `maximum cardinality`. + +An `Implemented Property` may have a `minimum cardinality`. + +An `Implemented Property` may have an `import`. + +An `importance` is an arbitrary string. It may contain of the following strings: + +* `obligatory` +* `recommended` +* `suggested` +* `fix` + +A `maximum cardinality` is a non-negative integer. + +A `minimum cardinality` is a non-negative integer. + +An `import` is an arbitrary string. It may contain of the following strings: + +* `fix` +* `none` + +### Phrases + +`Phrases` are a mapping from the cartesian product of the `index` with itself to a `predicate`. + +A `predicate` is an arbitrary string. + + diff --git a/doc/faq.md b/doc/faq.md index 40d503b53bb20213e7c859c201b1a7b3b8c19ff1..09e8adb7f3072ea94042e43d962c33345c2482d6 100644 --- a/doc/faq.md +++ b/doc/faq.md @@ -1,7 +1,4 @@ -**Table of content** - -[[_TOC_]] # How do I declare a LIST property?