You are here

function ARC_sparql_parser::parse_PrimaryExpression in Taxonomy import/export via XML 5.2

Same name and namespace in other branches
  1. 5 arc/ARC_sparql_parser.php \ARC_sparql_parser::parse_PrimaryExpression()
  2. 6.2 arc/ARC_sparql_parser.php \ARC_sparql_parser::parse_PrimaryExpression()
  3. 6 arc/ARC_sparql_parser.php \ARC_sparql_parser::parse_PrimaryExpression()
1 call to ARC_sparql_parser::parse_PrimaryExpression()
ARC_sparql_parser::parse_UnaryExpression in arc/ARC_sparql_parser.php

File

arc/ARC_sparql_parser.php, line 1472

Class

ARC_sparql_parser

Code

function parse_PrimaryExpression($val = "") {
  if (!$val) {
    return false;
  }

  /* var */
  if (preg_match("/^[\\?\$]{1}([0-9a-z_]+)/i", $val, $matches)) {
    return array(
      "type" => "var",
      /* "var"=>$matches[1], */
      "val" => $matches[1],
      "unparsed_val" => trim(substr($val, strlen($matches[0]))),
    );
  }

  /* built-ins */
  if ($sub_result = $this
    ->parse_BuiltInCall($val)) {
    return $sub_result;
  }

  /* RDFLiteral */
  if ($sub_result = $this
    ->parse_RDFLiteral($val)) {
    return $sub_result;
  }

  /* NumericLiteral */
  if ($sub_result = $this
    ->parse_NumericLiteral($val)) {
    return $sub_result;
  }

  /* BooleanLiteral */
  if ($sub_result = $this
    ->parse_BooleanLiteral($val)) {
    return $sub_result;
  }

  /* bnode */
  if ($sub_result = $this
    ->parse_BlankNode($val)) {
    return $sub_result;
  }

  /* (...) */
  if ($sub_result = $this
    ->parse_BrackettedExpression($val)) {
    return $sub_result;
  }

  /* iri or function */
  if ($sub_result = $this
    ->parse_IRIrefOrFunction($val)) {
    return $sub_result;
  }
  return false;
}