Interface ISerializer
-
- All Known Implementing Classes:
CSVSerializer,NtSerializer,TabSeparatedSerializer,TTLSerializer
public interface ISerializerInterface for serializers- Version:
- Jul 12, 2016
- Author:
- Axel-C. Ngonga Ngomo (ngonga@informatik.uni-leipzig.de), Mohamed Sherif (sherif@informatik.uni-leipzig.de)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddStatement(String subject, String predicate, String object, double confidence)Adds a triple to the buffer of the serializer.booleanclose()Closes the output fileFilegetFile(String fileName)Method to open the file with the specific nameStringgetFileExtension()StringgetName()booleanopen(String file)Opens the output filevoidprintStatement(String subject, String predicate, String object, double confidence)Prints a triple in a file.voidsetFolderPath(File folder)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 m, String predicate, String file)Writes the whole results of a mapping to a file
-
-
-
Method Detail
-
writeToFile
void writeToFile(AMapping m, String predicate, String file)
Writes the whole results of a mapping to a file- Parameters:
m- Mapping computed by an organizerpredicate- of the mappingfile- Output file, where the results are to be written
-
setPrefixes
void setPrefixes(Map<String,String> prefixes)
Sets the prefixes to be used in the file.- Parameters:
prefixes- List of prefixes to use
-
printStatement
void printStatement(String subject, String predicate, String object, double confidence)
Prints a triple in a file. Requires the method open to have been carried out- Parameters:
subject- The subject of the triplepredicate- The predicate of the tripleobject- The object of the tripleconfidence- value
-
addStatement
void addStatement(String subject, String predicate, String object, double confidence)
Adds a triple to the buffer of the serializer. Requires the method open to have been carried out- Parameters:
subject- The subject of the triplepredicate- The predicate of the tripleobject- The object of the tripleconfidence- value
-
close
boolean close()
Closes the output file- Returns:
- true if the file was closed successfully, else false
-
open
boolean open(String file)
Opens the output file- 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
String getName()
- Returns:
- name
-
getFileExtension
String getFileExtension()
- Returns:
- file extension
-
getFile
File getFile(String fileName)
Method to open the file with the specific name- Parameters:
fileName- string- Returns:
- file instance
-
setFolderPath
void setFolderPath(File folder)
Method to set the folder where Serializations should be saved to.- Parameters:
folder- File which points to the folder to serialize within.
-
-