Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • caosdb/src/caosdb-proto
1 result
Show changes
Commits on Source (2)
......@@ -20,7 +20,7 @@
cmake_minimum_required(VERSION 3.13)
set(CAOSDB_PROTO_VERSION 0.0.1)
set(CAOSDB_PROTO_VERSION 0.0.10)
project("caosdb-proto"
VERSION ${CAOSDB_PROTO_VERSION}
......
......@@ -20,6 +20,8 @@
project = '@CMAKE_PROJECT_NAME@'
copyright = '2021 IndiScale GmbH'
author = 'Timm Fitschen'
version = '@CMAKE_PROJECT_VERSION@'
release = '@CMAKE_PROJECT_VERSION@'
rst_prolog = """
.. |PROJECT_NAME| replace:: @CMAKE_PROJECT_NAME@
......
......@@ -20,6 +20,7 @@
set(CAOSDB_API_PACKAGES
caosdb.info.v1alpha1
caosdb.entity.v1alpha1
)
# pass variable to parent scope
......
......@@ -25,6 +25,116 @@ option java_package = "org.caosdb.api.entity.v1alpha1";
option cc_enable_arenas = true;
package caosdb.entity.v1alpha1;
// Data type for references to other entities.
message ReferenceDataType {
// The name of the record type which defines the scope of the reference.
string name = 1;
// The id of the record type which defines the scope of the reference.
string id = 2;
// The description of the record type which defines the scope of the reference.
string description = 3;
}
// Data type for list value.
message ListDataType {
// A list can be a list of atomic data types or references.
oneof content {
// List of atomic data types (e.g. List of DOUBLE)
AtomicDataType atomic_data_type = 1;
// List of reference (e.g. List of Person(s))
ReferenceDataType reference_data_type = 2;
}
}
// Atomic data types.
enum AtomicDataType {
// The data type is unset/unknown.
ATOMIC_DATA_TYPE_UNSPECIFIED = 0;
// TEXT data type.
ATOMIC_DATA_TYPE_TEXT = 1;
// DOUBLE data type.
ATOMIC_DATA_TYPE_DOUBLE = 2;
// DATETIME data type.
ATOMIC_DATA_TYPE_DATETIME = 3;
// INTEGER data type.
ATOMIC_DATA_TYPE_INTEGER = 4;
// BOOLEAN data type.
ATOMIC_DATA_TYPE_BOOLEAN = 5;
// FILE data type.
ATOMIC_DATA_TYPE_FILE = 6;
}
// The property value's data type.
message DataType {
// Wraps atomic types, LIST and REFERENCE
oneof content {
// The atomic data types.
AtomicDataType atomic_type = 1;
// A list data type.
ListDataType list_type = 2;
// A reference data type.
ReferenceDataType reference_type = 3;
}
}
// Represents collection values (e.g. for lists).
message CollectionValues {
// List of scalar values.
repeated ScalarValue values = 1;
}
// Represents special values which are otherwise hard to tranfer via protobuf.
enum SpecialValue {
// Not set.
SPECIAL_VALUE_UNSPECIFIED = 0;
// The NULL value.
SPECIAL_VALUE_NULL = 1;
// The empty string.
SPECIAL_VALUE_EMPTY_STRING = 2;
}
// A scalar property value.
message ScalarValue {
// Wraps different optimized representations of a single value.
oneof content {
// The value as integer
int64 integer_value = 1;
// The value as double
double double_value = 2;
// The value as bool
bool boolean_value = 3;
// The value as string
string string_value = 4;
// The value is a special value (e.g. NULL or the empty string)
SpecialValue special_value = 5;
}
}
// The value of a property.
message Value {
// Wraps scalar and multi-dimensional values.
oneof content {
// The scalar values.
ScalarValue scalar_value = 1;
// The list values.
CollectionValues list_values = 2;
}
}
// The roles of entities.
enum EntityRole {
// Unspecified role.
ENTITY_ROLE_UNSPECIFIED = 0;
// RecordType
ENTITY_ROLE_RECORD_TYPE = 1;
// Record
ENTITY_ROLE_RECORD = 2;
// Property
ENTITY_ROLE_PROPERTY = 3;
// File
ENTITY_ROLE_FILE = 4;
}
// Messages codes. Entities and transactions contain errors, warnings and info
// messages which use these codes.
enum MessageCode {
......@@ -318,13 +428,13 @@ message Entity {
// transactions.
Version version = 4;
// Entity role (e.g. RecordType, Property, Record)
string role = 5;
EntityRole role = 5;
// Default unit of this entity (only used by properties).
string unit = 6;
// Default datatype of this entity (only used by properties).
string datatype = 7;
DataType datatype = 7;
// Default value of this entity (only used by properties).
string value = 8;
Value value = 8;
// Properties of this entity.
repeated Property properties = 9;
// Parents of this entity.
......@@ -346,6 +456,20 @@ message Entity {
repeated Message infos = 13;
}
// The property importance.
enum Importance {
// The importance is unset/unknown.
IMPORTANCE_UNSPECIFIED = 0;
// The property is obligatory for children of this entity. The server will flag an error when an obligatory property of a parent is missing during updates or insertions of a child entity. It says: "YOU MUST!"
IMPORTANCE_OBLIGATORY = 1;
// The property is recommended for children of this entity. The server will flag a warning when a recommended property of a parent is missing during updates or insertions of a child entity. It says: "YOU SHOULD!"
IMPORTANCE_RECOMMENDED = 2;
// The property is merely suggested for children of this entity. It says: "YOU MAY WANT TO?"
IMPORTANCE_SUGGESTED = 3;
// The property is fix and child entities should not add this property to themselves (This is a bit like static in object-oriented programming languages). It says: "KINDLY IGNORE THIS ONE FOR CHILDREN OF THIS ENTITY"
IMPORTANCE_FIX = 4;
}
// Property of an entity. Don't confuse with an Entity with role="Property"
message Property {
// ID of the implemented Entity
......@@ -355,13 +479,13 @@ message Property {
// Property description
string description = 3;
// Property value
string value = 4;
Value value = 4;
// Property importance
string importance = 5;
Importance importance = 5;
// Property unit
string unit = 6;
// Property datatype
string datatype = 7;
DataType datatype = 7;
// Errors of this property
repeated Message errors = 8;
// Warnings of this property
......@@ -488,6 +612,8 @@ message MultiTransactionRequest {
message IdResponse {
// The entity id.
string id = 1;
// The entity version.
Version version = 5;
// Entity errors.
repeated Message entity_errors = 2;
// Entity warnings.
......