TQL Library
Turtle Quads (TQL) is a line-oriented RDF format similar to NQuads but using the more permissive (and efficient!) Turtle encoding for characters. It has been introduced by DBpedia for its dump files and it is supported in input by the Virtuoso triple store. TQL is the preferred format for manipulating RDF data in RDFpro.
The rdfpro-tql module extends Sesame RIO with support for the TQL format. In order to use it you have to include the following dependency in your pom.xml:
<dependency> <groupId>eu.fbk.rdfpro</groupId> <artifactId>rdfpro-tql</artifactId> <version>0.6</version> </dependency>
If you don’t use Maven, you have to download and include the following JARs in the classpath:
- rdfpro-tql-0.6.jar
- slf4j-api-1.7.12.jar (or newer version)
- guava-19.0-rc2.jar (or newer version)
- sesame-rio-api-2.8.6.jar (or newer version)
- sesame-model-2.8.6.jar (or newer version)
- sesame-util-2.8.6.jar (or newer version)
Note that the three Sesame JARs are not necessary in case the openrdf-sesame-2.8.6-onejar.jar file is already included. The SLF4J API is used by Sesame for logging. You need to include also an implementation (e.g., Logback) for logging to work.
As TQL is not part of the predefined set of Sesame RDFFormats, it is necessary to register it. This can be done either via RDFFormat#register(), passing the TQL.FORMAT constant, or by simply calling method TQL.register() on the TQL class, which ensures that multiple calls will result in a single registration.
A note on performances. The TQL parser and writer operate by reading / writing a character at a time, relying on the underlying stream for proper buffering. For optimal performances, make sure to use them with a BufferedReader or BufferedWriter, or, better, with their corresponding unsynchronized variants produced by methods IO.buffer() of the IO utility class.