Feature #79

Schematron rule needed to check for mutiples.

Added by Gary Patchen almost 3 years ago. Updated almost 3 years ago.

Status:New Start date:09/01/2010
Priority:Normal Due date:
Assignee:Bob Jolliffe % Done:

0%

Category:Validation
Target version:v.Next (Postponed)
Origin:Email Origin Reference:

Description

Rules like this are confusing when you add the code-list twice by accident, as the message keep telling you it is not defined in the XML, yet you can see it is defined. Often you may have many code-list and it easy to NOT spot you have the same code-list more than once.

<sch:rule context="msg:HierarchicalCodelists/st:HierarchicalCodelist/st:CodelistRef" 
role="Codelist references">
<sch:let name="id" value="st:CodelistID"/>
<sch:let name="agency" value="st:AgencyID"/>
<sch:let name="version" value="st:Version"/>
<sch:let name="codelist"
value="/msg:Structure/msg:CodeLists/st:CodeList[@id=$id and
@agencyID=$agency and @version=$version]"/>
<sch:assert test="count($codelist)=1">It is an error if a CodelistRef used in a
hierarchy refers to a code list which has not been defined in
msg:CodeLists</sch:assert>
</sch:rule>

Suggest we add a rule to check for multiple instance first before we execute the rules that have count(???) = 1

History

Updated by Bob Jolliffe almost 3 years ago

Hi Gary

This is a tooling issue rather than one related to the standard. So whereas i agree we can improve the tooling in many ways (perhaps including this), I am not sure we need to say in the standard that you should not make duplicate codelists by accident. I think it is implicit in sdmx and the use of unique identifiers that this is the case.

Suggest reject

Gary Patchen wrote:

Rules like this are confusing when you add the code-list twice by accident, as the message keep telling you it is not defined in the XML, yet you can see it is defined. Often you may have many code-list and it easy to NOT spot you have the same code-list more than once.

<sch:rule context="msg:HierarchicalCodelists/st:HierarchicalCodelist/st:CodelistRef"
role="Codelist references">
<sch:let name="id" value="st:CodelistID"/>
<sch:let name="agency" value="st:AgencyID"/>
<sch:let name="version" value="st:Version"/>
<sch:let name="codelist"
value="/msg:Structure/msg:CodeLists/st:CodeList[@id=$id and
@agencyID=$agency and @version=$version]"/>
<sch:assert test="count($codelist)=1">It is an error if a CodelistRef used in a
hierarchy refers to a code list which has not been defined in
msg:CodeLists</sch:assert>
</sch:rule>

Suggest we add a rule to check for multiple instance first before we execute the rules that have count(???) = 1

Also available in: Atom PDF