I would try a streamable syntax such as N-Triples.

On Mon, 31 Mar 2025 at 17.20, Steve Vestal <steve.ves...@galois.com.invalid>
wrote:

> I'm having trouble writing a large Model (36293418 statements) into a
> file with a given syntax (e.g., TTL, RDF/XML).  I'd appreciate ideas.
>
> Model, RDFDataMgr, and RDFWriter use OutputStream and StringWriter.
> With the exception (I assume) of PipedOutputStream, they all seem to
> buffer the data in a byte array or String when converting Model content
> to a text file format.  The maximum length of a Java String or array is
> the 32 bit int type, 2,147,483,647 bytes. I get the exception
> "java.lang.OutOfMemoryError: Required array length 2147483639 + 9 is too
> large".  Is there a way to feed chunks of data from a Model into a
> PipedOutputStream, where the PipedInputStream provides the model content
> in a selected text syntax?  Is there a simple way to split a Model into
> smaller Models, write those as text files, and merge those files back
> together?
>
>

Reply via email to