Graphical design component

r4 - 20 Oct 2006 - 15:51:30 - GregorHagedornYou are here: TWiki >  SDD Web > DiscussionFor1dot1RC2 > IssuesWithCharacterStateIdentityConstraint

IssuesWithCharacterStateIdentityConstraint

In SDD1.1RC2 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.

I have implemented this in SDD.xsd at rev 39 of the Subversion trunk

-- JacobAsiedu - 05 Oct 2006

The issue seems indeed to be a bug. I believe that the result should make sure that:

  • concept state id-values are unique within the entire document (not only within a single concept).
  • concept state references are unique within the scope of a single character. If the latter is truly difficult, we could drop the constraint.

Did we have any other intentions? I cannot remember.

At the moment I cannot follow your proposed solution - please check for me whether the constraint above are stated correctly, and whether your solution fullfills them.

Thanks!

-- GregorHagedorn - 20 Oct 2006

Edit | Attach | Printable | Backlinks: Web, All Webs | History: r4 < r3 < r2 < r1 | More topic actions
 
Back to TDWG Homepage TDWG Wiki > SDD
This site is powered by the TWiki collaboration platform

Valid XHTML 1.0 Transitional
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback