[Chandler-dev] Re: Next steps: external information model

Phillip J. Eby pje at telecommunity.com
Thu Sep 7 13:47:37 PDT 2006


At 01:23 PM 9/7/2006 -0700, Brian Moseley wrote:
>On 9/7/06, Phillip J. Eby <pje at telecommunity.com> wrote:
>
>>To put it another way, both Cosmo and Chandler are already going to have to
>>have code to read, write, and understand EIM records, so why also add code
>>to read/write/understand an XML schema too?  :)  So we might as well
>>represent any schema information as some additional EIM records that just
>>have a hard-coded schema.
>
>i hear you, but i'd like to see a concrete example to help pull it
>together for me, if you have some time. thanks.

Well, let's say we have a record type defined thus in Chandler:

@sharing.recordtype("http://schemas.osafoundation.org/pim/contentitem")
def itemrecord(itsUUID, title, body, createdOn, description, lastModifiedBy):
     # details omitted

We might represent the type information as a set of EIM records like this:

("http://schemas.osafoundation.org/pim/contentitem", "itsUUID", "UUID")
("http://schemas.osafoundation.org/pim/contentitem", "title", "Text")
("http://schemas.osafoundation.org/pim/contentitem", "body", "Text")
("http://schemas.osafoundation.org/pim/contentitem", "createdOn", "Timestamp")
("http://schemas.osafoundation.org/pim/contentitem", "description", "Text")
("http://schemas.osafoundation.org/pim/contentitem", "lastModifiedBy", "UUID")

This provides enough data to be able to determine what record types exist, 
what columns they have, and what type they are.  Of course, the type 
strings I gave above are made-up; they could be something that maps to e.g. 
XML schema types, if that's a suitable type system.

Notice too that this system can be self-expressing, e.g. via something like:

("http://schemas.osafoundation.org/EIM/typeInfo", "typeURI", "URI")
("http://schemas.osafoundation.org/EIM/typeInfo", "fieldName", "Text")
("http://schemas.osafoundation.org/EIM/typeInfo", "fieldType", "TypeID")

But this meta-meta-information would be hardcoded rather than transmitted, 
since it has to be fundamentally agreed upon in order to be able to 
communicate at all.  :)

With regard to the type system, it's possible for example that we might 
have a separate set of records for types, e.g.:

("Text", "...XSD for the text type...")
("UUID", "...XSD for the UUID type...")

etc.  (Again, if we want to use the XSD type system.)



More information about the chandler-dev mailing list