Class TabSeparatedSerializer
- java.lang.Object
-
- org.aksw.limes.core.io.serializer.NtSerializer
-
- org.aksw.limes.core.io.serializer.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 Summary
Fields Modifier and Type Field Description protected Stringseperator-
Fields inherited from class org.aksw.limes.core.io.serializer.NtSerializer
folder, prefixMap, statements, writer
-
-
Constructor Summary
Constructors Constructor Description TabSeparatedSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddStatement(String subject, String predicate, String object, double similarity)Adds a triple to the buffer of the serializer.StringgetFileExtension()StringgetName()StringgetSeperator()voidprintStatement(String subject, String predicate, String object, double similarity)Writes in the file statement by statement.voidsetSeperator(String seperator)voidwriteToFile(AMapping mapping, String predicate, String file)Gets a mapping and serializes it to a file in the N3 format.-
Methods inherited from class org.aksw.limes.core.io.serializer.NtSerializer
close, expand, flush, getFile, open, printPrefixes, setFolderPath, setPrefixes
-
-
-
-
Field Detail
-
seperator
protected String seperator
-
-
Method Detail
-
addStatement
public void addStatement(String subject, String predicate, String object, double similarity)
Description copied from interface:ISerializerAdds a triple to the buffer of the serializer. Requires the method open to have been carried out- Specified by:
addStatementin interfaceISerializer- Overrides:
addStatementin classNtSerializer- Parameters:
subject- The subject of the triplepredicate- The predicate of the tripleobject- The object of the triplesimilarity- value
-
printStatement
public void printStatement(String subject, String predicate, String object, double similarity)
Description copied from class:NtSerializerWrites in the file statement by statement. Rather slow, not to be used- Specified by:
printStatementin interfaceISerializer- Overrides:
printStatementin classNtSerializer- Parameters:
subject- Source object of a mapping, subject of the triple to be writtenpredicate- Predicate to be writtenobject- Target object of a mapping, object of the triple to be writtensimilarity- Similarity achieved by the subject and object
-
getName
public String getName()
- Specified by:
getNamein interfaceISerializer- Overrides:
getNamein classNtSerializer- Returns:
- name
-
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:
writeToFilein interfaceISerializer- Overrides:
writeToFilein classNtSerializer- Parameters:
mapping- Mapping to serializepredicate- Predicate to use while serializingfile- File in which the mapping is to be serialized
-
getFileExtension
public String getFileExtension()
- Specified by:
getFileExtensionin interfaceISerializer- Overrides:
getFileExtensionin classNtSerializer- Returns:
- file extension
-
getSeperator
public String getSeperator()
- Returns:
- the CSV file separator
-
setSeperator
public void setSeperator(String seperator)
- Parameters:
seperator- to be set
-
-