David BERNARD wrote:
> Because metadata is only a point of view : metadata are data.
I think David touched the key question: what should XIndice be concerned
about?
In our recent XIndice wish-list thread, we identified the need for
having 'metadata' exposed by the database.
I believe there are two kinds of metadata:
1) application level metadata
2) database level metadata
an example of the first is 'author' or 'workflow-status'. This doesn't
require changes in the DB if fully namespace-aware.
examples of the second is 'modified-time', 'lask-accessed-time', 'id'
and all sorts of 'automatically-augmented' attributes.
For the first class of metadata, I see any reason to expose it at this
level: Xindice is a DB engine, not an application provider. It's not its
concern to expose this data and as long as namespaced are handled
correctly, the application sitting on top has maximum freedom to use the
best scheme the want to store metadata.
Another issue is with database-level metadata: there must be a defined
way to obtain this metadata (and modify it, if it makes sense).
IMHO, the XNode API you propose it's not useful in this sense since it
mixes concerns: there is no clear distinction between what is
application level and what is database level.
A possible solution, which require a simple XML:DB API change, is to use
a special namespace (an API-related one, not a container-specific one,
to keep things portable) a for db-related data.
Imagine you have your database as such
<db:database xmlns:db="xml:db api" name="news">
<db:collection name="blah">
<db:node
db:inserted="20020302"
db:last-modified="20020304"
db:event-handler="org.fool.MyEventHandler"
>
<db:metadata xmlns:app="some application">
<app:author>Stefano</app:author>
<app:version>1.0.23</app:version>
<
</db:metadata>
<db:data>
<xhtml xmlns="xhtml">
<body>
<p>blah blah</p>
<db:node db:last-modified="20030303">
<db:data>
<p>blah blah</p>
</db:data>
</db:node>
</body>
</xhtml>
</db:data>
</db:node>
...
</db:collection>
...
</db:database>
[NOTE: this is a *view* of the database, doesn't mean this is to be the
way the database is stored in memory or disk!]
Now, suppose you can ask the XML:DB connector to behave in
'metadata-mode' (with the db: namespace visible) and 'data-mode' (where
the db: namespace is hidden).
in data-mode, the above is simply seen as the document
<xhtml xmlns="xhtml">
<body>
<p>blah blah</p>
<p>blah blah</p>
</body>
</xhtml>
part of the belonging collection.
Note: even in metadata-mode, the portability is still valid: XML:DB API
must only describe the 'schema' that will be queried from XPath, the
rest will be performed by the application.
It's rough and very superficial, I know, but it's a few random thoughts
that might sparkle interesting discussions.
--
Stefano Mazzocchi One must still have chaos in oneself to be
able to give birth to a dancing star.
<[EMAIL PROTECTED]> Friedrich Nietzsche
--------------------------------------------------------------------