Cells and Workspaces

Cells

Data in Hive is stored in Cells that are grouped into Workspaces. Each Cell can contain Tags, Properties, References and Files and some additional metadata (Cell ID, created, uploaded and modified times, description and version).

Tags

Tags are category-name pairs and are best suited to describe items from a finite set (such as a country of origin). Tags are of two kinds - system ones and user defined ones. The user can define these through Tag templates stored in Workspace. Tag category consists of namespace and section separated by a dot. The Tag name can be any string. An example of a Tag could be { "category": "my-namespace.country", "name": "czechia" }. A system reserved Tags have the system. prefix and define for instance which Workspace the Cell belongs to. These are of the form { "category": "system.workspace", "name": "my-namespace" }. Note that single Cell can belong to multiple Workspaces.

Properties

Properties are key-value pairs and are best suited for items with continuous values, for example a price. The value can be a json value (boolean, number and string). Note that floating point values are stored as such in the database. A datetime in ISO date format is also supported. Example property { "key": "price", "value": 42 }.

References

References are key-Cell ID pairs. They can be used to create a Cell hierarchy. Example Reference { "key": "config", "id": "30d697ba-d4ad-4602-b785-8e44f4fc23f1" }.

Note
Tags, Properties and References are indexed for a faster search.

Files

Hive can store Files in Cells of any format. File descriptor is stored in Cell whereas the actual File content is stored in a File storage, e.g. the filesystem or an S3 compatible storage. File descriptor contains filename, size, created and modified times, mime type and list of Tags and Properties. system.content_hash (SHA-1) property is created for the content of each uploaded File.

Files of certain type have an extra support in BeeYard. These are JSON Documents, Images and Overlays.

Documents

JSON documents are of two types: searchable and non-searchable. The content of the searchable ones is stored in the database, the non-searchable ones are stored in the binary storage. Both are validated, if they indeed are valid JSONs.

Images

Each Image is inspected whether it has a valid image format. Image width and height are stored as File Properties system.width and system.height. Image mime type is determined from the Image content. A thumbnail is created for each uploaded Image.

Supported image formats are JPEG, PNG and BMP. Images of other formats can be uploaded as Files.

Overlays

Overlay consists of a list of Layers. Each Layer has a name and consists of a list of Shapes. Overlay can be of two types, searchable and non-searchable with a similar behavior as searchable and non-searchable Documents.

Supported Shapes
  • Cross

  • Rectangle/Oriented Rectangle

  • Circle/Ellipse

  • Polygon

  • Mask

  • Text field

  • Path

Each Shape has an unique ID.

Masks are a special case. They consists both of a Mask shape and of PNG image stored under Files.

Workspaces

Workspaces are used to group similar Cells together. They consists of a display name and namespace. They can optionally contain a list of Tag templates, Tag rules, Shape templates and Favorite queries.

Tag templates consist of a section and name. Cells cannot be assigned Tags prior defining the corresponding Tag Templates. A Tag Template cannot be removed if any Cell or File contains the corresponding Tag. An example Tag template { "section": "fruit", "name": "apple" }

Shape Templates are used as blue prints when modifying an Overlay from the BeeYard App.

Favorite queries are used by the BeeYard App to store user defined queries.

Note
Workspace cannot be removed if it contains Cells.