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 #11

Open
willythewonka opened this issue Apr 26, 2017 · 1 comment
Open

@writing to stdout #11

willythewonka opened this issue Apr 26, 2017 · 1 comment

Comments

@willythewonka
Copy link

I can write to stdout using @write .nt:/dev/stdout, but there is also other metatada that is printed out as well. For example

09:35:33(I) 17 triples read (8500 tr/s avg)
09:35:33(I) 17 triples written (8500 tr/s avg) 
09:35:33(I) Done in 0 s 

Is there a way to output only the n-triples to stdout (without any other processing metadata), or can I only @write to a file on disk?

@fracorco
Copy link
Contributor

This is a use case we didn't cover much so far, so thanks for pointing out! We definitely need to improve the tool to better use stdin/stdout, e.g., to interplay with other unix tools, so I'll leave this issue open until we properly fix this.

In the meanwhile, a possible workaround is to selectively disable logging when output is directed to stdout. Two steps:

  1. create a logback-off.xml file (name doesn't matter) that configures the logging library logback not to emit log:
<configuration>
  <root level="OFF">
  </root>
</configuration>
  1. when needed, call rdfpro using that configuration file instead of the one shipped in etc/logback.xml. From the command line, this is done by calling rdfpro supplying an environment variable JAVA_OPTS that selects the proper logback configuration file:
$ JAVA_OPTS=-Dlogback.configurationFile=logback-off.xml rdfpro ARGS...

A drawback of this solution is that errors, if any, are not printed. To do that one may play with the logback configuration file to send log to stderr rather than stdout.

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

2 participants