ddialliance / ddi-c_2

DDI Codebook schema 2.x
https://ddialliance.org/Specification/DDI-Codebook/
Other
1 stars 3 forks source link

qstn attributes in the Schema #14

Closed dusadrian closed 3 months ago

dusadrian commented 3 months ago

Hi again,

I'm trying to understand how the public documentation is correlated with the XML Schema. Specifically, the element "qstn"s example showcases an attribute "ID":

<var>
  <qstn ID="Q125">
    When you get together with your friends, would you say you
    discuss political matters frequently, occasionally, or never?
  </qstn>
</var>

This attribute "ID" is not listed in the "qstnType" complex element, so I assume it is part of the global attributes. However, there is an attribute named "qstn" that is undocumented. If kept for backwards compatibility, this should probably be mentioned somewhere in the documentation (I also looked in the change log for version 2.5, there is nothing there, too).

wlthomas commented 3 months ago

I'll check that. The ID is indeed part of the global attributes. The attribute qstn is an ID reference to the source qstn if already stated. Note the currently ONLY the schema has b been updated. This is the development not publication github site and I have not updated the other content yet.

Wendy

On Wed, Jul 17, 2024, 04:04 Adrian Dușa @.***> wrote:

Hi again,

I'm trying to understand how the public documentation is correlated with the XML Schema. Specifically, the element "qstn"s example showcases an attribute "ID":

When you get together with your friends, would you say you discuss political matters frequently, occasionally, or never?

This attribute "ID" is not listed in the "qstnType" complex element, so I assume it is part of the global attributes. However, there is an attribute named "qstn" that is undocumented. If kept for backwards compatibility, this should probably be mentioned somewhere in the documentation (I also looked in the change log for version 2.5, there is nothing there, too).

— Reply to this email directly, view it on GitHub https://github.com/ddialliance/ddi-c_2/issues/14, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJT47KCWXBVTJCUXLEPLG3ZMYXSXAVCNFSM6AAAAABLAF3ZO2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQYTGMBWG42DKNI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

wlthomas commented 3 months ago

I have checked the schema documentation and this is what it says for the attribute

The attribute "qstn" is a reference to the question ID for the variable. I have asked Jon to generate the html documentation. Do I need to extend this statement?
dusadrian commented 3 months ago

That would be great, but I also meant to update the description field of the element "qstn", for instance it describes:

...
The "ID" attribute contains a unique identifier for the question.
"Var" references the ID(s) of the variable(s) relating to the
question.
...

Perhaps it would also need a description of the attribute "qstn", in the lines of what you wrote above. Also, I noticed the argument "var" is described as "Var". If the name is important, it should be corrected.

wlthomas commented 3 months ago

OK that makes sense. I'll review the description and examples for all locations of the attribute "qstn" as well as the full documentation of "qstn". I'll also add an example of a full set of elements. I'll check back on the history of the "qstn" attribute and clarify it's use.

On Wed, Jul 17, 2024 at 10:55 AM Adrian Dușa @.***> wrote:

That would be great, but I also meant to update the description field of the element "qstn", for instance it describes:

... The "ID" attribute contains a unique identifier for the question. "Var" references the ID(s) of the variable(s) relating to the question. ...

Perhaps it would also need a description of the attribute "qstn", in the lines of what you wrote above. Also, I noticed the argument "var" is described as "Var". If the name is important, it should be corrected.

— Reply to this email directly, view it on GitHub https://github.com/ddialliance/ddi-c_2/issues/14#issuecomment-2233655566, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJT47L3KADK6CYUBUX4JPDZM2HWXAVCNFSM6AAAAABLAF3ZO2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZTGY2TKNJWGY . You are receiving this because you commented.Message ID: @.***>

-- Wendy L. Thomas ISRDI [retired] email: @.***

wlthomas commented 3 months ago

CHANGE in "var"

<xhtml:p>The attribute "qstn" is a reference to the question ID for the variable.</xhtml:p>

TO:

<xhtml:p>The attribute "qstn" is a reference to the question ID when the question itself is  within another variable.</xhtml:p>

