1407.0.55.002 - ABS.Stat Beta: Web Services, User Guide  
Latest ISSUE Released at 11:30 AM (CANBERRA TIME) 07/10/2016   
   Page tools: Print Print Page Print all pages in this productPrint All RSS Feed RSS Bookmark and Share Search this Product

SDMX Web Service Methods

The SDMX Web Service methods that we recommend you use are:



GetGenericData

This method retrieves data in a generic format from a specified ABS.Stat dataset. It requires an input parameter (ie the query) as an XML document in SDMX-ML format and will return the query results in SDMX-ML format. The query message is where you specify the dataset, dimensions and dimension members you want to return data for. The query message should be specified within the <sdmx:QueryMessage> tag in the query structure. An example of the GetGenericData SDMX query message is shown below.

SDMX GetGenericData query message example:

<message:QueryMessage xmlns="http://www.SDMX.org/resources/SDMXML/schemas/v2_0/query"
xmlns:message="http://www.SDMX.org/resources/SDMXML/schemas/v2_0/message"
xsi:schemaLocation="http://www.SDMX.org/resources/SDMXML/schemas/v2_0/query http://www.sdmx.org/docs/2_0/SDMXQuery.xsd http://www.SDMX.org/resources/SDMXML/schemas/v2_0/message http://www.sdmx.org/docs/2_0/SDMXMessage.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Header xmlns="http://www.SDMX.org/resources/SDMXML/schemas/v2_0/message">
<ID>none</ID>
<Test>false</Test>
<Truncated>false</Truncated>
<Prepared>2016-05-24T15:45:39</Prepared>
<Sender id="YourID">
<Name xml:lang="en">Your English Name</Name>
</Sender>
<Receiver id="ABS">
<Name xml:lang="en">Australian Bureau of Statistics</Name>
</Receiver>
</Header>
<Query xmlns="http://www.SDMX.org/resources/SDMXML/schemas/v2_0/message">
<DataWhere xmlns="http://www.SDMX.org/resources/SDMXML/schemas/v2_0/query">
<And>
<DataSet>LF</DataSet>
<Dimension id="ASGC_2010">0</Dimension>
<Dimension id="SEX_ABS">3</Dimension>
<Dimension id="AGE">1599</Dimension>
<Dimension id="FREQUENCY">M</Dimension>
<Attribute id="TIME_FORMAT">P1M</Attribute>
<Time>
<StartTime>2016-02</StartTime>
<EndTime>2016-03</EndTime>
</Time>
<Or>
<Dimension id="ITEM">4</Dimension>
<Dimension id="ITEM">13</Dimension>
<Dimension id="ITEM">14</Dimension>
<Dimension id="ITEM">10</Dimension>
</Or>
<Or>
<Dimension id="TSEST">20</Dimension>
<Dimension id="TSEST">30</Dimension>
</Or>
</And>
</DataWhere>
</Query>
</message:QueryMessage>


GetCompactData

This method retrieves data in a compact format from a specified ABS.Stat dataset. Similarly to GetGenericData method, it requires an input parameter (ie the query) as an XML document in SDMX-ML format and will return the query results in SDMX-ML format. The SDMX query message for GetCompactData is structured the same as the GetGenericData example above.


GetDataStructureDefinition

This method retrieves data structure definitions as well as codelists and concepts associated with a dataset, such as the label attached to the code for each dimension and dimension member. An example of the GeDataStructureDefinition SDMX query message is shown below. The input parameter is an XML document in SDMX-ML format and the output is an SDMX structure message.

SDMX GetDataStructureDefinition query message example:

<message:QueryMessage xmlns="http://www.SDMX.org/resources/SDMXML/schemas/v2_0/query"
xmlns:message="http://www.SDMX.org/resources/SDMXML/schemas/v2_0/message"
xsi:schemaLocation="http://www.SDMX.org/resources/SDMXML/schemas/v2_0/queryhttp://www.sdmx.org/docs/2_0/SDMXQuery.xsd http://www.SDMX.org/resources/SDMXML/schemas/v2_0/message http://www.sdmx.org/docs/2_0/SDMXMessage.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Header xmlns="http://www.SDMX.org/resources/SDMXML/schemas/v2_0/message">
<ID>none</ID>
<Test>false</Test>
<Prepared>2012-06-01T09:33:53</Prepared>
<Sender id="YourID">
<Name xml:lang="en">Your English Name</Name>
</Sender>
<Receiver id="ABS">
<Name xml:lang="en">Australian Bureau of Statistics</Name>
<Name xml:lang="fr">Australian Bureau of Statistics</Name>
</Receiver>
</Header>
<message:Query>
<KeyFamilyWhere>
<Or>
<KeyFamily>CPI</KeyFamily>
</Or>
</KeyFamilyWhere>
</message:Query>
</message:QueryMessage>


