Shell-native way of converting N-Quads to N-Triples

Hi,

I found an answer from years ago saying "you can convert quads to
triples with sed/perl", but no actual example on how to do it. Does
anyone have such a script, ideally as shell-native as possible,
without additional dependencies?

I've tried Jena's riot command, It doesn't do what I need because when
reading quads and writing triples it writes the default graph, which
is empty.

Currently I'm using a CONSTRUCT query and Jena's sparql command, but
it's rather slow on large files.

Thanks.

Martynas

Received on Tuesday, 7 March 2023 13:27:07 UTC