function ARC_sparql_parser::parse_BlankNode in Taxonomy import/export via XML 6.2
Same name and namespace in other branches
- 5.2 arc/ARC_sparql_parser.php \ARC_sparql_parser::parse_BlankNode()
- 5 arc/ARC_sparql_parser.php \ARC_sparql_parser::parse_BlankNode()
- 6 arc/ARC_sparql_parser.php \ARC_sparql_parser::parse_BlankNode()
3 calls to ARC_sparql_parser::parse_BlankNode()
File
- arc/
ARC_sparql_parser.php, line 1610
Class
Code
function parse_BlankNode($val = "") {
/* _:foo */
if (preg_match("/^_\\:([a-z0-9\\.\\-\\_]*)(.*)\$/si", $val, $matches)) {
if (!in_array("__" . $matches[1], $this->infos["vars"])) {
$this->infos["vars"][] = "__" . $matches[1];
}
return array(
"type" => "bnode",
"val" => "_:" . $matches[1],
"unparsed_val" => trim($matches[2]),
);
}
/* [] */
if (preg_match("/^\\[\\s*\\](.*)\$/s", $val, $matches)) {
$id = $this
->get_next_bnode_id();
if (!in_array(str_replace(":", "_", $id), $this->infos["vars"])) {
$this->infos["vars"][] = str_replace(":", "_", $id);
}
return array(
"type" => "bnode",
"val" => $id,
"unparsed_val" => trim($matches[1]),
);
}
/* else */
return false;
}