Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

writing to STDOUT is inferior compared to writing to -f #45

Closed
VladimirAlexiev opened this issue Jan 12, 2024 · 1 comment
Closed

writing to STDOUT is inferior compared to writing to -f #45

VladimirAlexiev opened this issue Jan 12, 2024 · 1 comment

Comments

@VladimirAlexiev
Copy link
Contributor

VladimirAlexiev commented Jan 12, 2024

I use the following JVM args to invoke xsparql (UTF-8 is important for proper Unicode handling):

java -Xmx6G -Dfile.encoding=UTF-8 -jar c:/prog/xsparql/xsparql-cli-jar-with-dependencies.jar ...

Writing to STDOUT is inferior compared to writing to -f file:

So one should always use -f to invoke xsparql, eg:

xsparql script.xsparql input=file.xml -f file.ttl

The inability to write properly to STDOUT is problematic if you want to post-process the output using a unix pipeline.
I tried this to no avail:

xsparql script.xsparql input=test.xml -f /dev/stdout > test1.ttl
File not found: script.xsparql

And this:

xsparql script.xsparql input=test.xml -f - > test1.ttl

It writes out ONLY the Prova.txt crap (Whaat?)

So I need to use a temp file in Makefile to do post-processing.

@VladimirAlexiev
Copy link
Contributor Author

VladimirAlexiev commented Jan 12, 2024

Combining with #42, here's what I use in Makefile:

%.ttl: xsparql.xsparql %.xml
	xsparql xsparql.xsparql input=$*.xml -f TEMP.ttl > /dev/null
	 riot --syntax ttl --formatted ttl --base "..." TEMP.ttl |\
	 perl -00e '@a=<>; print shift @a; print sort @a' > $*.ttl
	rm TEMP.ttl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant