IM-JS

IM-JS (Information Model JS) is a JavaScript framework developed by Metadata Technology which communicates with the Fusion Registry SDMX web services to retrieve SDMX Structures, Data, and Reference Metadata. IM-JS provides the client with a JavaScript representation of the SDMX response message conforming to the SDMX Information Model (SDMX-IM). The use of JavaScript inheritence provides a powerful abstract framework from which reusable methods and functionality can be written.

IM-JS enables the construction of web clients, which make use of the SDMX information held in the Fusion Registry. The Fusion Registry GUI itself is written in IM-JS. All the communication between the client and server is over standard SDMX web services.

alt text

IM-JS takes care of client to server communication, client side caching, and packaging the server responses in JavaScript Objects making client side processing of the data effortless.

High Level View

The IM-JS framework provides a single entry point singleton class, IMJS, from which other objects can be obtained.

The IMJS singleton can be used to access Structures, Data, and Reference Metadata.

This API Documentation groups classes into packages depending on the type of class, as shown below.

alt text

Getting Started

  1. Download IM-JS
  2. Include the downloaded JavaScript and CSS file in your project
  3. In your JavaScript file, create a IM-JS instance:
    var config = {
        url : "http://yourservice.org/FusionRegistry"
    }

    //Get instance
    var imJs = IMJS.getInstance(config);


   IMJS.getInstance().getDataflow("ECB", "EXR", "1.0", true, onDataflowResponse);

   function onDataflowResponse(dataflow) {
     dataflow.createDataQuery(true, onDataQueryCreation);
   }


   function onDataQueryCreation(dataQuery) {
    //Add query filters and execute the query on the server
    dataQuery.addCodeSelection("FREQ", "A");
    dataQuery.addCodeSelection("REF_AREA", "UK");
    dataQuery.executeQuery(null, onDataQueryResponse); 
   }

   function onDataQueryResponse(dataset) {
    //Render the response as a HTML Pivot Table
      var pivotTable = new PivotTable("#tableDiv");
      pivotTable.draw(dataset)
   }

IMJS Structures

The IM-JS structures follow the inheritence tree of the SDMX Information Model (IM). In addition IM-JS structures can link back to additional Reference Metadata, which provides additional information for the user. This information may be HTML mark-up, and can link off to other resources. Reference Metadata is typically used to provide Quality Indicators about the data, or explanatory notes.

The image below shows an example of the IM-JS Hierarchy (based on SDMX-IM) along with the information at each level. Note: The image does not provide an exhaustive list of all the functions at each level, it is just a subset to provide an illustration of functionalityillustration.

alt text

IMJS Data

IMJS DataSet holds an array of Observations and offeres methods to group the Observations into Series or filter Observations by Dimension criteria.

Each DataSet provides access to the DataSetComponents which describe the data, for example: Frequency, Reference Area, Sex, Series, Time

Each Observation is described by a Code Value for each DataSetComponent, for example A, UK, M, SERIES1, 2008

alt text