Class RLSCSVsParser

java.lang.Object
fr.inria.rules.integraal.io.csv.RLSCSVsParser
All Implemented Interfaces:
Parser<Atom>, CloseableIterator<Atom>, Closeable, AutoCloseable

public class RLSCSVsParser extends Object implements Parser<Atom>, AutoCloseable
Parses an RLS CSV configuration file into a stream of atoms.
Author:
Florent Tornil

This class parses a list of CSV file into atoms.

Retrieves CSV files from a configuration file inspired from RLS syntax <a href="https://github.com/knowsys/rulewerk/wiki/Rule-syntax-grammar#source-declarations">...</a> Each line of the configuration file defines a CSV file to be parsed as well as the predicate it defines.

The CSVParser is used for each file. It is assumed that all the CSV file have the same separator, prefix and header size.

  • Constructor Details

    • RLSCSVsParser

      public RLSCSVsParser(String filePath)
      Creates a parser from an RLS configuration file path.
      Parameters:
      filePath - to RLS configuration file to parseAll with default configuration
    • RLSCSVsParser

      public RLSCSVsParser(String filePath, boolean encode)
      Creates a parser from an RLS configuration file path and encoding mode.
      Parameters:
      filePath - to RLS configuration file to parseAll with default configuration
      encode - a boolean true iff the CSV has to be encoded first
    • RLSCSVsParser

      public RLSCSVsParser(File file, char separator, String prefix, int headerSize, boolean encode)
      Creates a parser from an RLS configuration file and CSV options.
      Parameters:
      file - RLS configuration file to parseAll
      separator - separator character of the CSV file
      prefix - prefix of the predicate name
      headerSize - size of the header of the CSV file
      encode - a boolean true iff the CSV has to be encoded first
  • Method Details