Home > Software design >  Validation of a relations between two objects XSD
Validation of a relations between two objects XSD

Time:12-04

I am new to XSD and I wonder how I can validate if a relation type between two entities is the right one ?

Type "archimate:TechnologyService" can only be linked to xsi:type="archimate:TechnologyProcess" with a relation xsi:type="archimate:RealizationRelationship"

Here is my (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>

Representing this

Realization

I want to invalidate this:

<?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>

Serves

CodePudding user response:

You can't do it with XSD as those types of rules are not present in Archi's model XSD, nor the ArchiMate Exchange Format XSD. ArchiMate tools have their own internal methods to validate relationships.

  • Related