[Zope3-dev] RE: Meta Data

Garrett Smith garrett@mojave-corp.com
Sat, 24 May 2003 12:01:23 -0500


Jim Fulton wrote:
> You are on the right track. It depends on what you mean by the "schema
> framework". Schemas are purely specifications.  The statements above
> are implementation statements.  There is and will be more application
> framework that uses schemas. So in theory, there could be a system
> like the one you suggest for specifying howe to implement a DC schema.

Yeah, "schema framework" is not what I meant here. I'm thinking of a
ZCML directive that would let a developer do something like this:

  <dc:elementmap for=3D"NewsSite.NewsItem.interfaces.INewsItem">
    <dc:propertymap dcelement=3D"Title" property=3D"title" />
    <dc:propertymap dcelement=3D"Description" property=3D"description" =
/>
  </dc:elementmap>

The idea of a "map" is probably wrong here given Python's use of the
term, but you get the idea. In addition to a "propertymap", I could see
a "formulamap" which would use a TALES expression to generate a
read-only element value.

> OTOH, this particular problem is much simpler than it appears,
> I really think that "title" is the only DC property that is sometimes
> meta data and sometimes data (for objects that are not, themselves,
> meta-data objects). A very simple solution to this problem is to
> define a DC adapter that simply delegates the title to the underlying
> content.

Maybe, but INewsItem is already one example that uses description, in
addition to title. Given the central role dc metadata play currently, I
think it'd be wise to define a simple way for components to interface
with any element, not just title.

For example, we recently had an exchange about component 'type'
information. This could be treated as a read-only DC Title element:

  <dc:elementmap for=3D"NewsSite.NewsItem.interfaces.INewsItem">
    <dc:formulamap dcelement=3D"Type" formula=3D"string:News Item" />
  </dc:elementmap>

This might be a bad idea since it collides with the factory info, but it
shows what can be done.

 -- Garrett