The serialization still use Thrift underneath - so if you are already
doing that I don't think you would gain much - perhaps save some code
and proxy objects?


See https://github.com/apache/jena/pull/191/files for the changes.

Basically there are wrapper objects SNode,STriple,SQuad which take
over the object stream and write the Thrift objects instead, and vice
versa on the way out.

Serializing a regular Node/Triple/Quad by default will delegate to
these - so it should be transparent to the code that is using them
directly as Serializable.

You can change the serialization globally by modifying
org.apache.jena.system.Serializer.setNodeSerializer and friends, see
SerializerRDF.

On 22 December 2016 at 12:43, Claude Warren <[email protected]> wrote:
> Greetings,
>
> Andy, in response to another topic, stated "Jena now provides
> "Serializable" for Triple/Quad/Node"
>
> As some of you know I am working on Jena on Cassandra (graph implementation
> complete) and want to know what the most efficient method of serializing
> nodes is.  I am using the Thrift library to convert to a RDF_TERM and
> serialzie that to a byte array.
>
> {code}
> private final TSerializer ser = new TSerializer();
>
> ...
>
> RDF_Term term = new RDF_Term(); ThriftConvert.toThrift(node, null, term,
> false); byte[] bary = ser.serialize(term);
>
> {code}
>
> What I require is that the node serialze into an array of bytes and be able
> to deserialize the same.
>
> Are the new serialization techniques for the Node faster than Thrift
> conversion?  Is there any special treatment required or is it just a case
> of ObjectOutputStream.write( node ) ?
>
> Where can I find more info/examples?
>
> Claude
> --
> I like: Like Like - The likeliest place on the web
> <http://like-like.xenei.com>
> LinkedIn: http://www.linkedin.com/in/claudewarren



-- 
Stian Soiland-Reyes
http://orcid.org/0000-0001-9842-9718

Reply via email to