Class TTLSerializer
- java.lang.Object
-
- org.aksw.limes.core.io.serializer.TTLSerializer
-
- All Implemented Interfaces:
ISerializer
public class TTLSerializer extends Object implements ISerializer
- Version:
- Jul 12, 2016
- Author:
- Axel-C. Ngonga Ngomo (ngonga@informatik.uni-leipzig.de), Mohamed Sherif (sherif@informatik.uni-leipzig.de)
-
-
Constructor Summary
Constructors Constructor Description TTLSerializer()Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddStatement(String subject, String predicate, String object, double similarity)Adds a statement to the list of statements to be printedbooleanclose()Closes the output filevoidflush()FilegetFile(String fileName)Method to open the file with the specific nameStringgetFileExtension()StringgetName()booleanopen(String file)Opens the output filevoidprintPrefixes()Print prefixesvoidprintStatement(String subject, String predicate, String object, double similarity)Prints a triple in a file.voidsetFolderPath(File f)Method to set the folder where Serializations should be saved to.voidsetPrefixes(Map<String,String> prefixes)Sets the prefixes to be used in the file.voidwriteToFile(AMapping mapping, String predicate, String file)Write the content of the mapping including the expansion of the prefixes to a file
-
-
-
Method Detail
-
addStatement
public void addStatement(String subject, String predicate, String object, double similarity)
Adds a statement to the list of statements to be printed- Specified by:
addStatementin interfaceISerializer- Parameters:
subject- Subject of the triplepredicate- Predicate of the tripleobject- Object of the triplesimilarity- Similarity of subject and object
-
flush
public void flush()
-
writeToFile
public void writeToFile(AMapping mapping, String predicate, String file)
Write the content of the mapping including the expansion of the prefixes to a file- Specified by:
writeToFilein interfaceISerializer- Parameters:
mapping- Mapping to be writtenpredicate- mapping predicate used to connect subjects and objectsfile- Output file
-
printPrefixes
public void printPrefixes()
Print prefixes
-
printStatement
public void printStatement(String subject, String predicate, String object, double similarity)
Description copied from interface:ISerializerPrints a triple in a file. Requires the method open to have been carried out- Specified by:
printStatementin interfaceISerializer- Parameters:
subject- The subject of the triplepredicate- The predicate of the tripleobject- The object of the triplesimilarity- value
-
close
public boolean close()
Description copied from interface:ISerializerCloses the output file- Specified by:
closein interfaceISerializer- Returns:
- true if the file was closed successfully, else false
-
open
public boolean open(String file)
Description copied from interface:ISerializerOpens the output file- Specified by:
openin interfaceISerializer- Parameters:
file- Path to the file in which the output is to be written- Returns:
- true if opening was carried out successfully, else false.
-
getName
public String getName()
- Specified by:
getNamein interfaceISerializer- Returns:
- name
-
setPrefixes
public void setPrefixes(Map<String,String> prefixes)
Description copied from interface:ISerializerSets the prefixes to be used in the file.- Specified by:
setPrefixesin interfaceISerializer- Parameters:
prefixes- List of prefixes to use
-
getFileExtension
public String getFileExtension()
- Specified by:
getFileExtensionin interfaceISerializer- Returns:
- file extension
-
getFile
public File getFile(String fileName)
Description copied from interface:ISerializerMethod to open the file with the specific name- Specified by:
getFilein interfaceISerializer- Parameters:
fileName- string- Returns:
- file instance
-
setFolderPath
public void setFolderPath(File f)
Description copied from interface:ISerializerMethod to set the folder where Serializations should be saved to.- Specified by:
setFolderPathin interfaceISerializer- Parameters:
f- File which points to the folder to serialize within.
-
-