[Zope3-dev] RE: annotations/dc and component definitions

Garrett Smith garrett@mojave-corp.com
Mon, 28 Apr 2003 16:38:47 -0500


I think my confusion comes from the fact that implementing
IAttributesAnnotatable enables the metadata feature for content (an
unexpected result, AFAIC).

I haven't fully dug into this, but from a cursory glance, it looks like
DC metadata are stored using annotations with a namespace "key" in front
of the metadata element name. E.g. <some DC key> + ".title" is used to
store a component's title metadata as an object attribute.

Btw, I don't mean collision in a literal/namespace-conflict sense, but
in the sense of owndership. In some cases, I can see a component wanting
to implement 'title' as a property. In another case, 'title' might be
something that a user attaches to a component.

I think schema authors are going to want to know when 'title' (this is
just one example) should be a field and when it should be metadata.
There are some cases in Zope 3 where I would have expected to see stuff
like title or description as a field, but the developer decided to use
metadata to handle it (e.g. see INewsItem).

  -- Garrett

R. David Murray wrote:
> Subject: Re: annotations/dc and component definitions
>=20
>=20
> "Garrett Smith" <garrett@mojave-corp.com> wrote:
>> - I've noticed that several (most?) content types in Zope 3 use
>> IAttributeAnnotatable to signal that they support annotation via
>> object attributes. Should an interface omit a property (e.g. title,
>> description, etc.) under the assumption that it will be handled via
>> "metadata"? (A good example of this is the NewsSite INewsItem
>> interface=20
>> -- it only defines teaser and body, letting DC annotations handle the
>> rest.)
>=20
> I could be wrong, but I think you have some confusion here about
> what IAttributeAnnotatable means.  It doesn't mean, for example,
> that the 'title' metadata will be held in a 'title' attribute of
> the object.  It means that a single, specific reserved attribute
> name may be used for storing annotations for that object (as opposed
> to, say, storing annotations for that object in an SQL database).
> If I remember correctly, the default IAttributeAnnotatable adapter
> implements this by storing a BTree of BTrees in the reserved
> attribute.  Individual annotation sets are keyed by component name,
> to avoid name-space collision.
>=20
> So, name space *collision* isn't a problem.  But as Steve said,
> a way is needed to simplify cooperation between different
> meta-data providers that are defining attributes that ought
> to share a common implementation.
>=20
> --RDM