Coder Social home page Coder Social logo

jschnasse / oi Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 1.35 MB

beta: a small tool to convert between csv,json,yml,xml,rdf. It can easily be combined with existing tools like xsltproc,jq,sed,grep and awk.

License: Eclipse Public License 2.0

Shell 6.90% Java 93.10%

oi's People

Contributors

dependabot[bot] avatar jschnasse avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

d4rkr0n1n

oi's Issues

Context resolving does not work behind proxy

Maybe add JAVA_FLAGS to startscript:

JAVA_FLAGS='-Dhttp.proxyHost="...." -Dhttp.proxyPort="...." -Dhttp.nonProxyHosts="localhost|127.0.0.1|10.*.*.*" -Djava.net.useSystemProxies=true'
if [ -f /usr/lib/libprocname.so ]
then
    LD_PRELOAD=/usr/lib/libprocname.so PROCNAME=oi jvm_for_oi ${JAVA_FLAGS} -jar /usr/lib/oi.jar $@
else
    jvm_for_oi ${JAVA_FLAGS} -jar /usr/lib/oi.jar $@
fi

Support XML Arrays

Passing the xml from https://www.dimdi.de/dynamic/.downloads/klassifikationen/icd-10-gm/version2020/icd10gm2020syst-claml.zip to oi I get two errors.

First error is about MixedContent in the <Label> elements that cannot be handled by the underlying jackson library. I worked around this issue by preprocessing the xml with cat icd10gm2020syst_claml_20190920.xml |sed -e s/"\(<Label[^>]*>\)"/"\1<\![CDATA["/g|sed -e s/"<\/Label>"/"]]><\/Label>"/g > prep.xml

Now oi is able to read the data but the result is way to small. It turns out that the jackson library is not able to store reoccurring elements in a list.

Example:

echo "<array><item>1</item><item>2</item></array>" > prep.xml
oi prep.xml
Expected:

---
item: "1"
item: "2"

Actual:

---
item: "2"

MesH Data

I downloaded

https://www.dimdi.de/dynamic/.downloads/sonstige/mesh/mesh-2019-datenbankfassung.zip

and extracted the ANN.TXT file from the bundle.

Here is, what I got:

oi -i csv --header="ENR,ANN" -d ";" ANN.TXT 
[|D000002|, |for use to kill or control insects, use no qualifiers on the insecticide or the insect,  appropriate qualifiers may be used when other aspects of the insecticide are discussed such as the effect on a physiologic process or behavioral aspect of the insect,  for poisoning, coordinate with ORGANOPHOSPHATE POISONING |] 4
[ENR, ANN] 2
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2
	at org.schnasse.oi.main.Main.convert(Main.java:138)
	at org.schnasse.oi.main.Main.call(Main.java:82)
	at org.schnasse.oi.main.Main.call(Main.java:30)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1743)
	at picocli.CommandLine.access$900(CommandLine.java:145)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2101)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2068)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:1935)
	at picocli.CommandLine.execute(CommandLine.java:1864)
	at org.schnasse.oi.main.Main.main(Main.java:59)
Caused by: java.lang.RuntimeException: java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2
	at org.schnasse.oi.reader.CsvReader.getMap(CsvReader.java:48)
	at org.schnasse.oi.main.Main.convert(Main.java:102)
	... 9 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2
	at org.schnasse.oi.reader.CsvReader.getMap(CsvReader.java:40)
	... 10 more

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.