| Integration and Interpretation of XML Schemas | Table of contents | Indexes | Dimap : Satellite image metadata standard based on XML | |||
Boulder ![]() Carlson, Dave Ontogenics Corp. USA ![]() | Dave Carlson |
| Chief Technology Officer |
| Ontogenics Corp. |
| 5564 North Fork Ct.
Suite 100
Boulder
(Colorado)
USA
(80301)
Email: dcarlson@ontogenics.com |
| Biography |
Introduction |
UML ![]() Unified Modeling Language ![]() | Two views of a prototype design are described in this paper. First, a functional view of the model production and XMI translation provides an integrated end-to-end operational description. Then, an architectural view describes a distributed network of repository agents and component brokers operating in a Web-based environment. This paper emphasizes the role and benefits of XML and only introduces the UML and architectural concepts in enough detail to create a descriptive context. |
Functional View of the Component Broker |
|
Metadata ![]() XMI ![]() | Metamodels and DTDs |
|
| A UML DTD defined according to these rules is included as an appendix in the UML Semantics specification [5]. We created our RML metamodel using the Rational Rose modeling tool, then used IBM's XMI Toolkit from their AlphaWorks site to generate an RML DTD from that metamodel. We also used the same XMI Toolkit to create a general purpose Rational Rose resource agent that is able to take any Rose UML model and produce an XMI document output, which is then available to our component broker framework. |
| A concrete example will help to explain our use of these metamodels and DTDs. When the Java resource agent is used to reverse engineer bytecode from the class com.sun.xml.tree.XmlDocument (part of Sun's XML implementation), a rather long, verbose XML document is generated. A very small subset, with sub-elements removed for brevity, is shown below. This XML fragment defines one parameter of one operation in the class definition. The element tag names, generated by the XMI production rules, use a dotted notation to ensure unique elements for the multi-level package structure in the UML metamodel. In this case, Operation is a class in the Core package, which is contained within the Foundation package. |
| A Java method declaration: public void writeXML(XMLWriteContext p1) |
| Translates to the following XMI fragment: |
<Foundation.Core.Operation xmi.id="_146"> <Foundation.Core.ModelElement.name> writeXml </Foundation.Core.ModelElement.name> <Foundation.Core.ModelElement.visibility xmi.value="public" /> <Foundation.Core.Feature.ownerScope xmi.value="instance" /> <Foundation.Core.BehavioralFeature.parameter> <Foundation.Core.Parameter xmi.id="_147"> <Foundation.Core.ModelElement.name> p1 </Foundation.Core.ModelElement.name> <Foundation.Core.Parameter.kind xmi.value="in" /> <Foundation.Core.Parameter.type> <Foundation.Core.Classifier xml:link="simple" href="com.sun.xml.tree.XmlWriteContext" title="XmlWriteContext" /> </Foundation.Core.Parameter.type> </Foundation.Core.Parameter> </Foundation.Core.BehavioralFeature.parameter> </Foundation.Core.Operation> |
| One of the elements in this XML fragment, Foundation.Core.Parameter.type, is the representation of a relationship from the Operation class to the Classifier class. In this example, we don't embed the Classifier definition in the type link, but include a XLink reference with an href location for the complete definition. Our component broker uses this link (with a prefixed base URI for the default broker) along with an XSL stylesheet, to present a hyperlink that Web browsers can follow to another resource agent that is able to produce the complete XML document for this Classifier definition. |
Stylesheet ![]() XPath ![]() XSLT ![]() | Search and Transformation |
| Using the DOM structure produced by a resource agent, the XML document can be searched using XPath [6] or filtered or transformed using XSLT [7]. XPath is used to specify XSLT template patterns, but also provides a partial solution for simple searches of XML structure. The W3C has recently formed an XML Query working group to prepare a proposed recommendation that will likely use XPath as part of its specification. The term XML Query Language (XQL) is often used to refer to this broader solution, but consensus on its specification is still some months away. |
| In a simplistic sense, search is a subset of document transformation because each template rule in an XSLT stylesheet uses a match pattern to search for qualifying elements. The following example is based on the XML fragment described in the last section. The stylesheet processor applies this template to each Parameter element, which in turn applies other specialized templates for transforming the 'type' and 'name' sub-elements. Although it's not shown, the Operation template similarly applied this Parameter template. Notice that this template outputs a ', ' string after the parameter name, but only if this is not the last sibling element contained in the parent element. XSLT provides some very powerful and elegant capabilities! |
<xsl:template match="Foundation.Core.Parameter"> <xsl:apply-templates select="Foundation.Core.Parameter.type"/> <xsl:text> </xsl:text> <xsl:apply-templates select="Foundation.Core.ModelElement.name"/> <xsl:if test="not(position()=last())">, </xsl:if> </xsl:template> |
| When the template is applied to a Foundation.Core.Parameter.type element, it applies another generic template that is used to transform all XLink elements. The following template matches all elements having an attribute named 'xml:link'. From the example in the last section, the Classifer element matches this pattern. This template then transforms the Classifier element into an HTML hyperlink element. |
<xsl:template match="*[@xml:link]">
<xsl:text> </xsl:text>
<A href='{$brokerURL}{@href}'>
<xsl:value-of select="@title"/>
</A>
<xsl:text> </xsl:text>
</xsl:template> |
Distributed Agent Architecture |
| The previous section of this paper described a functional view of the component broker framework. This section presents a brief overview of an architecture where that functionality is distributed across the global Internet. The component broker framework is designed as a logical three-tier architecture, consisting of resource agents, component brokers, and clients. Figure 3 shows a typical deployment of this architecture. |
|
| A component broker is a specialized type of resource agent that maintains a registry of its associated agents/brokers, and always delegates its query processing to one or more of those agents. All inter-agent communication uses standard HTTP protocol with XML response content, thus ensuring maximum interoperability. The primary feature that a broker adds to agent functionality is the ability to transform XMI documents into other XML for HTML document types. Our current broker implementation allows easy configuration for adding XSLT stylesheets that define transformations. |
| There are two major categories of clients: development tools and Web browsers. Development tools may be written, or use existing interfaces, to receive standard XMI formats for UML and RML models. A broker also may be designed to transform XMI documents into other XML document types, such as RDF. Web browser clients will most likely request HTML formatted documents from the broker, but may directly receive the XML documents and apply client-side stylesheets. |
Future Opportunities and Challenges |
| The use of XMI for exchanging information models is still a very new and maturing standard. It will undoubtedly be refined based on implementation feedback, but appears to be gaining industry support, at least among UML tool vendors. We have attempted to push the use of XMI beyond typical UML tools into a more mainstream application with wider scope. Our initial prototypes are encouraging and we will continue to improve the implementations described in this paper. |
| Particular areas for improvement include a much better catalog of component metadata to facilitate broad searches across all resource agents, and an expansion of our simple XPath queries to a more complete XML query language. Both of these improvements must be kept aligned with industry-wide development of search engines and query languages for XML content. The rapid evolution of XML standards and applications will continue to create fertile ground for growth. |
References |
|
| Integration and Interpretation of XML Schemas | Table of contents | Indexes | Dimap : Satellite image metadata standard based on XML | |||