CHANGE in "qstn" The question element may have mixed content. The element itself may contain text for the question, with the sub-elements being used to provide further information about the question. Alternatively, the question element may be empty and only the subelements used. The element has a unique question ID attribute which can be used to link a variable with other variables where the same question has been asked. This would allow searching for all variables that share the same question ID, perhaps because the questions was asked several times in a panel design. The "ID" attribute contains a unique identifier for the question. "Var" references the ID(s) of the variable(s) relating to the question. The attribute "seqNo" refers to the sequence number of the question. The attribute "sdatrefs" may be used to reference elements in the summary data description section of the Study Description which might apply to this question. The attribute "access" records the ID values of all elements in the Data Access and Metadata Access section that describe access conditions for this question. These elements include: time period covered, date of collection, nation or country, geographic coverage, geographic unit, unit of analysis, universe, and kind of data. The responseDomainType attribute was added to capture the specific DDI Lifecycle response domain type to facilitate translation between DDI 2 and DDI Lifecycle. If this is given a value of "other" then a term from a controlled vocabulary should be put into the "otherResponseDomainType" attribute.

TO:

<xhtml:p>The question element may have mixed content. The element itself may contain text for the question, with the sub-elements being used to provide further information about the question. Alternatively, the question element may be empty and only the sub-elements used. This is the recommended approach.</xhtml:p>
<xhtml:p>The attribute "ID" (common to all elements) contains a unique identifier for the question. Use of the "ID" is required if you make use of any attribute "qstn" to support a reference from multiple variables, or the backward or forward flow of a questionnaire.</xhtml:p> 
<xhtml:p>The attribute "qstn" is an IDREF and can be used to directly reference a description of the question if entered in another variable.</xhtml:p>
<xhtml:p>The attribute "var" is an IDREFS and is used to list the IDs of variables resulting from the question.</xhtml:p>
<xhtml:p>The attribute "seqNo" refers to the sequence number of the question.</xhtml:p>
<xhtml:p>The attribute "sdatrefs" may be used to reference elements in the summary data description section of the Study Description which might apply to this question.</xhtml:p>
<xhtml:p>The attribute "access" records the ID values of all elements in the Data Access and Metadata Access section that describe access conditions for this question. These elements include: time period covered, date of collection, nation or country, geographic coverage, geographic unit, unit of analysis, universe, and kind of data.</xhtml:p> 
<xhtml:p>The "responseDomainType" attribute was added to capture the specific DDI Lifecycle response domain type to facilitate translation between DDI 2 and DDI Lifecycle. If this is given a value of "other" then a term from a controlled vocabulary should be put into the "otherResponseDomainType" attribute.</xhtml:p>
dusadrian commented 3 months ago

Just a minor Markdown observation: when using HTML tags like <, it will not be rendered inline. The trick is to begin with &lt;

<xhtml:p>some text</xhtml:p>

wlthomas commented 3 months ago

Where are you seeing this? the only place it should be rendered is in an example and all of those are bound in CDATA (see example below). Did I miss one somewhere? <![CDATA[

When you get together with your friends, would you say you discuss political matters frequently, occasionally, or never?
                    </var>
                 ]]>

On Sun, Aug 4, 2024 at 12:29 PM Adrian Dușa @.***> wrote:

Just a minor Markdown observation: when using HTML tags like <, it will not be rendered inline. The trick is to begin with <

some text — Reply to this email directly, view it on GitHub , or unsubscribe . You are receiving this because you modified the open/close state.Message ID: ***@***.***>

-- Wendy L. Thomas ISRDI [retired] email: @.***

DanSmith commented 2 months ago

I surrounded the xhtml in Wendy's previous comment https://github.com/ddialliance/ddi-c_2/issues/14#issuecomment-2256416660 with Markdown codeblocks to make it more clear.

https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks

dusadrian commented 2 months ago

That works, too. I was referring to inline code, such as:

some text Here, the open <xhtml:p> tag lacks the `<` and `>` pair. To render them, I used `<xhtml:p>`: <xhtml:p>some text Or, as Dan showed, surround in codeblocks: ``` html some text ```