#105 data.count woes

GREEN
closed
nobody
5
2009-07-29
2009-07-11
Syd Bauman
No

I started out noticing that the <valDesc>s of occurs= and withId= of <tagUsage> say “an integer number greater than zero” where the datatype (very sensibly) permits 0. I was just going to fix this by changing the <valDesc>s to “an integer number greater than or equal to zero”, when I noticed that the <remarks> of the ‘data.count’ tagdoc says “Only positive integer values are permitted” where the datatype clearly permits 0. Personally, it would never occur to me to limit a count to positive numbers — zero is a perfectly reasonable count. But I found myself wondering if TEI really wants to have ‘data.count’ exclude 0 as a possible value, as there are contexts where 0 makes no sense (e.g., rows=, cols=, maxOccurs=). I think the answer is “no”, although in some cases an extra restriction that the count cannot be 0 is appropriate. (Or a different datatype).

On further investigation I found at least one case where data.count is (IMHO) used inappropriately: group= of att.damaged. I am not sure why the grouping would be limited to numbers in the first place, but it is not a count in any case.

There are two cases where nonNegativeInteger is used directly, as opposed to via data.count, and I think these are both appropriate:
language/@usage
att.personal/@sort

The attributes defined as data.count are:
att.damaged/@group
att.tableDecoration/@rows
att.tableDecoration/@cols
att.transcriptional/@seq
tagUsage/@occurs
tagUsage/@withId
refState/@length
layout/@columns
layout/@ruledLines
layout/@writtenLines
handDesc/@hands
att.textCritical/@varSeq
age/@value
table/@rows
table/@cols
graph/@order
graph/@size
node/@inDegree
node/@outDegree
node/@degree
tree/@arity
tree/@order
root/@outDegree
iNode/@outDegree
datatype/@minOccurs
datatype/@maxOccurs

All tests against revision 6658.

Discussion

  • Lou Burnard
    Lou Burnard
    2009-07-29

    • milestone: --> GREEN
    • status: open --> closed
     
  • Lou Burnard
    Lou Burnard
    2009-07-29

    Is zero not a positive number? Anyway, I have changed the definition of data.count to make clearer that zero is permitted. In cases where zero is not appropriate, I think that should be expressed better by means of an rng:param as in the case of language/@usage , or as an additional constraint. I don't understand why you think data.count is inappropriate for att.perrsonal/@sort so I've left that alone for now.