External spec schemas

The external schema is a transformation of the internal schema that relaxes the rules for mandatory elements.

The resulting transformation is a schema in which all of the elements are optional, even though some of these elements are otherwise defined as mandatory in the internal schema. This allows the Rules of Visibility feature or related concepts to be supported. For example, when certain elements must be removed from a view of an XML document governed by the internal schema, such as restricted query results, if those elements are mandatory in the internal schema, the internal schema can no longer be used for validation. In such a case, the external schema is used instead.

If you create the external schema manually, you must configure it using the following specifications:
  • The target namespace for the external schema is the same as the internal schema except that the path internal is replaced by external. For example, if the namespace for a spec named testSpec appears in the internal schema as follows:
    http://www.ibm.com/mdm/data/specs/testSpec/internal/00000001
    
    the equivalent namespace for the external schema would be:
    http://www.ibm.com/mdm/data/specs/testSpec/external/00000001
    
  • All elements within the external schema must be optional. If the internal schema does not use the minOccurs='0' attribute to make an element optional, this will be enforced in the external schema. Where a minOccurs attribute is provided, the original value is retained within an annotation. For example, the following complex type definition in the internal schema:
    <xsd:complexType name="exampleType">
      <xsd:sequence>
        <xsd:element ref="example:elementA"/>
        <xsd:element ref="example:elementB" minOccurs ="0"/>
        <xsd:element ref="example:elementC" minOccurs ="1"/>
      </xsd:sequence>
    </xsd:complexType>
    
    leads to the following complex type definition in the external schema:
    <xsd:complexType name="exampleType ">
      <xsd:sequence>
        <xsd:element ref="example:elementA" minOccurs="0"/>
        <xsd:element ref="example:elementB" minOccurs="0">
          <xsd:annotation>
            <xsd:appinfo>
              <mdmspec:elementInfo>
                <minOccurs>0</minOccurs>
              </mdmspec:elementInfo>
            </xsd:appinfo>
          </xsd:annotation>
        </xsd:element>
        <xsd:element ref="example:elementC" minOccurs="0">
          <xsd:annotation>
            <xsd:appinfo>
              <mdmspec:elementInfo>
                <minOccurs>1</minOccurs>
              </mdmspec:elementInfo>
            </xsd:appinfo>
          </xsd:annotation>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
    
  • The external schema name must be in the form <specName>.external.xsd.

Alternately, you can use the InfoSphere® MDM Workbench to generate the external schema when you build the metadata project in the InfoSphere MDM Workbench.