GetDatasetMetadata

This method retrieves the metadata for a dataset for a specified dataset. It requires an input parameter (ie the query) as an XML document in SDMX-ML format. An example of the GetDatasetMetadata SDMX query message is shown below. The Web Service will return the query results in SDMX-ML format.

SDMX GetDatasetMetadata query message example:

<message:GenericMetadataQuery xmlns:message="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/message"
xmlns:structure="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/structure"
xmlns:query="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/query"
xmlns:common="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/common"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/query
SDMXQueryMetadata.xsd http://www.sdmx.org/resources/sdmxml/schemas/v2_1/message SDMXMessage.xsd">
<message:Header>
<message:ID>none</message:ID>
<message:Test>false</message:Test>
<message:Prepared>2012-06-01T09:48:05</message:Prepared>
<message:Sender id="YourID">
<common:Name xml:lang="en">Your English Name</common:Name>
</message:Sender>
<message:Receiver id="ABS">
<common:Name xml:lang="en">Australian Bureau of Statistics</common:Name>
<common:Name xml:lang="fr">Australian Bureau of Statistics</common:Name>
</message:Receiver>
</message:Header>
<message:Query>
<query:ReturnDetails/>
<query:MetadataParameters>
<query:AttachedDataSet>
<common:DataProvider>
<Ref id="ABS" maintainableParentID="" agencyID="ABS"/>
</common:DataProvider>
<common:ID>CPI</common:ID>
</query:AttachedDataSet>
</query:MetadataParameters>
</message:Query>
</message:GenericMetadataQuery>


GetReferenceMetadata

This method retrieves the reference metadata for a particular dimension member for a specified dataset. It requires an input parameter (ie the query) as an XML document in SDMX-ML format. An example of the GetReferenceMetadata SDMX query message is shown below. The Web Service will return the query results in SDMX-ML format.

SDMX GetReferenceMetadata message example:
<message:GenericMetadataQuery xmlns:message="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/message"
xmlns:structure="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/structure"
xmlns:query="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/query"
xmlns:common="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/common"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/query
SDMXQueryMetadata.xsd http://www.sdmx.org/resources/sdmxml/schemas/v2_1/message SDMXMessage.xsd">
<message:Header>
<message:ID>none</message:ID>
<message:Test>false</message:Test>
<message:Prepared>2016-06-01T10:03:45</message:Prepared>
<message:Sender id="YourID">
<common:Name xml:lang="en">Your English Name</common:Name>
</message:Sender>
<message:Receiver id="ABS">
<common:Name xml:lang="en">Australian Bureau of Statistics</common:Name>
<common:Name xml:lang="fr">Australian Bureau of Statistics</common:Name>
</message:Receiver>
</message:Header>
<message:Query>
<query:ReturnDetails/>
<query:MetadataParameters>
<query:AttachedDataSet>
<common:DataProvider>
<Ref id="ABS" maintainableParentID="" agencyID="ABS"/>
</common:DataProvider>
<common:ID>LF</common:ID>
</query:AttachedDataSet>
</query:MetadataParameters>
</message:Query>
</message:GenericMetadataQuery>


Get Metadata for Dimension Member

You can use the GetReferenceMetadata method to call metadata for a specific dimension or dimension member. However, due to a system limitation the entire <query:MetadataParameters> element must be specified on a single line in the SDMX query. An example of a GetReferenceMetadata SDMX query message that will return dimension member metadata is shown below.

SDMX get metadata for dimension member message example:
<message:GenericMetadataQuery xmlns:message="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/message"
xmlns:structure="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/structure"
xmlns:query="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/query"
xmlns:common="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/common"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sdmx.org/resources/sdmxml/schemas/v2_1/query SDMXQueryMetadata.xsd http://www.sdmx.org/resources/sdmxml/schemas/v2_1/message SDMXMessage.xsd">
<message:Header>
<message:ID>none</message:ID>
<message:Test>false</message:Test>
<message:Prepared>2016-06-01T10:03:45</message:Prepared>
<message:Sender id="YourID">
<common:Name xml:lang="en">Your English Name</common:Name>
</message:Sender>
<message:Receiver id="ABS">
<common:Name xml:lang="en">Australian Bureau of Statistics</common:Name>
<common:Name xml:lang="fr">Australian Bureau of Statistics</common:Name>
</message:Receiver>
</message:Header>
<message:Query>
<query:ReturnDetails/>
<query:MetadataParameters><query:AttachedDataKey><common:KeyValue id="TSEST"><common:Value>20</common:Value></common:KeyValue></query:AttachedDataKey><query:AttachedDataSet><common:ID>CPI</common:ID></query:AttachedDataSet></query:MetadataParameters>
</message:Query>
</message:GenericMetadataQuery>