Class CSVLoader
java.lang.Object
fr.inria.rules.integraal.io.csv.CSVLoader
Loader for CSV files.
CSV files are expected to contain no duplicate data rows. The loader preserves rows as provided by the files and does not deduplicate atoms.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a CSVLoader backed by the given environment. -
Method Summary
Modifier and TypeMethodDescriptionLoads atoms from CSV files into a given factbase using the default parsing parameters.load(FactBase factbase, File rlsFile, char separator, String prefix, int headerSize, Boolean encode_flag) Loads atoms from CSV files into a given factbase.static FactBaseparseAndLoad(IntegraalEnvironment env, FactBase f, File rlsFile, boolean encode) Loads atoms from CSV files into a given factbase.static FactBaseparseAndLoad(IntegraalEnvironment env, FactBase factbase, File rlsFile, char separator, String prefix, int headerSize, Boolean encode_flag) Loads atoms from CSV files into a given factbase.static FactBaseparseAndLoad(FactBase factbase, File rlsFile, char separator, String prefix, int headerSize, Boolean encode_flag) Deprecated.
-
Constructor Details
-
CSVLoader
Creates a CSVLoader backed by the given environment.- Parameters:
env- the environment used to load data
-
-
Method Details
-
parseAndLoad
public static FactBase parseAndLoad(IntegraalEnvironment env, FactBase f, File rlsFile, boolean encode) Loads atoms from CSV files into a given factbase.- Parameters:
env- the environment used for parsingf- factbaserlsFile- RLS configuration file to parseAllencode- a boolean true iff the CSV has to be encoded first- Returns:
- the factbase with loaded atoms
-
load
Loads atoms from CSV files into a given factbase using the default parsing parameters.- Parameters:
f- factbase to load with parsed filesrlsFile- input RLS fileencode- true iff the data must be encoded- Returns:
- the factbase with loaded atoms
-
parseAndLoad
@Deprecated public static FactBase parseAndLoad(FactBase factbase, File rlsFile, char separator, String prefix, int headerSize, Boolean encode_flag) Deprecated.UseparseAndLoad(IntegraalEnvironment, FactBase, File, char, String, int, Boolean)to avoid a throwaway environment that breaks predicate-instance deduplication.Loads atoms from CSV files into a given factbase.- Parameters:
factbase- factbase to load with parsed filesrlsFile- input RLS fileseparator- for CSVprefix- for CSVheaderSize- for CSVencode_flag- true iff the data must be encoded- Returns:
- the factbase with loaded atoms
-
parseAndLoad
public static FactBase parseAndLoad(IntegraalEnvironment env, FactBase factbase, File rlsFile, char separator, String prefix, int headerSize, Boolean encode_flag) Loads atoms from CSV files into a given factbase.- Parameters:
env- the environmentfactbase- factbase to load with parsed filesrlsFile- input RLS fileseparator- for CSVprefix- for CSVheaderSize- for CSVencode_flag- true iff the data must be encoded- Returns:
- the factbase with loaded atoms
-
load
public FactBase load(FactBase factbase, File rlsFile, char separator, String prefix, int headerSize, Boolean encode_flag) Loads atoms from CSV files into a given factbase.- Parameters:
factbase- factbase to load with parsed filesrlsFile- input RLS fileseparator- for CSVprefix- for CSVheaderSize- for CSVencode_flag- true iff the data must be encoded- Returns:
- the factbase with loaded atoms
-
parseAndLoad(IntegraalEnvironment, FactBase, File, char, String, int, Boolean)to avoid a throwaway environment that breaks predicate-instance deduplication.