By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,836 Members | 2,028 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,836 IT Pros & Developers. It's quick & easy.

xml metadata

P: n/a
Hi

in relational databases we have in general such things as "tables",
"columns", "primary keys", "foreign keys".

Are there corresponding entities in the xml world? Xml is used to represent
data (as a database is), and I was wondering how such things can be managed
with xml.

I have been given the task to develop a component (a program) which can
represent metadata in a generic form for many different types of data
source. I am just having trouble seeing the abstraction which can represent
an xml file and a relational database, so any help/advice would be
appreciated.

Thanks,
Peter
Apr 18 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Peter Kirk wrote:
in relational databases we have in general such things as "tables",
"columns", "primary keys", "foreign keys".

Are there corresponding entities in the xml world?
Yes, there's a data model underlying XML. Or rather there wasn't
originally, but then someone reverse engineered a description of one
according to how XML worked. Try reading the "XML Infoset" note on the
W3C site.

This is better though than SGML, which still just exists at the parsed
document level and doesn't really go beyond that. One of the (many)
reasons I prefer RDF is that that was designed _around_ a data model,
then had some serialisations (including RDF/XML) described for it.

I have been given the task to develop a component (a program) which can
represent metadata in a generic form for many different types of data
source.


(IMHO) Don't use XML, use RDF. This isn't because "RDF is a metadata
protocol" (it isn't, although this is a regularly quoted
misunderstanding). The reason is that processing XML really requires a
pre-defined schema (similar to a data model) before you can work with
its data. In a world of generic metadata you rarely get this luxury.

If you have to work with XML metadata, you'll find yourself hammering
your metadata flat into some consistent model before you can work with
it. Look at the museums and libraries world for best practice of how to
do this well - Dublin Core, OAI, all the well-known projects are well
worth looking at. There's a lot of wheels out there, shame to go
re-inventing them.

Apr 18 '06 #2

P: n/a
Peter Kirk wrote:
in relational databases we have in general such things as "tables",
"columns", "primary keys", "foreign keys".

Are there corresponding entities in the xml world? Xml is used to
represent data (as a database is), and I was wondering how such things can
be managed with xml.

I have been given the task to develop a component (a program) which can
represent metadata in a generic form for many different types of data
source. I am just having trouble seeing the abstraction which can
represent an xml file and a relational database, so any help/advice would
be appreciated.


XML is used for describing tree structures. Relational databases can also be
used to describe tree structures (by using foreign keys), but they are not
limited to trees. E.g. in relational databases, you can have cyclic
references or entities with multiple "parents". Or a tuple referencing
another tuple, but you could not say that one is the "parent" of the other
one.
With XML by itself, you are limited to trees. Of course you could think of
mechanisms for cross-referencing an XML node from another node, but this
would then be part of a schema on top of XML.

So you cannot generally say things like "a column in a relational database
matches a node in XML" or so.
At most, you might say "a relational database matches an XML document".

On a more concrete level, you could however say things like: "A tuple in
this relation matches a certain kind of node (at a certain position) in an
XML document that conforms to a certain schema".

Best regards,

Felix
Apr 18 '06 #3

P: n/a
Peter Kirk wrote:
Hi

in relational databases we have in general such things as "tables",
"columns", "primary keys", "foreign keys".

Are there corresponding entities in the xml world?
Not directly. See the FAQ at http://xml.silmaril.ie/authors/databases/
Xml is used to represent
data (as a database is), and I was wondering how such things can be managed
with xml.
Databases classically record rectangular data in nice neat rows
and columns. XML was designed for arbitrary continuous text, which
is a different model. XML can of course also be used for rectangular
data very successfully, but that wasn't it's primary purpose, and it
has many other features which do not map at all easily to database
technology (and vice versa).
I have been given the task to develop a component (a program) which can
represent metadata in a generic form for many different types of data
source. I am just having trouble seeing the abstraction which can represent
an xml file and a relational database, so any help/advice would be
appreciated.


To enable a generic representation you will need to generate a data
model capable of describing all known metadata types; in effect a
taxonomy of metadata. Or use one of the existing mechanisms which
can be used for XML representations of ontologies (eg Topic Maps,
ISO 11179, etc).

///Peter
--
XML FAQ: http://xml.silmaril.ie/
Apr 19 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.