验证两个对象之间的关系 XSD

Validation of a relations between two objects XSD

我是 XSD 的新手,我想知道如何验证两个实体之间的关系类型是否正确?

类型“archimate:TechnologyService”只能链接到具有 xsi:type="archimate:RealizationRelationship"

关系的 xsi:type="archimate:TechnologyProcess"

这是我的(archimate)xml:

<?xml version="1.0" encoding="UTF-8"?>
<archimate:model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:archimate="http://www.archimatetool.com/archimate" name="full meta-model" id="id-d8ae3705722c4a808f01c1ba277b6c68" version="4.9.0">
  <folder name="Technology &amp; Physical" id="id-873800e8ceaa48ef89265ddac5b75518" type="technology">
    <element xsi:type="archimate:TechnologyService" name="Technology Service" id="id-b5546f94e55a4c45804c182b5c916515"/>
    <element xsi:type="archimate:TechnologyProcess" name="Technology Process" id="id-1ca241084a8141e7b2292f4cb760201a"/>
  </folder>
  <folder name="Relations" id="id-b2b590869ad04a14a81c9cb388d7fd7d" type="relations">
    <element xsi:type="archimate:RealizationRelationship" id="id-766b9f9efbca4b00b4420ffa45a38c4d" source="id-1ca241084a8141e7b2292f4cb760201a" target="id-b5546f94e55a4c45804c182b5c916515"/>
  </folder>
</archimate:model>

代表这个

我想使这个无效:

<?xml version="1.0" encoding="UTF-8"?>
<archimate:model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:archimate="http://www.archimatetool.com/archimate" name="full meta-model" id="id-d8ae3705722c4a808f01c1ba277b6c68" version="4.9.0">
  <folder name="Technology &amp; Physical" id="id-873800e8ceaa48ef89265ddac5b75518" type="technology">
    <element xsi:type="archimate:TechnologyService" name="Technology Service" id="id-b5546f94e55a4c45804c182b5c916515"/>
    <element xsi:type="archimate:TechnologyProcess" name="Technology Process" id="id-1ca241084a8141e7b2292f4cb760201a"/>
  </folder>
  <folder name="Relations" id="id-b2b590869ad04a14a81c9cb388d7fd7d" type="relations">
<element xsi:type="archimate:ServingRelationship" id="id-365a23fe89dc48539b1f2551a424fdea" source="id-1ca241084a8141e7b2292f4cb760201a" target="id-b5546f94e55a4c45804c182b5c916515"/>
  </folder>
</archimate:model>

您不能使用 XSD 来做到这一点,因为这些类型的规则不存在于 Archi 的模型 XSD 中,也不存在于 ArchiMate 交换格式 XSD 中。 ArchiMate 工具有自己的内部方法来验证关系。