Old question, but since you explicitly ask about different libraries, I'd thought I'd show how to do simple RDF parsing with Eclipse RDF4J's Rio parser (disclosure: I am one of the RDF4J developers).
For example, to parse the file and put all triples in a Model
, just do this:
FileInputStream in = new FileInputStream("/path/to/file.nt");
Model m = Rio.parse(in, RDFFormat.NTRIPLES);
If you want to immediately print the parser output to stdout (for example in Turtle format), do something like this:
FileInputStream in = new FileInputStream("/path/to/file.nt");
RDFParser parser = Rio.createParser(RDFFormat.NTRIPLES);
parser.parse(in, "", Rio.createWriter(RDFFormat.TURTLE, System.out));
And of course there are more ways to play with these basic tools, have a look at the toolkit documentation for details.
The Rio parsers are available as separate maven artifacts by the way, so if you wish to use only the parsers, without the rest of the RDF4J tools, you can do so.