Giter Club home page Giter Club logo

issn-l-resolver's Issues

trim string in the TXT mode

the .txt output is usefull for simple command lines, as this for SciELO ISSN-folder checking

 ls  |  while read line; do \
             issnl=$(curl -s http://api.ok.org.br/issn/$line/n2c.txt); \
            echo "mv $line $issnl"; \
        done

... So, need strings without spaces or \n in it.

assert script (step5) need review

After sucesseful instation and population, some errors at assert, need only better casting, etc.

 tservice(N2C) 
---------------
--More--ERROR:  COALESCE types text and integer cannot be matched
LINE 11: ...element(  name ret,   COALESCE( issn.cast(issn.n2c($1)),0) )
                                                                    ^
QUERY:  SELECT CASE
    -- need XML convertion WHEN cmd='info' AND $1 IS NOT NULL AND $1::text>'' THEN issn.info($1)
    -- ... WHEN cmd='info' THEN issn.info()
    WHEN cmd='isc-int' OR cmd='isc' THEN
      xmlelement(  name ret,  COALESCE( issn.isc($1)::text,'') )
    WHEN cmd='isn-int' OR cmd='isn' THEN
      xmlelement(  name ret,  COALESCE( issn.isn($1)::text,'') )
    WHEN cmd='n2c-int' THEN
      xmlelement(  name ret,   COALESCE( issn.n2c($1),0) )
    WHEN cmd='n2c' THEN
      xmlelement(  name ret,   COALESCE( issn.cast(issn.n2c($1)),0) )
    WHEN cmd='n2ns-int' OR cmd='n2ns' THEN (
      SELECT xmlelement(  name ret,  xmlagg( xmlelement(name issn,COALESCE(i,'')) )  )
      FROM  ( -- need check when null
        SELECT unnest( CASE WHEN cmd='n2ns-int' THEN issn.n2ns($1)::text[] ELSE issn.n2ns_formated($1) END )
      ) t(i)
     )
    ELSE (text '<_ERROR_/>')::xml
  END
CONTEXT:  PL/pgSQL function issn.xservice_jspack(integer,text,integer,text) line 7 at assignment
....
 OK: n2c(int).
(1 row)
DELETE 0
INSERT 0 9

----- api.assert_tests, complete suite -----

   categ   |                                                                 result                                                            
     
-----------+-----------------------------------------------------------------------------------------------------------------------------------
-----
 issn-n2ns | ASSERT FAILED (issn/67/n2c)                                                                                                       
    +
           | ASSERT IS_EQUAL FAILED.                                                                                                           
    +
           |                                                                                                                                   
    +
           | Have -> {"result": "0000-1155", "status": 200, "outFormat": "json"}                                                               
    +
           | Want -> {"status" : 200, "result" : "0000-1155"}                                                                                  
    +
           | 
 issn-n2ns | ASSERT FAILED (issn/int/1/n2ns)                                                                                                   
    +
           | ASSERT IS_EQUAL FAILED.                                                                                                           
    +
           |                                                                                                                                   
    +
           | Have -> {"result": [1, 2150400], "status": 200, "outFormat": "json"}                                                              
    +
           | Want -> {"status" : 200, "result" : [1,2150400]}                                                                                  
    +
           | 

propagate outFormat to output

At schema LIB and resolver... Is a bug, the internal parser say the output format, so must externalize decision to the final user.

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.