IssuesWithConceptStates

JacobAsiedu - Thu Oct 05 2006 - Version 1.1
Parent topic: DiscussionFor1dot1RC2
The uniqueness constraint(CharacterStateKey) on StateDefinition's ensure's that global states cannot be referenced more than once within Characters in a Terminology. This is because of

<xs:field xpath="@id|@ref"/>
in the identity constraint declaration.

This issue is illustrated with the example below. Attempting to reference 'efg301' more than once results in a validation error.

...
        <ConceptStates>
          <StateDefinition id="efg301">
            <Representation>
              <Label xml:lang="en" audience="efg2">brown</Label>
            </Representation>
          </StateDefinition>
....
  <CategoricalCharacter id="efg458">
        <Representation>
          <Label xml:lang="en" audience="efg2">Flower Color</Label>
        </Representation>
        <States>
          <StateReference ref="efg301"/>
        </States>
      </CategoricalCharacter>
  <CategoricalCharacter id="efg459">
        <Representation>
          <Label xml:lang="en" audience="efg2">Leaf Color</Label>
        </Representation>
        <States>
          <StateReference ref="efg301"/>
        </States>
      </CategoricalCharacter>

A solution will be to declare both ConceptStateKey and CharacterStateKey as follows

	<xs:unique name="SomeUniqueName">
			
			<xs:selector xpath=".//u:StateDefinition"/>
			<xs:field xpath="@id"/>
		</xs:unique>

This ensures that id's on StateDefinition's are unique throughout a document.

-- Main.JacobAsiedu - 05 Oct 2006