[DDI-users] DDI 3.2: Schema allows double identification sequence

Wackerow, Joachim Joachim.Wackerow at gesis.org
Thu Dec 11 05:46:44 EST 2014


Jani,

I looked at your proposed change of the XML Schema and made test instances. It doesn't resolve the issue. An instance can still have two URNs or two sets of the identifier sequence (or URN or set of identifier sequence or both which is fine).

It is really the fact that the XML Schema expression possibilities have limitations, like Wendy described.

As a general remark: the DDI spec is the combination of XML Schema and the documentation. Sometimes the XML Schema cannot express all desired things. Then the documentation is important. Even if the documentation could sometimes be better. Any hints for improving the documentation and contributions to it would be appreciated.

Achim


From: ddi-users-bounces at icpsr.umich.edu [mailto:ddi-users-bounces at icpsr.umich.edu] On Behalf Of Jani Hautamäki
Sent: Mittwoch, 3. Dezember 2014 23:16
To: ddi-users at icpsr.umich.edu
Subject: [DDI-users] DDI 3.2: Schema allows double identification sequence


In DDI-Lifecycle 3.2 the narrative documentation

http://www.ddialliance.org/Specification/DDI-Lifecycle/3.2/XMLSchema/FieldLevelDocumentation/schemas/reusable_xsd/complexTypes/AbstractIdentifiableType.html

for the type

{ddi:reusable:3_2}AbstractIdentifiableType

states that

"An entity can either be identified either by a URN and/or an identification
sequence. At a minimum, one or the other is required. "

However, according to the XML Schema, the following XML document is valid.

---8<---8<---8<---
<?xml version="1.0" encoding="utf-8"?>
<ddi:DDIInstance
    xmlns:ddi="ddi:instance:3_2"
    xmlns:r="ddi:reusable:3_2"
    >

  <r:Agency>acme.org</r:Agency>
  <r:ID>ddi_instance</r:ID>
  <r:Version>1</r:Version>

  <r:Agency>acme.org</r:Agency>
  <r:ID>another_ddi_instance</r:ID>
  <r:Version>2</r:Version>

</ddi:DDIInstance>
---8<---8<---8<---

This is invalid according to specification, but the restriction
is not expressed formally with XML Schema.

My question is then:

Is this a mistake/bug in the XML Schema? (If not, please explain why
it is better to formally allow such invalid documents?)

The XML Schema language allows one to express formally the restriction
"either one or both". The details are laid down, for instance, in the answer
http://stackoverflow.com/questions/9863056/xsd-schema-either-one-or-both

Here's a patch for the file "reusable.xsd" that is included in the current
distribution package of the DDI-Lifecycle 3.2:



http://www.pastebucket.com/72481




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.icpsr.umich.edu/pipermail/ddi-users/attachments/20141211/afc281f5/attachment.html 


More information about the DDI-users mailing list