Class ThriftConvert

    • Constructor Detail

      • ThriftConvert

        public ThriftConvert()
    • Method Detail

      • toThriftValue

        public static boolean toThriftValue​(Node node,
                                            RDF_Term term)
        Attempt to encode a node by value (integer, decimal, double) into an RDF_term.
        Parameters:
        node -
        term -
        Returns:
        true if the term was set, else false.
      • toThrift

        public static void toThrift​(Node node,
                                    RDF_Term term)
        Encode a Node into an RDF_Term, using values (integer, decimal, double) if possible.
      • toThrift

        public static void toThrift​(Node node,
                                    RDF_Term term,
                                    boolean allowValues)
        Encode a Node into an RDF_Term. Control whether to use values (integer, decimal, double) if possible.
      • convert

        public static Node convert​(RDF_Term term,
                                   PrefixMap pmap)
        Build a Node from an RDF_Term using a prefix map which must agree with the map used to create the RDF_Term in the first place.
      • convert

        public static RDF_Term convert​(Node node,
                                       boolean allowValues)
      • convert

        public static RDF_Triple convert​(Triple triple,
                                         boolean allowValues)
      • convert

        public static RDF_Quad convert​(Quad quad,
                                       boolean allowValues)
      • termToBytes

        public static byte[] termToBytes​(RDF_Term term)
        Serialize the RDF_Term into a byte array.

        Where possible, to is better to serialize into a stream, directly using term.write(TProtocol).

      • termFromBytes

        public static RDF_Term termFromBytes​(byte[] bytes)
        Deserialize from a byte array into an RDF_Term.

        Where possible, to is better to deserialize from a stream, directly using term.read(TProtocol).

      • termFromBytes

        public static void termFromBytes​(RDF_Term term,
                                         byte[] bytes)
        Deserialize from a byte array into an RDF_Term.

        Where possible, to is better to deserialize from a stream, directly using term.read(TProtocol).