Class ParserRPQ


public final class ParserRPQ extends GenericParser
Parser for RPQs (Regular Path Queries).
See Also:
  • Constructor Details

    • ParserRPQ

      private ParserRPQ()
      Prevent instantiation.
  • Method Details

    • parse

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

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

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