Class ParserUtils

java.lang.Object
com.semedy.reasoner.api.parser.ParserUtils

public class ParserUtils extends Object
Utility methods for parsing facts, rules, queries
Author:
Juergen
  • Constructor Details

    • ParserUtils

      public ParserUtils()
  • Method Details

    • loadAllFactsAndRulesInDirectory

      public static void loadAllFactsAndRulesInDirectory(String directoryPath, Set<Rule> rules, Set<Literal> facts, int maxTermLength) throws IOException, SemReasonerException
      load all rules and facts in files in same (flat) directory
      Parameters:
      directoryPath -
      rules - , container to parse rules into
      facts - , container to parse facts into
      maxTermLength - , max length of a string wo long string encoding
      Throws:
      IOException
      SemReasonerException
    • loadAllPredicateSymbols

      public static Set<String> loadAllPredicateSymbols(String directoryPath, int maxTermLength) throws IOException, SimpleParseException
      return all predicate symbols in all files in same (flat) directory
      Parameters:
      directoryPath -
      maxTermLength - , max length of a string wo long string encoding
      Returns:
      Throws:
      IOException
      SimpleParseException