Re: metamodels mapping

Martin Matula <[email protected]> Mon, 14 Apr 2003 18:15:42 +0200
Newsgroups gmane.comp.java.netbeans.modules.mdr.devel
Message-ID <[email protected]>
Hi,

[email protected] wrote:
> What I really don't understand is the terminology used in different ways. For example, if I export 
> metadata from two different repositories, to XML file conforming to a particular DTD, can I say that the 
> DTD is a common metamodel to which both the repositories metamodel are mapped? If then I take the 
> document and I don't make the reverse mapping, but I simply put directly the files on a potal, so that I 
> can let a navigation between metadata contained in the files, can I say that the DTD represent the 
> metamodel of the XML repository in which the file is stored? 

I think I don't understand the problem. If you have a metamodel, then 
you can generate a DTD from that - the DTD does not fully capture all 
the semantics of the metamodel as the expressiveness of DTD is limited 
compared to MOF. So if you take a DTD generated from a metamodel, write 
an XML document that conforms to the DTD, it does not automatically 
mean, that the XML document represents a metadata valid in the context 
of the given metamodel (there may be other constraints in the metamodel 
that are not captured in the generated DTD).

If you export metadata from two different repositories into XML 
documents (say doc1.xml from the first repository and doc2.xml from the 
second repository), then doc1.xml conforms to the DTD generated from the 
metamodel in the first repository and doc2.xml conforms to the DTD 
generated from the metamodel in the second repository. If these 
metamodels happen to be the same, both doc1.xml and doc2.xml conform to 
the same DTD (as the generated DTDs from both repositories are 
identical). Anyway, it is possible that the metamodel in the first 
repository differs in metamodel in the second repository in such a way 
that the generated DTDs are also identical. In this situation, both 
documents will conform to the same DTD, however you will likely not be 
able to load doc2.xml into the first repository and doc1.xml into the 
second one (as they don't represent metadata conforming to the 
metamodels in those repositories).

Anyway, if you forget about XMI and MOF, the DTD does indeed represent a 
metamodel of the data stored in XML file conforming to the DTD. But the 
expressiveness of DTD is not as rich as that of MOF, so mapping between 
MOF and DTD is not isomorphic.

Hopefuly that answers your questions (I am sorry, I was not able to 
fully understand them).
Regards,
Martin