okfn-brasil / issn-l-resolver Goto Github PK
View Code? Open in Web Editor NEWConverts any ISSN to the correspondent ISSN-L
Home Page: http://api.ok.org.br#issn
Converts any ISSN to the correspondent ISSN-L
Home Page: http://api.ok.org.br#issn
A simple check-equal function and a list of confirmed results.
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.
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]}
+
|
At schema LIB and resolver... Is a bug, the internal parser say the output format, so must externalize decision to the final user.
need correction, example
See https://www.postgresql.org/docs/current/static/isn.html
So, ISSN-L-Resolver can be both, a updated library and a source-code for the back-end of a microservice.
Para conferir implementação, ver
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.