SDMX Users Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Author Topic: Sdmx-Sax Tool  (Read 8087 times)

JamesGardner

  • Newbie
  • *
  • Posts: 26
    • View Profile
Sdmx-Sax Tool
« on: August 13, 2013, 06:00:13 AM »

Hi!
I'm still working sporadically on sdmx-sax, a Java parser to get data out of an SDMX service...
It can query a REST registry for data structures, and query SOAP 2.0 services for Data Structures,
(list data structures, and dump some basic information from them)
once it has the DSD, it can go through all a 'DataMessage's values, and swap Strings for CodeType objects..
I'm just working on doing some basic queries now..
the basic premise of sdmx-sax is to try and keep things modern, ie - sdmx 2.1, so sdmx 2.0 structures are shoe-horned into an sdmx2.1 object model...
it's new home is at www.github.com/kalessine/sdmx-sax

this is some example code querying a SOAP service;
    @Test
    public void testABSList() throws IOException {
        Sdmx20SOAPQueryable queryable = new Sdmx20SOAPQueryable("ABS", "http://stat.abs.gov.au/sdmxws/sdmx.asmx");
        QueryableServiceRegistry registry = new QueryableServiceRegistry(queryable);
        List<DataStructureReferenceType> list = registry.listDataSets();
        Iterator<DataStructureReferenceType> it = list.iterator();
        while(it.hasNext()){
            DataStructureReferenceType ref = it.next();
            DataStructureType ds = registry.findDataStructure(ref.getRef().getAgencyId(), new IDType(ref.getRef().getId().toString()),ref.getRef().getVersion());
            ds.dump();
            System.out.println(ref.getRef().getAgencyId()+":"+ref.getRef().getId()+":"+ref.getRef().getVersion());
        }
    }
This code queries the ABS sdmx service for data structures (returned as a list of DataStructureReferences)
then loads the DataStructure, and dumps a little bit of information about the DataStructure to System.out

It can also piece together a complete set of dependant Codelists and ConceptSchemes from http://www.fao.org/figis/sdmx/
when a datastructure is retrieved from the RESTful service...

Regards
   James Gardner

Logged