Coder Social home page Coder Social logo

sdmx-rest4js's Introduction

Hi there ๐Ÿ‘‹

I have been working in IT since 1999, with a focus on statistical systems since 2005. During these years, I have developed solutions that handle the ingestion, processing, analysis and dissemination of data.

I strive to develop solutions that are, first of all, correct (no kidding ;)), well-crafted, open to changes, standard-compliant, metadata-driven and well-tested.

I'm the author of the NPM sdmx-rest package, one of the authors of pysdmx and one of the maintainers of the SDMX-REST specification.

A few stats

GitHub stats trophy

Favorite IT Motto

In the face of ambiguity, refuse the temptation to guess (PEP 20).

sdmx-rest4js's People

Contributors

dependabot[bot] avatar snyk-bot avatar sosna avatar tzaphkiel avatar xd-deng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

fagan2888 viguice

sdmx-rest4js's Issues

Secure default instances

The library offers access to web service instances but these use http. It would be nice to add the option to access the instance over https for the services that support that.

Programatically list the available/supported services

It would be great for an application using this library to be able to present the user with a drop-down menu of the available/supported services.

If I'm not mistaken, currently the Service class has constants defining the individual services but nowhere is an array of them available.

Add function to check the media types

The API offers a method to check the status of a request.

The same should be done for the media types, i.e. is the response type a valid SDMX one and is it the requested format?

Thanks to @stratosn for the idea.

Add support for VTL artefacts

A few maintainable artefacts defined for the VTL will be added to the next version of the SDMX RESTful API.

They should be added to the list of resources supported by the library.

Don't forget to extend the list of resources in api-version!

Update Wiki

Documentation about the new availability API needs to be added to the Wiki

getUrl and schema queries

Since version 2.15.0, it's possible to create schema queries.

Unfortunately, getUrl was forgotten and it does not yet support schema queries, thereby limiting the usefulness of the new feature.

ECB service is no longer working

The preconfigured ECB service is set to use SDMX-JSON. However, the mime type has now changed, following the official release of v1.0.0 of the SDMX-JSON format.

Instead of the generic SDMX-JSON reference, the ECB service should use the specific mime type for the working draft version of SDMX-JSON.

Verify status of services

Some of the supported services may have been upgraded to new versions of the SDMX RESTful API. It would be good to check the status.

Create URLs without default values

The API allows building SDMX RESTful URLs representing queries to be executed against SDMX RESTful web services, using the getUrl function. This function adds the default values defined in the SDMX RESTful API, in case not all query parameters are set.
It would be nice to have an option leaving the choice to the user whether default values should be added to the URL.

ReportingTaxonomy is not recognized as ItemScheme

The file metadata-type offers the possibility to check whether any artefact type (e.g. codelist) is an SDMX item scheme, using the isItemScheme method.

According to the SDMX information model, reporting taxonomies are item schemes but the isItemScheme method states the contrary.

Thanks to @stratosn for reporting this.

Expose checkStatus

The recently introduced request2 function returns the entire HTTP response.

It would be nice to add a helper function allowing a client to check whether the status is one of the expected ones, before processing the response body.

Provide http response headers

The library offers the possibility to execute a request.

However, only the response body is returned by the function call.

It should however be possible for a client to get access to the full response, i.e. including headers.

Thanks to @Tzaphkiel for the proposal.

Non-ItemScheme MD queries not generated correctly

Requestion dataflow metadata for example adds a 4th parameter to the URL that should only be present for ItemSchemes.

var sdmxrest = require('sdmx-rest')
var ws = sdmxrest.getService({url: "http://--someEndPointNotPredefined--/service/"})
var query = {resource: "dataflow", detail: "allstubs"}
console.log("Query: "+ sdmxrest.getUrl(query, ws))

outputs:

http://--someEndPointNotPredefined--/dataflow/all/all/latest/all?detail=allstubs&references=none

Infer the API version of a service

Currently, when a new service is created, its API version will default to the latest one. However, typically, services are based on an older version of the API.

It would be good if the library could infer the API version.

This could be offered either via a dedicated function to be called by the client or transparently via the getService function.

Thanks to @Tzaphkiel for the proposal.

Switch to husky

In the Dev dependencies, ghooks has been deprecated and it is recommended to use husky instead.

Add user-agent

It would be nice to add a user-agent to each request sent

Use arrays of dimension values for the data query key

When creating data queries, a string is currently expected for the key parameter (e.g.: M.NOK+CHF.EUR.SP00.A). However, when clients use select field for dimension filters, it would be convenient to pass an array of values (e.g.: [[M], [NOK, CHF], [EUR], [SP00], [A]). In case there is only one value, strings should be allowed as well ((e.g.: [M, [NOK, CHF], EUR, SP00, A))

Handle space in media types

Some services return the media type with spaces. checkMediaType() implements a string comparison and therefore fail for such cases.

Calling request triggers a TypeError

Executing the following query on a Mac triggers a TypeError

sdmxrest.request("http://sdw-wsrest.ecb.europa.eu/service/data/EXR/A.CHF.EUR.SP00.A")
     .then(function(data) {console.log(data);})
     .catch(function(error) {console.log(error);});

The error is:

url.js:87
    throw new TypeError('Parameter "url" must be a string, not ' + typeof url);
    ^

TypeError: Parameter "url" must be a string, not object
    at Url.parse (url.js:87:11)
    at Object.urlParse [as parse] (url.js:81:5)

Thanks to @stratosn for reporting the issue.

SdmxPatterns is undefined

The API offers the possibility to get regular expressions for various SDMX patterns, using sdmxrest.utils.SdmxPatterns. However, this is currently undefined.

Offer a list of valid resources for an api version

The list of supported resources vary with the version of the SDMX RESTful API. Version 1.3.0 for example adds a few new resources such as actualconstraint and allowedconstraint for example.

It would be nice if the library could offer a function returning the list of valid resources per API version.

Thanks to @Tzaphkiel for the proposal.

Add a Promise polyfill

Some browsers and some older versions of Node.js don't support promises. It would be nice to add a polyfill for these.

Remove dependency on bithound

The library is depending on bitHound (e.g. for the dependency analysis) but the service has now been closed so an alternative has to be found.

dimensionAtObservation should not have defaults

In case dimensionAtObservation is not set in a data query, the library defaults to TIME_PERIOD.

This is not in line with the SDMX spec, which states: "In case this parameter is not set, the service is expected to: Default to TimeDimension, if the data structure definition has one; If not, default to MeasureDimension, if the data structure definition has one; If none of the above is true, default to AllDimensions."

Therefore, the library should no longer default to TIME_PERIOD when dimensionAtObservation is not set.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.