Dear all,
I have a problem with write operation on an OWLIM repository.
I can perform a query operation but when I try to perform a write
operation I get the following exception :
[ERROR exceptions.one_way] java.lang.RuntimeException: Connection is
closed
java.lang.RuntimeException: Connection is closed
at com.ontotext.trree.SailConnectionImpl.addStatement(Unknown Source)
at
org.openrdf.repository.sail.SailRepositoryConnection.addWithoutCommit
(SailRepositoryConnection.java:228)
at
org.openrdf.repository.base.RepositoryConnectionBase.addWithoutCommit
(RepositoryConnectionBase.java:549)
at org.openrdf.repository.base.RepositoryConnectionBase.add
(RepositoryConnectionBase.java:449)
at
eu.soa4all.dsb.space.proactive.datastorage.rdf.owlim.OWLIMStorage.write
(OWLIMStorage.java:88)
My write method is the following :
public void write(Statement stmt) {
RepositoryConnection conn = null;
try {
conn = this.repository.getConnection();
System.out.println("isOpen=" + conn.isOpen());
conn.add(stmt, new URIImpl(spaceURI.toString()));
} catch (RepositoryException e) {
e.printStackTrace();
} finally {
try {
conn.close();
} catch (RepositoryException e) {
e.printStackTrace();
}
}
}
The sysout return isOpen=true.
Does someone has an idea of the problem ?
My second problem is about Serialization. I am retrieving Statements
from an OWLIM repository. I put each Statement in a Set and i transmit
this Set to another JVM on an another machine. Objects need to be
Serializable and it seems that Statement are not Serializable.
I am cheating by using this kind of method :
for (Statement stmt : mySet) {
newSet.add(new StatementImpl(new URIImpl(stmt.getSubject
().stringValue()), new URIImpl(
stmt.getPredicate().stringValue()), new BNodeImpl
(stmt.getObject()
.stringValue())));
}
The problem is that I am not sure that new BNodeImpl(stmt.getObject
().stringValue())) will be the same that stmt.getObject. Is it right ?
I will have the same problem with TupleQueryResult. How to Serialize
these two kinds of results ?
Thanks.
Kind Regards
Laurent PELLEGRINO
_______________________________________________
OWLIM-discussion mailing list
OWLIM-discussion@ontotext.com
http://ontotext.com/mailman/listinfo/owlim-discussion