EIMML Specification
External Information Model Markup Language (EIMML) is an XML serialization of Chandler External Information Model (EIM) records.
Schema
Below are proposed schemas for EIMML in the
RELAX NG compact notation. I (bcm) am not sure how correct they are and am not immediately aware of a good tool for validating the schemas.
The first schema is the "core" schema that defines basic patterns. The remaining schemas define patterns for specific EIM record types (item, event, etc).
Core Schema
http://svn.osafoundation.org/server/cosmo/branches/0.6.1/cosmo/src/main/resources/eimml-core.rnc
Patterns are defined for the contents of each typed field element (text, decimal, etc). Record elements, regardless of record type, may only contain fields of these types.
Collection
The root element of an EIMML document is
eim:collection. It contains zero or more recordsets describing the items within the collection. The UUID of the collection is provided in the mandatory
uuid attribute, and the collection's display name is provided in the optional
name attribute.
Record Sets
A record set is an EIMML construct that groups records that are related to the same item. The UUID of the item associated with a record set is provided in the
uuid attribute of
eim:recordset.
Key Fields
Each record has one or more fields marked with the true-valued
eim:key attribute as a key field. Key fields represent immutable data like item UUIDs and are provided only for the purpose of identifying the data in storage corresponding to the record.
Field Values
Empty values are represented as empty field elements with the true-valued
empty attribute. Only text, blob and clob and clob fields may be marked empty.
Null values are represented as empty field elements without the
empty attribute or with the attribute with any value other than
true.
Field values MAY be written as character data to allow XML processors to skip parsing of the character data value.
Datetime values MUST be formatted as per the XML Schema Datatypes specification and MAY include timezone information. By contrast, timestamp values MUST be specified as decimals with no fractional digits, indicating the number of milliseconds elapsed since the epoch.
Deletion
A record set representing an item which had been removed from an EIM application's storage is marked with the true-valued
eim:deleted attribute. None of the records pertaining to the item need be enclosed in the record set (although they certainly may be).
Similarly, a record representing a stamp which has been removed from an item is also marked with
eim:deleted. Unlike record sets, a deleted record must include at least the key fields that allow the associated item or other data to be identified.
Item and note records may not be marked deleted. Item removal is represented by the
eim:deleted attribute on the item's
eim:recordset.
EIMML does not define a representation of a deleted collection.
Extensibility
The core schema provides for extension schemas that define concrete record types. An EIMML processor MUST be able to consume records containing fields of the elementary field types even if the processor is not aware of the extension record type, and it MUST be able to emit those same records.
Record Type Schemas
http://svn.osafoundation.org/server/cosmo/branches/0.6.1/cosmo/src/main/resources/eimml-item.rnc
http://svn.osafoundation.org/server/cosmo/branches/0.6.1/cosmo/src/main/resources/eimml-modifiedBy.rnc
http://svn.osafoundation.org/server/cosmo/branches/0.6.1/cosmo/src/main/resources/eimml-note.rnc
http://svn.osafoundation.org/server/cosmo/branches/0.6.1/cosmo/src/main/resources/eimml-event.rnc
http://svn.osafoundation.org/server/cosmo/branches/0.6.1/cosmo/src/main/resources/eimml-displayAlarm.rnc
http://svn.osafoundation.org/server/cosmo/branches/0.6.1/cosmo/src/main/resources/eimml-task.rnc
http://svn.osafoundation.org/server/cosmo/branches/0.6.1/cosmo/src/main/resources/eimml-message.rnc
Partial Records and Record Sets
No record field elements are mandatory, which allows EIM applications to omit record fields as necessary (if an item attribute hasn't changed since its last update, for example).
Similarly, no records are required to be present in a record set (allowing an application to omit a record if none of the associated attributes have changed).
Note that omitting a field or record does not mean that the data has been removed from the item in the EIM application's storage (see above for the representation of deletion).
Extensibility
All record type schemas are extensible, allowing EIM applications to define new fields (but new field types). An EIMML processor MUST be able to consume records of known record types that contain unknown fields of the elementary field types, and it MUST be able to emit those same records.
Examples
This document describes a collection containing a simple event-stamped item:
<?xml version='1.0' encoding='UTF-8'?>
<eim:collection uuid="1ab47f6e-bae7-11db-c2fd-d837e089b4dc"
name="Chandler Test"
xmlns:eim="http://osafoundation.org/eim/0">
<eim:recordset uuid="1de3f46c-bae7-11db-c2fd-d837e089b4dd">
<item:record xmlns:item="http://osafoundation.org/eim/item/0">
<item:uuid eim:key="true" eim:type="text">1de3f46c-bae7-11db-c2fd-d837e089b4dd</item:uuid>
<item:title eim:type="text">From Chandler</item:title>
<item:triage eim:type="text">100 -1173754610.00 1</item:triage>
<item:createdOn eim:type="decimal">1171318773</item:createdOn>
</item:record>
<modby:record xmlns:modby="http://osafoundation.org/eim/modifiedBy/0">
<modby:uuid eim:key="true" eim:type="text">1de3f46c-bae7-11db-c2fd-d837e089b4dd</modby:uuid>
<modby:userid eim:key="true" eim:type="text">bcm@example.org</modby:userid>
<modby:timestamp eim:key="true" eim:type="decimal">1171318890</modby:timestamp>
</modby:record>
<note:record xmlns:note="http://osafoundation.org/eim/note/0">
<note:uuid eim:key="true" eim:type="text">1de3f46c-bae7-11db-c2fd-d837e089b4dd</note:uuid>
<note:body empty="true" eim:type="clob" />
<note:icalUid eim:type="text">1de3f46c-bae7-11db-c2fd-d837e089b4dc</note:icalUid>
<note:reminderTime eim:type="decimal" />
</note:record>
<event:record xmlns:event="http://osafoundation.org/eim/event/0">
<event:uuid eim:key="true" eim:type="text">1de3f46c-bae7-11db-c2fd-d837e089b4dd</event:uuid>
<event:dtstart eim:type="text">;VALUE=DATE-TIME:20070212T074500</event:dtstart>
<event:duration eim:type="text">PT1H</event:duration>
<event:location eim:type="text" />
<event:rrule eim:type="text" />
<event:exrule eim:type="text" />
<event:rdate eim:type="text" />
<event:exdate eim:type="text" />
<event:status eim:type="text">CONFIRMED</event:status>
</event:record>
</eim:recordset>
</eim:collection>
This document describes the same collection but with the item's event stamp removed:
<?xml version='1.0' encoding='UTF-8'?>
<eim:collection uuid="1ab47f6e-bae7-11db-c2fd-d837e089b4dc"
name="Chandler Test"
xmlns:eim="http://osafoundation.org/eim/0">
<eim:recordset uuid="1de3f46c-bae7-11db-c2fd-d837e089b4dd">
<event:record xmlns:event="http://osafoundation.org/eim/event/0" eim:deleted="true">
<event:uuid eim:key="true" eim:type="text">1de3f46c-bae7-11db-c2fd-d837e089b4dd</event:uuid>
</event:record>
<item:record xmlns:item="http://osafoundation.org/eim/item/0">
<item:uuid eim:key="true" eim:type="text">1de3f46c-bae7-11db-c2fd-d837e089b4dd</item:uuid>
<item:title eim:type="text">From Chandler</item:title>
<item:triage eim:type="text">100 -1173754610.00 1</item:triage>
<item:createdOn eim:type="decimal">1171318773</item:createdOn>
</item:record>
<modby:record xmlns:modby="http://osafoundation.org/eim/modifiedBy/0">
<modby:uuid eim:key="true" eim:type="text">1de3f46c-bae7-11db-c2fd-d837e089b4dd</modby:uuid>
<modby:userid eim:key="true" eim:type="text">bcm@example.org</modby:userid>
<modby:timestamp eim:key="true" eim:type="decimal">1171318890</modby:timestamp>
</modby:record>
<note:record xmlns:note="http://osafoundation.org/eim/note/0">
<note:uuid eim:key="true" eim:type="text">1de3f46c-bae7-11db-c2fd-d837e089b4dd</note:uuid>
<note:body empty="true" eim:type="clob" />
<note:icalUid eim:type="text">1de3f46c-bae7-11db-c2fd-d837e089b4dc</note:icalUid>
<note:reminderTime eim:type="decimal" />
</note:record>
</eim:recordset>
</eim:collection>
This document describes a collection containing an item that has been removed from storage:
<?xml version='1.0' encoding='UTF-8'?>
<eim:collection uuid="1ab47f6e-bae7-11db-c2fd-d837e089b4dc"
name="Chandler Test"
xmlns:eim="http://osafoundation.org/eim/0">
<eim:recordset uuid="1de3f46c-bae7-11db-c2fd-d837e089b4dd" eim:deleted="true" />
</eim:collection>
References
XML Schema Part 2: Datatypes
Changes
- 3/14/2007 - updated examples to change from
event:dtend to event:duration
- 3/13/2007 - updated examples to show that triage rank is a negative decimal rather than a unix timestamp
- 3/12/2007 -
- removed eventModification record type, as it is replaced by the event record type with a uuid field specifying the recurrence id of the event occurrence and the uuid of the parent item
- replaced item:triageStatus and item:triageStatusChanged with consolidated item:triage
- replaced item:lastModifiedBy with modifiedBy record type
- updated examples
- 2/13/2007 -
- updated deletion section to correctly describe that EIMML does not define a representation for deleted collections
- updated examples, added unstamping example
- 2/12/2007 - added
empty attribute to distinguish empty values from null values for text, blob and clob fields
- 2/7/2007 -
- removed the requirement that clob and text values be represented as character data
- added the
empty attribute for field elements to distinguish between null and empty string values
- 1/10/2007 -
- replaced
eim:records with eim:collection and added its name and uuid attributes
- removed collection record type
- clarified details on collection and item deletion
- updated timestamp field type to specify the number of milliseconds since the epoch
- 12/20/2006 -
- made record's uuid a field (mandatory, since it is the record key)
- removed the namespace from recordset's uuid attribute to make it clear that recordset is the only core element that knows anything about uuids
- added eim:key attribute denoting a field that is a record's primary key (or part of a compound primary key)
- added integer field type
- added timestamp field type and made item:createdOn a timestamp field
- replaced lob field type with clob and blob field types and made note:body a clob field
- 12/19/2006 - complete rewrite
- 11/29/2006 - noted DTSTART etc values are specified as RFC 2445 datetimes
- 11/29/2006 - moved from SharingProject to this page, reorganized sections, updated example document, added change log