Class TabSeparatedSerializer

  • All Implemented Interfaces:
    ISerializer
    Direct Known Subclasses:
    CSVSerializer

    public class TabSeparatedSerializer
    extends NtSerializer
    Version:
    Jul 12, 2016
    Author:
    Axel-C. Ngonga Ngomo (ngonga@informatik.uni-leipzig.de), Mohamed Sherif (sherif@informatik.uni-leipzig.de)
    • Field Detail

      • seperator

        protected String seperator
    • Constructor Detail

      • TabSeparatedSerializer

        public TabSeparatedSerializer()
    • Method Detail

      • addStatement

        public void addStatement​(String subject,
                                 String predicate,
                                 String object,
                                 double similarity)
        Description copied from interface: ISerializer
        Adds a triple to the buffer of the serializer. Requires the method open to have been carried out
        Specified by:
        addStatement in interface ISerializer
        Overrides:
        addStatement in class NtSerializer
        Parameters:
        subject - The subject of the triple
        predicate - The predicate of the triple
        object - The object of the triple
        similarity - value
      • printStatement

        public void printStatement​(String subject,
                                   String predicate,
                                   String object,
                                   double similarity)
        Description copied from class: NtSerializer
        Writes in the file statement by statement. Rather slow, not to be used
        Specified by:
        printStatement in interface ISerializer
        Overrides:
        printStatement in class NtSerializer
        Parameters:
        subject - Source object of a mapping, subject of the triple to be written
        predicate - Predicate to be written
        object - Target object of a mapping, object of the triple to be written
        similarity - Similarity achieved by the subject and object
      • writeToFile

        public void writeToFile​(AMapping mapping,
                                String predicate,
                                String file)
        Gets a mapping and serializes it to a file in the N3 format. The method assume that the class already knows all the prefixes used in the uris and expands those.
        Specified by:
        writeToFile in interface ISerializer
        Overrides:
        writeToFile in class NtSerializer
        Parameters:
        mapping - Mapping to serialize
        predicate - Predicate to use while serializing
        file - File in which the mapping is to be serialized
      • getSeperator

        public String getSeperator()
        Returns:
        the CSV file separator
      • setSeperator

        public void setSeperator​(String seperator)
        Parameters:
        seperator - to be set