Class ParserCPQ


public final class ParserCPQ extends GenericParser
Parser for CPQs (Conjunctive Path Queries).
See Also:
  • Constructor Details

    • ParserCPQ

      private ParserCPQ()
      Prevent instantiation.
  • Method Details

    • parse

      public static CPQ parse(String query) throws IllegalArgumentException
      Parses the given CPQ in string form to a CPQ instance. The input is assumed to use brackets where possible and to use the 'id', ''\u25e6'', ''\u2229'' and ''\u207b'' symbols to denote operations. Example input: (0◦(((1◦0) ∩ (1◦1))◦1⁻)).
      Parameters:
      query - The CPQ to parse.
      Returns:
      The parsed CPQ.
      Throws:
      IllegalArgumentException - When the given string is not a valid CPQ.
      See Also:
    • parse

      public static CPQ parse(String query, char join, char intersect, char inverse) throws IllegalArgumentException
      Parses the given CPQ in string form to a CPQ instance. Unlike parse(String) this subroutine allows custom symbols to be used to input the CPQ.
      Parameters:
      query - The CPQ to parse.
      join - The symbol to use for the join/concatenation operation.
      intersect - The symbol to use for the intersection/conjunction operation.
      inverse - The symbol to use for the inverse edge label operation.
      Returns:
      The parsed CPQ.
      Throws:
      IllegalArgumentException - When the given string is not a valid CPQ.
      See Also:
    • parse

      public static CPQ parse(String query, Map<String,Predicate> labels, char join, char intersect, char inverse) throws IllegalArgumentException
      Parses the given CPQ in string form to a CPQ instance. Unlike parse(String) this subroutine allows custom symbols to be used to input the CPQ.
      Parameters:
      query - The CPQ to parse.
      labels - A map with predicates found so far.
      join - The symbol to use for the join/concatenation operation.
      intersect - The symbol to use for the intersection/conjunction operation.
      inverse - The symbol to use for the inverse edge label operation.
      Returns:
      The parsed CPQ.
      Throws:
      IllegalArgumentException - When the given string is not a valid CPQ.