def _get_program_parts(self, program):
    """Parses a SPARQL program into a prefix and conjuncts."""
    # Remove the closing bracket and split on opening bracket.
    if not program.endswith(" rb"):
      raise ValueError("Wrong program format.")
    program_no_closing = program[:-3]
    parts = program_no_closing.split(" lb ")
    if len(parts) != 2:
      raise ValueError("Wrong program format.")
    prefix = parts[0]
    conjuncts_str = parts[1]
    conjuncts = conjuncts_str.split(" . ")
    return prefix, conjuncts
Parses a SPARQL program into a prefix and conjuncts.
language/compir/dataset_parsers/cfq_parser.py