UML 的 XMI 有 XSD 吗? [英] Does UML have an XSD for it's XMI?

查看:24
本文介绍了UML 的 XMI 有 XSD 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

UML XMI 文件有 XSD 吗?

Is there a XSD for UML XMI files?

标头只包含命名空间引用.

The header just contains namespace references.

<xmi:XMI xmi:version="2.1"
    xmlns:uml="http://schema.omg.org/spec/UML/2.1"
    xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
    xmlns:thecustomprofile="http://www.sparxsystems.com/profiles/thecustomprofile/1.0">

我设法找到的唯一文件是这个 http://www.omg.org/spec/XMI/20131001/XMI.xsd 但这只是对 XMI 本身的描述(差异/文档),而不是 UML.

The only file I've managed to track down is this http://www.omg.org/spec/XMI/20131001/XMI.xsd however this is just description of the XMI itself (Difference/Documentation), but not the UML.

这意味着我不知道以下过程是如何进行的

That means that I have no knowledge of how the process the following

<generalization
    xmi:type="uml:Generalization" 
    xmi:id="EAID_8CC13F09_BD19_406b_A4B4_37FB8B315EF0" 
    general="EAID_E1F9FAD6_2BDB_40ad_AAE2_E3935ADD1CDC"/>

因为我无法知道 general 的类型是什么(当然我可以对照全局 ID 表进行检查,但是对于每个属性和 TextElement 这样做似乎很愚蠢).

as I have no way of knowing what is the type of general (of course I can check against a global ID table, but that seems stupid to do for every single attribute and TextElement).

我希望有类似的东西

<xsd:complexType name="Generalization">
    <xsd:attribute name="general" type="xsd:IDREFS" use="optional"/>
    ...
</xsd:complexType>

UML的XMI有这样的描述吗?

Does the UML's XMI has such description?

推荐答案

经过一番挖掘,我的结论不仅是这样的 XSD 不存在,而且根本不存在,因为它不强大足以正确表达 UML 的所有 OCL 约束和规则.

After some more digging, my conclusion is not only that such XSD doesn't exist, but that it can't exist at all, because it is not powerful enough to properly express all the OCL constrains and rules of UML.

正确的方法应该是通过符合标准的 UML 模型来验证/处理它,因此正确处理 XML 的必要信息必须以某种方式从模型中导出.

The correct approach should be to validate/process it through a conforming UML model, so the necessary information to properly process the XML has to be somehow derived from the model.

更新:

根据@Thomas 的建议,我写信给 Sparx 并得到以下回复

Per @Thomas' suggestion I wrote to Sparx and got the following response

它源自 UML 元模型.

It's derived from the UML metamodel.

不,我们没有 XMI 格式的 XSD.

No, we don't have an XSD for the XMI format.

这证实了我的假设,即信息应该来自元模型.

Which confirms my assumption that the information should be derived from the metamodel.

这篇关于UML 的 XMI 有 XSD 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