docs

Infogile Model

Infogile’s model is in its basic setting quite simple, you have a definition of how data is structured and you have data matching that structure.

ObjectDefinintion

As with anywhere you keep structured data you need to have a definition of that structure. In Infogile, the type definition is called an ObjectDefintion. An ObjectDefinition is in it’s simplest form just defining the fields an item in a collection can have.

An ObjectDefinition have many similarities with the Class or Struct in programming. However, they are not similar enough to use the same concept and we decided that ObjectDefinition is a better name.

Each ObjectDefinition can have an arbitrary number of Fields (yes, it can have zero fields but that kind of defeat its purpose. Although possible.)

Example:

{
  "identity": "s880a20e4e35f44f1bbeb59523244e9c2",                 // 33 character GUID - must be generated by Infogile
  "name": "Car",                                                   // The name of the collection
  "description": "Car object definition contains all car's owned", // A brief description of the collection - if necessary
  "apiName": "car",                                                // A unique API name which can be used instead of the identity
  "fields": [
    ...
  ]
}

Field

Fields defines each property of an object. The current available field types are ValueField and ReferenceField (yes, current implies there’s more to come).

Both ValueField and ReferenceField share a number of attributes, such as if the field is mandatory, if it’s a system object (such as Users, which cannot be modified externally).

As the name implies, a ValueField defines a value such as a text, a number, a date or a boolean. ReferenceField references one or more values defined by a specific ObjectDefinition.

ValueField example

{
  "identity": "z048d40bbe8f14e448b1ab6ba36696818", // 33 character GUID - must be generated by Infogile
  "name": "Year purchased",                        // The name of the Field
  "description": "The year the car was purchased", // A brief description of the field - if necessary
  "apiName": "yearPurchased",                      // A unique API name which can be used instead of the identity
  "fieldType": "ValueField",                       // Determines that this is a ValueField
  "type": "decimal",                               // The type of value.
  "mandatory": false                               // If the field requires a value when creating or updating
}

ValueField types

Infogile supports the following ValueField types:

Type Descriptioonn
Numeric The option if you want to use numeric fields
Text Use for string/textural values
Boolean Use for true/false or yes/no values
Datetime Use for dates, date and time or time
Binary Use for binary values such as images, documents, etc.

ReferenceField example

{
  "identity": "oa157a21030cf42f8b50dafe468d1f125",       // 33 character GUID - must be generated by Infogile
  "name": "Color",                                       // The name of the Field
  "description": "The color of the car",                 // A brief description of the field - if necessary
  "apiName": "color",                                    // A unique API name which can be used instead of the identity
  "fieldType": "ReferenceField",                         // Determines that this is a ValueField
  "referencedType": "s880a20e4e35f44f1bbeb59523244e9c2", // The type of value.
  "mandatory": false,                                    // If the field requires a value when creating or updating
  "multiplicity": "OneToOne"                             // If this is a OneToOne relationship or a OneToMany
}

Items

An item is an instance of the type defined by a ObjectDefinition and can have one or more of the fields defined in the ObjectDefinition set.

Item example

{
  "identity": "oa157a21030cf42f8b50dafe468d1f125",       // 33 character GUID - must be generated by Infogile
  "type": "s880a20e4e35f44f1bbeb59523244e9c2",           // References the identity of the ObjectDefinition defining this item
  "sortId": 1.23234,                                     // The sort order for the natural sort order, it's a double-precision 
                                                         // 64-bit IEEE 754 floating point number
  "lastUpdated": "2019-06-23T00:03:41.832Z",             // The timestamp this object was last updated
  "fields": {
    "yearPurchased": 2008.0,                             // The value of the field "Year purchased" - a numeric
    "color": [ "jks8dlghe8fhjalsdid98fj222jskdjal" ]     // The value of the reference field "Color", it's always represented  
                                                         // as a list even if it only can take a single value according to 
                                                         // the ObjectDefinition
  }
}