Class GenericNodeSerializerCustom

java.lang.Object
com.esotericsoftware.kryo.Serializer<org.apache.jena.graph.Node>
org.aksw.jenax.io.kryo.jena.GenericNodeSerializerCustom
Direct Known Subclasses:
DefaultNodeSerializer

public class GenericNodeSerializerCustom extends com.esotericsoftware.kryo.Serializer<org.apache.jena.graph.Node>
A node serializer using a custom (i.e. non-standard) format for intermediate serialization. This class was created in order to allow processing of invalid RDF data. Examples include IRIs with white spaces or even worse IRIs with angular brackets which would result in a non-parsable turtle serialization.
Author:
Claus Stadler
  • Field Details

  • Constructor Details

    • GenericNodeSerializerCustom

      public GenericNodeSerializerCustom()
    • GenericNodeSerializerCustom

      public GenericNodeSerializerCustom(org.apache.jena.datatypes.TypeMapper typeMapper)
  • Method Details

    • getPossibleKey

      public static String getPossibleKey(String iriString)
      Takes a guess for the namespace URI string to use in abbreviation. Finds the part of the IRI string before the last '#' or '/'.
      Parameters:
      iriString - String string
      Returns:
      String or null
    • encode

      public static String encode(Map<String,String> iriToPrefix, String iri)
    • decode

      public static String decode(Map<String,String> prefixToIri, String curie)
    • write

      public void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output, org.apache.jena.graph.Node node)
      Specified by:
      write in class com.esotericsoftware.kryo.Serializer<org.apache.jena.graph.Node>
    • read

      public org.apache.jena.graph.Node read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input, Class<org.apache.jena.graph.Node> cls)
      Specified by:
      read in class com.esotericsoftware.kryo.Serializer<org.apache.jena.graph.Node>