company logo

Object Interchange Format (OIF)

OIF data format is a standard defined for object oriented data exchange (ODMG 2003). OIF files may contain any number of instances in any number of collection. When the scope of the OIF file is the database or a selected object instance, the OIF file has to provide a number of properties (prop_list). When the scope for the OIF file is a collection, the OIF file has to provide a number of instances (inst_list).

Since OIF files require tags, only values to be imported or exported need to be defined, i.e. OIF files need not to be complete. When importing an OIF file, properties not defined in the file will not be updated. Properties passed without value cause deleting the property in the database (collection) or creating an empty value.

Furthermore, OIF files can be accessed in exportData() and importData() functions (Property and ObjectSpace) or when opening external files by Property::openExtern().

The data section in an OIF file may be preceded by an ODL schema definition (header). The schema definition may also be provided in the dictionary or passed separately in any file schema definition format. In any case, the OIF data section has to start with the DATA keyword.

Limited access to OIF files is supported by defining OIF extents in the dictionary (access type AT_EXTERN). In this case, the file path is expected in an option having the same name as the extent. No header and no external file description are supported for OIF extents.

In order to provide more flexible access to OIF files, a file description (schema definition) has to be passed explicitly to the Property::openExtern() function. In order to provide an external schema definition, any of the supported definition formats might be used (see Data Exchange schema).

// OIF - Object Interchange Format

//

// OIF provides entries for variable initialization and object exchange file structures

// (database dumps):

//

// scoped_name   locator    OIF data                                 inst_value  

// ---------------------------------------------------------------------------------------------------------------

//      (collection)     |  Persons     { ['Miller'] { name 'Miller',

//      (value_list)     |    first_name {    [0] 'Anton',

//                       |                    [1] 'Emil'  },

//      (prop_list)      |    address    {    zip 12345,

//                       |                    street 'xxx'},

//      (value_list)     |    children   { P1 Person ['Eva']                   { name 'Miller', first_name 'Eva' }

//                       |                    Person                           { name 'Miller', first_name 'Paul'}

//                       |                           [first_name 'Antoinette'] { name 'Miller'                   }

//                       |                                                     { name 'Miller' first_name 'John' }

//      (constant)       |                                                     'Miller|Jennifer'                   }

OIF definition

The syntax for an OIF file is described below as BNF. When defining OIF schema definition in the OIF file, the schema has to be defined as ODL schema.

Definition: 

OIF                   := [ schema_dcl ] OIFData

OIFData               := _data '{' OIFInit '}' [sep]

OIFInit               := prop_list | inst_list | prop_init(*)

prop_init             := identifier ['='] prop_value [sep]        // property name and value

prop_value            := inst_init | inst_list

inst_list             := '{' inst_init(*) '}'

inst_init             := [ inst_intro ] [ locator ] ['='] [ inst_value ] [sep]

inst_intro            := [ identifier ] scoped_name         // object name and type

locator               := update_locator | create_locator

update_locator        := '(' loc_init ')'

create_locator        := '[' loc_init ']'

loc_init              := constant | prop_init(*)

inst_value            := constant | prop_list

prop_list             := '{' prop_init(*) '}'

sep                   := ',' | ';'

_data                 := '_data' | __data

__data                :: 'DATA'

// OIF specifications END

// comment line characters

CC                    := '//'

// bnf references

odl_symbols          ::= class(OSI)

schema_dcl           ::= ref(schema_dcl)

common_symbols       ::= class(OSICommon)

block_intro          ::= ref(block_intro)

comment_block        ::= ref(comment_block)

identifier           ::= ref(identifier)  

scoped_name          ::= ref(scoped_name)  

std_symbols          ::= class(BNFStandardSymbols)

constant             ::= ref(std_constant)

OIF schema definition

OIF files may contain a header defining the OIF schema. The header contains the schema definition as ODL schema definition (see OSI manual).

In order to provide an exchange schema,the data exchange specification has to be provided in the dictionary (resource database).