Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rely on exceptions

  • Loading branch information...
commit 3983dc3e46dcd4498b8d016dc42f129dd4e696bd 1 parent e7ce013
@CloCkWeRX CloCkWeRX authored
Showing with 9 additions and 25 deletions.
  1. +9 −25 RDF/Model.php
View
34 RDF/Model.php
@@ -67,13 +67,9 @@ function load($filename, $type = null)
}
}
$temp =& $parser->generateModel($filename);
- if (PEAR::isError($temp)) {
- return $temp;
- }
+
$result = $this->addModel($temp);
- if (PEAR::isError($result)) {
- return $result;
- }
+
if ($this->getBaseURI() == null) {
$this->setBaseURI($temp->getBaseURI());
}
@@ -96,18 +92,12 @@ function _addStatementFromAnotherModel($statement, &$blankNodes_tmp)
$label = $subject->getLabel();
if (!array_key_exists($label, $blankNodes_tmp)) {
$res1 = $this->findFirstMatchingStatement($subject, null, null);
- if (PEAR::isError($res1)) {
- return $res1;
- }
+
$res2 = $this->findFirstMatchingStatement(null, null, $subject);
- if (PEAR::isError($res2)) {
- return $res2;
- }
+
if ($res1 || $res2) {
$blankNodes_tmp[$label] =& RDF_BlankNode::factory($this);
- if (PEAR::isError($blankNodes_tmp[$label])) {
- return $blankNodes_tmp[$label];
- }
+
$statement->subj = $blankNodes_tmp[$label];
} else {
$blankNodes_tmp[$label] = $subject;
@@ -121,18 +111,12 @@ function _addStatementFromAnotherModel($statement, &$blankNodes_tmp)
$label = $object->getLabel();
if (!array_key_exists($label, $blankNodes_tmp)) {
$res1 = $this->findFirstMatchingStatement($object, null, null);
- if (PEAR::isError($res1)) {
- return $res1;
- }
+
$res2 = $this->findFirstMatchingStatement(null, null, $object);
- if (PEAR::isError($res2)) {
- return $res2;
- }
+
if ($res1 || $res2) {
$blankNodes_tmp[$label] =& RDF_BlankNode::factory($this);
- if (PEAR::isError($blankNodes_tmp[$label])) {
- return $blankNodes_tmp[$label];
- }
+
$statement->obj = $blankNodes_tmp[$label];
} else {
$blankNodes_tmp[$label] = $object;
@@ -146,4 +130,4 @@ function _addStatementFromAnotherModel($statement, &$blankNodes_tmp)
}
} // end: Model
-?>
+?>
Please sign in to comment.
Something went wrong with that request. Please try again.