Author: alexdma
Date: Thu Jun 30 07:59:03 2011
New Revision: 1141432
URL: http://svn.apache.org/viewvc?rev=1141432&view=rev
Log:
STANBOL-178 :
- Fixed null bug in refactored RuleStoreImpl
Modified:
incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/RuleStoreImpl.java
Modified:
incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/RuleStoreImpl.java
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/RuleStoreImpl.java?rev=1141432&r1=1141431&r2=1141432&view=diff
==============================================================================
---
incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/RuleStoreImpl.java
(original)
+++
incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/RuleStoreImpl.java
Thu Jun 30 07:59:03 2011
@@ -249,7 +249,7 @@ public class RuleStoreImpl implements Ru
} catch (OWLOntologyCreationException e) {
log.error("Cannot create the ontology " +
filedir.toString(), e);
} catch (Exception e) {
- log.error("1 Rule Store: no rule ontology available.");
+ log.error("1 Rule Store: no rule ontology
available.",e);
}
}
// default KReSConf dir does not exist
@@ -262,7 +262,7 @@ public class RuleStoreImpl implements Ru
} catch (OWLOntologyCreationException e) {
log.error("Cannot create the ontology " +
inputontology.toString(), e);
} catch (Exception e) {
- log.error("Rule Store: no rule ontology available.");
+ log.error("Rule Store: no rule ontology available.",e);
}
}
@@ -285,16 +285,20 @@ public class RuleStoreImpl implements Ru
}
}
}
- // Rule ontology location is set
+ // Rule ontology location is set. Prefer absolute IRIs to files.
else {
- File pathIri = new File(ruleOntologyLocation);
+
+ IRI pathIri = IRI.create(ruleOntologyLocation);
+ if (!pathIri.isAbsolute())
+ pathIri = IRI.create(new File(ruleOntologyLocation));
+
try {
owlmodel = mgr
- /* OWLManager.createOWLOntologyManager()
*/.loadOntologyFromOntologyDocument(pathIri);
+ /* OWLManager.createOWLOntologyManager()
*/.loadOntology(pathIri);
} catch (OWLOntologyCreationException e) {
log.error("Cannot load the RMI configuration ontology", e);
} catch (Exception e) {
- log.error("Rule Store: no rule ontology available.");
+ log.error("Rule Store: no rule ontology available.",e);
}
}
}