SDMX Users Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Author Topic: MetadataStructureRefType  (Read 16952 times)

JamesGardner

  • Newbie
  • *
  • Posts: 26
    • View Profile
MetadataStructureRefType
« on: February 19, 2013, 10:46:25 PM »

Hi!
for MetadataStructureRefType, the type is constrained to only have a class and package target..
From SDMXCommonReferences.xsd
++SNIP++
      <xs:annotation>
         <xs:documentation>MetadataStructureRefType contains a set of reference fields for a metadata structure definition.</xs:documentation>
      </xs:annotation>
      <xs:complexContent>
         <xs:restriction base="StructureRefBaseType">
            <xs:attribute name="class" type="StructureTypeCodelistType" use="optional" fixed="MetadataStructure"/>
            <xs:attribute name="package" type="StructurePackageTypeCodelistType" use="optional" fixed="metadatastructure"/>
         </xs:restriction>
      </xs:complexContent>
++SNIP++
what field am i supposed to use to resolve this reference into a MetadataStructure when there's no Agency, ID, Version, or URN field on this type?
or is MetadataStructureRef just supposed to indicate that the target object is a Metadatastructure??
Thanks
   James Gardner

Logged

luigi.fortunati

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: MetadataStructureRefType
« Reply #1 on: February 20, 2013, 01:25:39 AM »

Hi James,
Doesn't MetadataStructureRefType derive from StructureRefBaseType?
Code: [Select]
<xs:complexType name="StructureRefBaseType" abstract="true">
<xs:annotation>
<xs:documentation>StructureRefBaseType is an abstract base type for referencing a structure.</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:restriction base="StructureOrUsageRefBaseType">
<xs:attribute name="agencyID" type="NestedNCNameIDType" use="required"/>
<xs:attribute name="id" type="IDType" use="required"/>
<xs:attribute name="version" type="VersionType" use="optional" default="1.0"/>
<xs:attribute name="local" type="xs:boolean" use="optional" fixed="false"/>
<xs:attribute name="class" type="StructureTypeCodelistType" use="optional"/>
<xs:attribute name="package" type="StructurePackageTypeCodelistType" use="optional"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>

MetadataStructureRefType acts solely as a partial parameterisation over StructureRefBaseType which tells that the referenced object is a metadata structure (check the "fixed" attribute).

Code: [Select]
<xs:complexType name="MetadataStructureRefType">
<xs:annotation>
<xs:documentation>MetadataStructureRefType contains a set of reference fields for a metadata structure definition.</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:restriction base="StructureRefBaseType">
<xs:attribute name="class" type="StructureTypeCodelistType" use="optional" fixed="MetadataStructure"/>
<xs:attribute name="package" type="StructurePackageTypeCodelistType" use="optional" fixed="metadatastructure"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
Logged

JamesGardner

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: MetadataStructureRefType
« Reply #2 on: February 20, 2013, 05:38:27 PM »

it does, but it's just strange that in every other RefType the 'important' fields are listed in the subclass... for example in MetadataTargetRefType, the field 'ID" is listed in the subclass... just so i know that MetadataTargetRefType the important field is the 'ID' to use to lookup the appropriate object... i haven't found very helpful help on the xs:restriction tag at all.. and it doesn't fit in with all the other RefTypes listing the field used to lookup the object...
i think i have it now.. PayloadStructureType has a 'structureID' field.. so i guess 'ID" is the appropriate field to use to lookup the MetadataStructure...
Thanks for your help
   James Gardner
Logged

luigi.fortunati

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: MetadataStructureRefType
« Reply #3 on: February 25, 2013, 02:59:03 AM »

According to these references:
http://www.xml.com/pub/a/2003/10/29/derivation.html
http://lists.xml.org/archives/xml-dev/200101/msg00217.html
XML Schema, Eric van der Vlist, Publisher: O'Reilly - Chapter 7.4.2

Whenever a complexType is derived from another by using "restriction" all the elements and attributes of the base type should be duplicated. Otherwise base type content that is not reported in the specialized type restriction gets dropped in the specialized type. That amazes me as I think that elements that make up an identifiable artifact (agency,id,version) should be reported in the subtype.
Moreover, all of the complex types that derive from the abstract StructureRefBaseType do not report agencyID, id, version, local.
I'll report this matter in the "SDMX 2.1 Public Review" area of the forum.


Is that probably an error in the specifications? I'll open a thread on this matter in the "SDMX 2.1 Public review" area of the forum.
Logged