You are here

function ARC_sparql_parser::parse_GraphGraphPattern in Taxonomy import/export via XML 6

Same name and namespace in other branches
  1. 5.2 arc/ARC_sparql_parser.php \ARC_sparql_parser::parse_GraphGraphPattern()
  2. 5 arc/ARC_sparql_parser.php \ARC_sparql_parser::parse_GraphGraphPattern()
  3. 6.2 arc/ARC_sparql_parser.php \ARC_sparql_parser::parse_GraphGraphPattern()
1 call to ARC_sparql_parser::parse_GraphGraphPattern()
ARC_sparql_parser::parse_GraphPatternNotTriples in arc/ARC_sparql_parser.php

File

arc/ARC_sparql_parser.php, line 801

Class

ARC_sparql_parser

Code

function parse_GraphGraphPattern($val = "") {
  if (preg_match("/^(GRAPH)(\\s*)(.*)\$/is", $val, $matches)) {
    $val = trim($matches[3]);

    /* var */
    if ($sub_result = $this
      ->parse_Var($val)) {
    }
    elseif ($sub_result = $this
      ->parse_BlankNode($val)) {
    }
    elseif ($sub_result = $this
      ->parse_IRIref($val)) {
    }

    /* group */
    if ($sub_result) {
      $val = $sub_result["unparsed_val"];
      unset($sub_result["unparsed_val"]);
      if ($sub_sub_result = $this
        ->parse_GroupGraphPattern($val)) {
        $val = $sub_sub_result["unparsed_val"];
        unset($sub_sub_result["unparsed_val"]);
        return array(
          "type" => "graph",
          "graph" => $sub_result,
          "pattern" => $sub_sub_result,
          "unparsed_val" => $val,
        );
      }
    }
  }

  /* else */
  return false;
}