properties

The properties are key-value pairs associated with objects (entity, image, video, descriptor, etc) and connections.

Defining properties allow applications to later filter based on these properties.

Property keys are, by default, up to 64 ASCII characters, or if UTF-8, up to 64 bytes. This can be changed through the configuration file, only when creating a new database. Once the database is created, this parameter cannot be changed.

There is no limit to the number of properties defined for an object. There is no restriction to add new, previously not present, properties to existing or new objects. Properties can be added and modified as needed.

NOTE: Property name starting with “_” are reserved for system-defined properties, thus, user-defined property names (keys) cannot start with “_”.

The supported types for property values are:

  • Integer (64bit integer)
  • Float (64bit floating point)
  • String
  • Boolean [true, false]
  • Time (ISO 8601 representation)

Properties are defined as a JSON object in the following way:

"properties": {
    "key1": 2,             // Integer value
    "key2": 3.4,           // Float value
    "key3": "some_string", // String value
    "key4": false,         // Boolean value

    // Time is a special case, defined as follows:
    "key6": {"_date", "2019-06-04T18:59:32+00:00"}
    "key5": {"_date", "Sat Jun 04 18:59:32 UTC 2019"}
}

WARNING: Property types are only enforced for indexed properties. Unless the property is indexed, there is no type checking upon insertion, and there is no guarantee that the returned type is the same for all instances of a property.

Example

// Properties assigned to an entity.
"AddEntity" : {
    "class" : "Person",
    "properties" : {
        "name" :  "Jane Doe",
        "email":  "jane.doe@xyz.com"
        "gender": "F",
        "age":    11,
        "height": 145.4,
        "active": false,
        "date_of_birth":  {"_date", "Sat May 29 18:59:24 PDT 2011"}
    }
}

// Properties assigned to an image.
"AddImage" : {
    "properties" : {
        "date_captured": {"_date", "Sat Jun 04 18:59:24 PDT 2019"}
        "type":          "landscape",
        "aperture":      2.34,
        "flash_active":  true,
    }
}

// Properties assigned to a connection.
"AddConnection" : {
    "class": "BestFriendsForever",
    "ref1" : 1,
    "ref2" : 2,
    "properties" : {
        "place_met" : "Interstellar Park",
        "date" :      {"_date", "Mon Aug 7 10:59:24 PDT 2017"}
    }
}